Skip to content

Commit

Permalink
node-api: avoid macro redefinition
Browse files Browse the repository at this point in the history
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: nodejs/node#28237
Refs: nodejs/node#30006
PR-URL: nodejs/node#48879
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
sercher committed Apr 25, 2024
1 parent 208d856 commit 36f0e74
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions graal-nodejs/src/js_native_api_v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,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))

Expand Down

0 comments on commit 36f0e74

Please sign in to comment.