emnapi 0.41.0 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CMakeLists.txt CHANGED
@@ -97,12 +97,14 @@ if(IS_WASM32)
97
97
  ${MALLOC_PUBLIC_SOURCES}
98
98
  "${CMAKE_CURRENT_SOURCE_DIR}/src/malloc/emmalloc/emmalloc.c"
99
99
  )
100
+ target_compile_options(${EMMALLOC_TARGET_NAME} PRIVATE "-fno-strict-aliasing")
100
101
  target_compile_definitions(${EMMALLOC_TARGET_NAME} PRIVATE "PAGESIZE=65536")
101
102
 
102
103
  add_library(${EMMALLOC_MT_TARGET_NAME} STATIC
103
104
  ${MALLOC_PUBLIC_SOURCES}
104
105
  "${CMAKE_CURRENT_SOURCE_DIR}/src/malloc/emmalloc/emmalloc.c"
105
106
  )
107
+ target_compile_options(${EMMALLOC_MT_TARGET_NAME} PRIVATE "-fno-strict-aliasing")
106
108
  target_compile_options(${EMMALLOC_MT_TARGET_NAME} PUBLIC "-matomics" "-mbulk-memory")
107
109
  target_compile_definitions(${EMMALLOC_MT_TARGET_NAME} PRIVATE "PAGESIZE=65536" "__EMSCRIPTEN_SHARED_MEMORY__=1")
108
110
  endif()
package/README.md CHANGED
@@ -109,7 +109,7 @@ Create `hello.c`.
109
109
  ```c
110
110
  #include <node_api.h>
111
111
 
112
- #define NAPI_CALL(env, the_call) \
112
+ #define NODE_API_CALL(env, the_call) \
113
113
  do { \
114
114
  if ((the_call) != napi_ok) { \
115
115
  const napi_extended_error_info *error_info; \
@@ -130,15 +130,15 @@ Create `hello.c`.
130
130
  static napi_value js_hello(napi_env env, napi_callback_info info) {
131
131
  napi_value world;
132
132
  const char* str = "world";
133
- NAPI_CALL(env, napi_create_string_utf8(env, str, NAPI_AUTO_LENGTH, &world));
133
+ NODE_API_CALL(env, napi_create_string_utf8(env, str, NAPI_AUTO_LENGTH, &world));
134
134
  return world;
135
135
  }
136
136
 
137
137
  NAPI_MODULE_INIT() {
138
138
  napi_value hello;
139
- NAPI_CALL(env, napi_create_function(env, "hello", NAPI_AUTO_LENGTH,
139
+ NODE_API_CALL(env, napi_create_function(env, "hello", NAPI_AUTO_LENGTH,
140
140
  js_hello, NULL, &hello));
141
- NAPI_CALL(env, napi_set_named_property(env, exports, "hello", hello));
141
+ NODE_API_CALL(env, napi_set_named_property(env, exports, "hello", hello));
142
142
  return exports;
143
143
  }
144
144
  ```