diff options
author | Alexander Smarus <bender@readdle.com> | 2020-01-23 00:29:44 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2020-01-25 21:08:57 +0300 |
commit | 3188afebf472976460f54559e205b6e18af0343f (patch) | |
tree | f399b2e1e90669832a19344cdeab1f5780ac6e63 /src/node_api.h | |
parent | 08f57265b5c58c16af9e93510cda39462ecf2713 (diff) |
src: define noreturn attribute for windows
PR-URL: https://github.com/nodejs/node/pull/31467
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src/node_api.h')
-rw-r--r-- | src/node_api.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/node_api.h b/src/node_api.h index a37ee06ce16..a4d3cc60e9b 100644 --- a/src/node_api.h +++ b/src/node_api.h @@ -18,10 +18,12 @@ struct uv_loop_s; // Forward declaration. # define NAPI_MODULE_EXPORT __attribute__((visibility("default"))) #endif -#ifdef __GNUC__ -#define NAPI_NO_RETURN __attribute__((noreturn)) +#if defined(__GNUC__) +# define NAPI_NO_RETURN __attribute__((noreturn)) +#elif defined(_WIN32) +# define NAPI_NO_RETURN __declspec(noreturn) #else -#define NAPI_NO_RETURN +# define NAPI_NO_RETURN #endif typedef napi_value (*napi_addon_register_func)(napi_env env, |