mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
node-api: avoid macro redefinition
Even though the redefinition complies with the C standard because the second definition is "effectively the same" as the first definition, it's best to avoid any redefinition. Refs: https://github.com/nodejs/node/pull/28237 Refs: https://github.com/nodejs/node/pull/30006 PR-URL: https://github.com/nodejs/node/pull/48879 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
@@ -268,14 +268,6 @@ inline napi_status napi_set_last_error(napi_env env,
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define RETURN_STATUS_IF_FALSE_WITH_PREAMBLE(env, condition, status) \
|
||||
do { \
|
||||
if (!(condition)) { \
|
||||
return napi_set_last_error( \
|
||||
(env), try_catch.HasCaught() ? napi_pending_exception : (status)); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define CHECK_MAYBE_EMPTY_WITH_PREAMBLE(env, maybe, status) \
|
||||
RETURN_STATUS_IF_FALSE_WITH_PREAMBLE((env), !((maybe).IsEmpty()), (status))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user