aboutsummaryrefslogtreecommitdiffstats
path: root/c_src/nif_helpers.h
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-04-19 15:34:12 +0200
committerLoïc Hoguin <[email protected]>2017-04-19 15:34:12 +0200
commit1ea180459b74165036eea638f61f78e688867eac (patch)
treed7ee36419a0f7f3f6e9054898bad7a45af55ae2f /c_src/nif_helpers.h
parent1947c4d7f32272ec0c5b9295808cde4c9138995c (diff)
downloadesdl2-1ea180459b74165036eea638f61f78e688867eac.tar.gz
esdl2-1ea180459b74165036eea638f61f78e688867eac.tar.bz2
esdl2-1ea180459b74165036eea638f61f78e688867eac.zip
Improve C++ compatibility
Changes imported from a customer project.
Diffstat (limited to 'c_src/nif_helpers.h')
-rw-r--r--c_src/nif_helpers.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/c_src/nif_helpers.h b/c_src/nif_helpers.h
index 111ea84..2eefec6 100644
--- a/c_src/nif_helpers.h
+++ b/c_src/nif_helpers.h
@@ -120,11 +120,19 @@
typedef void* nif_thread_arg;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void* nif_create_main_thread(char*);
void nif_destroy_main_thread(void*);
ERL_NIF_TERM nif_thread_cast(ErlNifEnv*, void (*f)(nif_thread_arg*), int a, ...);
ERL_NIF_TERM nif_thread_call(ErlNifEnv*, ERL_NIF_TERM (*f)(ErlNifEnv*, nif_thread_arg*), int a, ...);
+#ifdef __cplusplus
+}
+#endif
+
#define NIF_CAST_HANDLER(f) static void f(nif_thread_arg* args)
#define NIF_CALL_HANDLER(f) static ERL_NIF_TERM f(ErlNifEnv* env, nif_thread_arg* args)