From 1ea180459b74165036eea638f61f78e688867eac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 19 Apr 2017 15:34:12 +0200 Subject: Improve C++ compatibility Changes imported from a customer project. --- c_src/nif_helpers.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'c_src/nif_helpers.h') 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) -- cgit v1.2.3