Skip to content

Commit bc0c142

Browse files
lxbndrcodebytere
authored andcommitted
src: define noreturn attribute for windows
PR-URL: #31467 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gabriel Schulhof <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 9e9dbd4 commit bc0c142

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/node_api.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ struct uv_loop_s; // Forward declaration.
1818
# define NAPI_MODULE_EXPORT __attribute__((visibility("default")))
1919
#endif
2020

21-
#ifdef __GNUC__
22-
#define NAPI_NO_RETURN __attribute__((noreturn))
21+
#if defined(__GNUC__)
22+
# define NAPI_NO_RETURN __attribute__((noreturn))
23+
#elif defined(_WIN32)
24+
# define NAPI_NO_RETURN __declspec(noreturn)
2325
#else
24-
#define NAPI_NO_RETURN
26+
# define NAPI_NO_RETURN
2527
#endif
2628

2729
typedef napi_value (*napi_addon_register_func)(napi_env env,

0 commit comments

Comments
 (0)