Skip to content

Commit

Permalink
no breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed Nov 12, 2023
1 parent 628ac61 commit dcf2afd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/emnapi/include/js_native_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
#endif
#endif

#ifndef EMNAPI_UNMODIFIED_UPSTREAM
#if !defined(NAPI_EXTERN) && defined(__EMSCRIPTEN__)
#define NAPI_EXTERN __attribute__((__import_module__("env")))
#endif
#endif

#include "js_native_api_types.h"

// If you need __declspec(dllimport), either include <node_api.h> instead, or
Expand Down
10 changes: 10 additions & 0 deletions packages/emnapi/include/node_api.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
#ifndef SRC_NODE_API_H_
#define SRC_NODE_API_H_

#ifndef EMNAPI_UNMODIFIED_UPSTREAM
#ifndef BUILDING_NODE_EXTENSION
#define BUILDING_NODE_EXTENSION
#endif

#if !defined(NAPI_EXTERN) && defined(__EMSCRIPTEN__)
#define NAPI_EXTERN __attribute__((__import_module__("env")))
#endif
#endif

#if defined(BUILDING_NODE_EXTENSION) && !defined(NAPI_EXTERN)
#ifdef _WIN32
// Building native addon against node
Expand Down

0 comments on commit dcf2afd

Please sign in to comment.