Skip to content

fix(build): separate preprocessor definitions - #212

Open
kellen-miller wants to merge 1 commit into
discordjs:mainfrom
kellen-miller:fix/native-build-warnings
Open

kellen-miller wants to merge 1 commit into
discordjs:mainfrom
kellen-miller:fix/native-build-warnings

Conversation

@kellen-miller

Copy link
Copy Markdown

Description

GYP concatenates adjacent "POSIX," "__STDC_FORMAT_MACROS" literals into one malformed compiler definition. Separate the entries so both macros are defined correctly. Closes #210.

  • Code changes have been tested

Summary

- "POSIX," "__STDC_FORMAT_MACROS",
+ "POSIX",
+ "__STDC_FORMAT_MACROS",

Evidence

  • Before: Preprocessing with the generated -DPOSIX,__STDC_FORMAT_MACROS emits an invalid macro-name warning and leaves __STDC_FORMAT_MACROS undefined.
    After: Separate -DPOSIX -D__STDC_FORMAT_MACROS defines both macros to 1 without that warning.
  • macOS ARM64, Node 24.13: source rebuild (node-pre-gyp rebuild --napi_build_version=3) and npm test pass.
  • git diff --check passes. Repository-wide npm run lint stops on existing formatting in unchanged tests/test.js; this PR only changes binding.gyp.

Merge Danger

Door: two-way

Blast Radius: build

No codec source, compiler warning settings, or runtime JavaScript changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Malformed GYP macros concatenate POSIX definitions

1 participant