From c0d4197d9bcb63e88ab0ba52fab26ab63e7ddaa9 Mon Sep 17 00:00:00 2001 From: Toyo Li Date: Fri, 20 Oct 2023 22:02:07 +0800 Subject: [PATCH] do not include `js_native_api.h` in `emnapi.h` (#86) --- packages/emnapi/include/emnapi.h | 3 ++- packages/emnapi/src/async_cleanup_hook.c | 2 +- packages/emnapi/src/node_api.c | 2 +- packages/test/buffer/binding.c | 3 ++- packages/test/fnwrap/myobject.cc | 2 +- packages/test/typedarray/binding.c | 3 ++- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/emnapi/include/emnapi.h b/packages/emnapi/include/emnapi.h index e9f3c5b2..413ffbb5 100644 --- a/packages/emnapi/include/emnapi.h +++ b/packages/emnapi/include/emnapi.h @@ -1,7 +1,8 @@ #ifndef EMNAPI_INCLUDE_EMNAPI_H_ #define EMNAPI_INCLUDE_EMNAPI_H_ -#include "js_native_api.h" +#include +#include "js_native_api_types.h" #include "emnapi_common.h" typedef enum { diff --git a/packages/emnapi/src/async_cleanup_hook.c b/packages/emnapi/src/async_cleanup_hook.c index f6fbe5b6..2d5f6935 100644 --- a/packages/emnapi/src/async_cleanup_hook.c +++ b/packages/emnapi/src/async_cleanup_hook.c @@ -1,5 +1,5 @@ -#include "emnapi_internal.h" #include "node_api.h" +#include "emnapi_internal.h" #if NAPI_VERSION >= 8 diff --git a/packages/emnapi/src/node_api.c b/packages/emnapi/src/node_api.c index 67686bda..c48744a6 100644 --- a/packages/emnapi/src/node_api.c +++ b/packages/emnapi/src/node_api.c @@ -1,5 +1,5 @@ -#include "emnapi_internal.h" #include "node_api.h" +#include "emnapi_internal.h" #if EMNAPI_HAVE_THREADS #include "uv.h" diff --git a/packages/test/buffer/binding.c b/packages/test/buffer/binding.c index 0b5916f5..938ac53b 100644 --- a/packages/test/buffer/binding.c +++ b/packages/test/buffer/binding.c @@ -1,8 +1,9 @@ +#include + #ifdef __wasm__ #include #endif -#include #include "../common.h" void* malloc(size_t size); diff --git a/packages/test/fnwrap/myobject.cc b/packages/test/fnwrap/myobject.cc index f8b75000..e8bc5f4f 100644 --- a/packages/test/fnwrap/myobject.cc +++ b/packages/test/fnwrap/myobject.cc @@ -1,7 +1,7 @@ +#include "myobject.h" #ifdef __wasm__ #include #endif -#include "myobject.h" #include "../common.h" #if !(!defined(__wasm__) || (defined(__EMSCRIPTEN__) || defined(__wasi__))) diff --git a/packages/test/typedarray/binding.c b/packages/test/typedarray/binding.c index 3449de18..5e7ec9e5 100644 --- a/packages/test/typedarray/binding.c +++ b/packages/test/typedarray/binding.c @@ -1,8 +1,9 @@ +#include + #ifdef __wasm__ #include #endif -#include // #include // #include #include "../common.h"