Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable extras/module-node and examples/debug-trans-socket to be used in DLLs #2020

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions examples/debug-trans-socket/duk_trans_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
2 changes: 2 additions & 0 deletions examples/debug-trans-socket/duk_trans_socket_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* defining USE_SELECT. See https://daniel.haxx.se/docs/poll-vs-select.html.
*/

#define DUK_COMPILING_DUKTAPE

#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
Expand Down
2 changes: 2 additions & 0 deletions examples/debug-trans-socket/duk_trans_socket_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions extras/module-node/duk_module_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* https://nodejs.org/api/modules.html
*/

#define DUK_COMPILING_DUKTAPE

#include "duktape.h"
#include "duk_module_node.h"

Expand Down
4 changes: 2 additions & 2 deletions extras/module-node/duk_module_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down