aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lv2/lv2plug.in/ns/ext/event/event-helpers.h16
-rw-r--r--wscript19
2 files changed, 32 insertions, 3 deletions
diff --git a/lv2/lv2plug.in/ns/ext/event/event-helpers.h b/lv2/lv2plug.in/ns/ext/event/event-helpers.h
index 8e29507..fcd13fe 100644
--- a/lv2/lv2plug.in/ns/ext/event/event-helpers.h
+++ b/lv2/lv2plug.in/ns/ext/event/event-helpers.h
@@ -22,13 +22,19 @@
#ifndef LV2_EVENT_HELPERS_H
#define LV2_EVENT_HELPERS_H
+#include <assert.h>
#include <stdint.h>
-#include <stdbool.h>
-#include <string.h>
#include <stdlib.h>
-#include <assert.h>
+#include <string.h>
+
#include "lv2/lv2plug.in/ns/ext/event/event.h"
+#ifdef __cplusplus
+extern "C" {
+#else
+# include <stdbool.h>
+#endif
+
/** @file
* Helper functions for the LV2 Event extension
* <http://lv2plug.in/ns/ext/event>.
@@ -246,5 +252,9 @@ lv2_event_write_event(LV2_Event_Iterator* iter,
return true;
}
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
#endif /* LV2_EVENT_HELPERS_H */
diff --git a/wscript b/wscript
index 61dd66c..18381a9 100644
--- a/wscript
+++ b/wscript
@@ -307,6 +307,25 @@ def build(bld):
source = ['lv2/lv2plug.in/ns/index.html.in'] + index_files,
target = 'ns/index.html')
+ if bld.env['BUILD_TESTS']:
+ # Generate a compile test .c file that includes all headers
+ def gen_build_test(task):
+ out = open(task.outputs[0].abspath(), 'w')
+ for i in task.inputs:
+ out.write('#include "%s"\n' % i.bldpath())
+ out.write('int main() { return 0; }\n')
+ out.close()
+
+ bld(rule = gen_build_test,
+ source = bld.path.ant_glob('lv2/**/*.h'),
+ target = 'build_test.c',
+ install_path = None)
+
+ bld(features = 'c',
+ source = bld.path.get_bld().make_node('build_test.c'),
+ target = 'build_test',
+ install_path = None)
+
def lint(ctx):
for i in (['lv2/lv2plug.in/ns/lv2core/lv2.h']
+ glob.glob('lv2/lv2plug.in/ns/ext/*/*.h')