Skip to content

Conversation

@KevinEady
Copy link
Contributor

@KevinEady KevinEady commented Oct 16, 2025

Fix support of nested #ifdef where inner #ifdef / #else / #endif blocks were still being added even if the outer block should have been ignored / excluded.

This PR was merged into my personal fork as KevinEady@9658d86 and created the header sync PR KevinEady#102 :

@@ -17,6 +17,7 @@
 #define NAPI_VERSION 8
 #endif
 
+
 #include "js_native_api_types.h"
 
 // If you need __declspec(dllimport), either include <node_api.h> instead, or

The update script ends up adding an empty line: there is an empty line before the #ifdef and after the #endif, so once removing the #ifdef block, it comes as two lines

// ...
#endif
#endif

#if defined(NAPI_EXPERIMENTAL) &&                                              \
    !defined(NODE_API_EXPERIMENTAL_NO_WARNING) &&                              \
    !defined(NODE_WANT_INTERNALS)
#ifdef _MSC_VER
#pragma message("NAPI_EXPERIMENTAL is enabled. "                               \
                "Experimental features may be unstable.")
#else
#warning "NAPI_EXPERIMENTAL is enabled. " \
       "Experimental features may be unstable."
#endif
#endif

#include "js_native_api_types.h"
// ...

Fixes: #62

@legendecas legendecas merged commit 56a7404 into nodejs:main Oct 24, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from Need Triage to Done in Node-API Team Project Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Header Sync fails with new v25.0.0 header

3 participants