Skip to content

Commit 5fe7800

Browse files
node-api: add warning for NAPI_EXPERIMENTAL
PR-URL: #58280 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Edy Silva <[email protected]> Reviewed-By: Stefan Stojanovic <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Vladimir Morozov <[email protected]>
1 parent 3ac0e28 commit 5fe7800

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/js_native_api.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@
2121
#endif
2222
#endif
2323

24+
#if defined(NAPI_EXPERIMENTAL) && \
25+
!defined(NODE_API_EXPERIMENTAL_NO_WARNING) && \
26+
!defined(NODE_WANT_INTERNALS)
27+
#ifdef _MSC_VER
28+
#pragma message("NAPI_EXPERIMENTAL is enabled. " \
29+
"Experimental features may be unstable.")
30+
#else
31+
#warning "NAPI_EXPERIMENTAL is enabled. " \
32+
"Experimental features may be unstable."
33+
#endif
34+
#endif
35+
2436
#include "js_native_api_types.h"
2537

2638
// If you need __declspec(dllimport), either include <node_api.h> instead, or

0 commit comments

Comments
 (0)