diff --git a/examples/debug-trans-socket/duk_trans_socket.h b/examples/debug-trans-socket/duk_trans_socket.h index 281ddc81f7..f4f03a01cb 100644 --- a/examples/debug-trans-socket/duk_trans_socket.h +++ b/examples/debug-trans-socket/duk_trans_socket.h @@ -3,13 +3,21 @@ #include "duktape.h" -void duk_trans_socket_init(void); -void duk_trans_socket_finish(void); -void duk_trans_socket_waitconn(void); -duk_size_t duk_trans_socket_read_cb(void *udata, char *buffer, duk_size_t length); -duk_size_t duk_trans_socket_write_cb(void *udata, const char *buffer, duk_size_t length); -duk_size_t duk_trans_socket_peek_cb(void *udata); -void duk_trans_socket_read_flush_cb(void *udata); -void duk_trans_socket_write_flush_cb(void *udata); +#if defined(__cplusplus) +extern "C" { +#endif + +DUK_EXTERNAL_DECL void duk_trans_socket_init(void); +DUK_EXTERNAL_DECL void duk_trans_socket_finish(void); +DUK_EXTERNAL_DECL void duk_trans_socket_waitconn(void); +DUK_EXTERNAL_DECL duk_size_t duk_trans_socket_read_cb(void *udata, char *buffer, duk_size_t length); +DUK_EXTERNAL_DECL duk_size_t duk_trans_socket_write_cb(void *udata, const char *buffer, duk_size_t length); +DUK_EXTERNAL_DECL duk_size_t duk_trans_socket_peek_cb(void *udata); +DUK_EXTERNAL_DECL void duk_trans_socket_read_flush_cb(void *udata); +DUK_EXTERNAL_DECL void duk_trans_socket_write_flush_cb(void *udata); + +#if defined(__cplusplus) +} +#endif /* end 'extern "C"' wrapper */ #endif /* DUK_TRANS_SOCKET_H_INCLUDED */ diff --git a/examples/debug-trans-socket/duk_trans_socket_unix.c b/examples/debug-trans-socket/duk_trans_socket_unix.c index 0633eff215..9eac5d4c67 100644 --- a/examples/debug-trans-socket/duk_trans_socket_unix.c +++ b/examples/debug-trans-socket/duk_trans_socket_unix.c @@ -9,6 +9,8 @@ * defining USE_SELECT. See https://daniel.haxx.se/docs/poll-vs-select.html. */ +#define DUK_COMPILING_DUKTAPE + #include #include #include diff --git a/examples/debug-trans-socket/duk_trans_socket_windows.c b/examples/debug-trans-socket/duk_trans_socket_windows.c index 59bee04d06..e0b1226d77 100644 --- a/examples/debug-trans-socket/duk_trans_socket_windows.c +++ b/examples/debug-trans-socket/duk_trans_socket_windows.c @@ -31,6 +31,8 @@ * prep/duktape.c -lm -lws2_32 */ +#define DUK_COMPILING_DUKTAPE + #undef UNICODE #if !defined(WIN32_LEAN_AND_MEAN) #define WIN32_LEAN_AND_MEAN diff --git a/extras/module-node/duk_module_node.c b/extras/module-node/duk_module_node.c index 9dd48bf53d..01eb08b05e 100644 --- a/extras/module-node/duk_module_node.c +++ b/extras/module-node/duk_module_node.c @@ -4,6 +4,8 @@ * https://nodejs.org/api/modules.html */ +#define DUK_COMPILING_DUKTAPE + #include "duktape.h" #include "duk_module_node.h" diff --git a/extras/module-node/duk_module_node.h b/extras/module-node/duk_module_node.h index 12772bf67b..7179926e5d 100644 --- a/extras/module-node/duk_module_node.h +++ b/extras/module-node/duk_module_node.h @@ -7,8 +7,8 @@ extern "C" { #endif -extern duk_ret_t duk_module_node_peval_main(duk_context *ctx, const char *path); -extern void duk_module_node_init(duk_context *ctx); +DUK_EXTERNAL_DECL duk_ret_t duk_module_node_peval_main(duk_context *ctx, const char *path); +DUK_EXTERNAL_DECL void duk_module_node_init(duk_context *ctx); #if defined(__cplusplus) }