Skip to content

Commit

Permalink
do not include js_native_api.h in emnapi.h (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi authored Oct 20, 2023
1 parent dac1931 commit c0d4197
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion packages/emnapi/include/emnapi.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#ifndef EMNAPI_INCLUDE_EMNAPI_H_
#define EMNAPI_INCLUDE_EMNAPI_H_

#include "js_native_api.h"
#include <stdbool.h>
#include "js_native_api_types.h"
#include "emnapi_common.h"

typedef enum {
Expand Down
2 changes: 1 addition & 1 deletion packages/emnapi/src/async_cleanup_hook.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "emnapi_internal.h"
#include "node_api.h"
#include "emnapi_internal.h"

#if NAPI_VERSION >= 8

Expand Down
2 changes: 1 addition & 1 deletion packages/emnapi/src/node_api.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "emnapi_internal.h"
#include "node_api.h"
#include "emnapi_internal.h"

#if EMNAPI_HAVE_THREADS
#include "uv.h"
Expand Down
3 changes: 2 additions & 1 deletion packages/test/buffer/binding.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include <node_api.h>

#ifdef __wasm__
#include <emnapi.h>
#endif

#include <node_api.h>
#include "../common.h"

void* malloc(size_t size);
Expand Down
2 changes: 1 addition & 1 deletion packages/test/fnwrap/myobject.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "myobject.h"
#ifdef __wasm__
#include <emnapi.h>
#endif
#include "myobject.h"
#include "../common.h"

#if !(!defined(__wasm__) || (defined(__EMSCRIPTEN__) || defined(__wasi__)))
Expand Down
3 changes: 2 additions & 1 deletion packages/test/typedarray/binding.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include <js_native_api.h>

#ifdef __wasm__
#include <emnapi.h>
#endif

#include <js_native_api.h>
// #include <string.h>
// #include <stdlib.h>
#include "../common.h"
Expand Down

0 comments on commit c0d4197

Please sign in to comment.