|
34 | 34 | extern "C" {
|
35 | 35 | #endif
|
36 | 36 |
|
37 |
| -JSModuleDef *js_init_module_std(JSContext *ctx, const char *module_name); |
38 |
| -JSModuleDef *js_init_module_os(JSContext *ctx, const char *module_name); |
39 |
| -JSModuleDef *js_init_module_bjson(JSContext *ctx, const char *module_name); |
40 |
| -void js_std_add_helpers(JSContext *ctx, int argc, char **argv); |
41 |
| -int js_std_loop(JSContext *ctx); |
42 |
| -JSValue js_std_await(JSContext *ctx, JSValue obj); |
43 |
| -void js_std_init_handlers(JSRuntime *rt); |
44 |
| -void js_std_free_handlers(JSRuntime *rt); |
45 |
| -void js_std_dump_error(JSContext *ctx); |
46 |
| -uint8_t *js_load_file(JSContext *ctx, size_t *pbuf_len, const char *filename); |
47 |
| -int js_module_set_import_meta(JSContext *ctx, JSValueConst func_val, |
48 |
| - bool use_realpath, bool is_main); |
49 |
| -JSModuleDef *js_module_loader(JSContext *ctx, |
50 |
| - const char *module_name, void *opaque); |
51 |
| -void js_std_eval_binary(JSContext *ctx, const uint8_t *buf, size_t buf_len, |
52 |
| - int flags); |
53 |
| -void js_std_promise_rejection_tracker(JSContext *ctx, JSValueConst promise, |
54 |
| - JSValueConst reason, |
55 |
| - bool is_handled, void *opaque); |
56 |
| -void js_std_set_worker_new_context_func(JSContext *(*func)(JSRuntime *rt)); |
| 37 | +#if defined(__GNUC__) || defined(__clang__) |
| 38 | +#define JS_EXTERN __attribute__((visibility("default"))) |
| 39 | +#else |
| 40 | +#define JS_EXTERN /* nothing */ |
| 41 | +#endif |
| 42 | + |
| 43 | +JS_EXTERN JSModuleDef *js_init_module_std(JSContext *ctx, |
| 44 | + const char *module_name); |
| 45 | +JS_EXTERN JSModuleDef *js_init_module_os(JSContext *ctx, |
| 46 | + const char *module_name); |
| 47 | +JS_EXTERN JSModuleDef *js_init_module_bjson(JSContext *ctx, |
| 48 | + const char *module_name); |
| 49 | +JS_EXTERN void js_std_add_helpers(JSContext *ctx, int argc, char **argv); |
| 50 | +JS_EXTERN int js_std_loop(JSContext *ctx); |
| 51 | +JS_EXTERN JSValue js_std_await(JSContext *ctx, JSValue obj); |
| 52 | +JS_EXTERN void js_std_init_handlers(JSRuntime *rt); |
| 53 | +JS_EXTERN void js_std_free_handlers(JSRuntime *rt); |
| 54 | +JS_EXTERN void js_std_dump_error(JSContext *ctx); |
| 55 | +JS_EXTERN uint8_t *js_load_file(JSContext *ctx, size_t *pbuf_len, |
| 56 | + const char *filename); |
| 57 | +JS_EXTERN int js_module_set_import_meta(JSContext *ctx, JSValueConst func_val, |
| 58 | + bool use_realpath, bool is_main); |
| 59 | +JS_EXTERN JSModuleDef *js_module_loader(JSContext *ctx, |
| 60 | + const char *module_name, void *opaque); |
| 61 | +JS_EXTERN void js_std_eval_binary(JSContext *ctx, const uint8_t *buf, |
| 62 | + size_t buf_len, int flags); |
| 63 | +JS_EXTERN void js_std_promise_rejection_tracker(JSContext *ctx, |
| 64 | + JSValueConst promise, |
| 65 | + JSValueConst reason, |
| 66 | + bool is_handled, |
| 67 | + void *opaque); |
| 68 | +JS_EXTERN void js_std_set_worker_new_context_func(JSContext *(*func)(JSRuntime *rt)); |
| 69 | + |
| 70 | +#undef JS_EXTERN |
57 | 71 |
|
58 | 72 | #ifdef __cplusplus
|
59 | 73 | } /* extern "C" { */
|
|
0 commit comments