|
1 | 1 | #ifndef SRC_JS_NATIVE_API_TYPES_H_ |
2 | 2 | #define SRC_JS_NATIVE_API_TYPES_H_ |
3 | 3 | |
| 4 | +// Use INT_MAX, this should only be consumed by the pre-processor anyway. |
| 5 | +#define NAPI_VERSION_EXPERIMENTAL 2147483647 |
| 6 | +#ifndef NAPI_VERSION |
| 7 | +#ifdef NAPI_EXPERIMENTAL |
| 8 | +#define NAPI_VERSION NAPI_VERSION_EXPERIMENTAL |
| 9 | +#else |
| 10 | +// The baseline version for N-API. |
| 11 | +// The NAPI_VERSION controls which version will be used by default when |
| 12 | +// compilling a native addon. If the addon developer specifically wants to use |
| 13 | +// functions available in a new version of N-API that is not yet ported in all |
| 14 | +// LTS versions, they can set NAPI_VERSION knowing that they have specifically |
| 15 | +// depended on that version. |
| 16 | +#define NAPI_VERSION 8 |
| 17 | +#endif |
| 18 | +#endif |
| 19 | + |
| 20 | +#if defined(NAPI_EXPERIMENTAL) && \ |
| 21 | + !defined(NODE_API_EXPERIMENTAL_NO_WARNING) && \ |
| 22 | + !defined(NODE_WANT_INTERNALS) |
| 23 | +#ifdef _MSC_VER |
| 24 | +#pragma message("NAPI_EXPERIMENTAL is enabled. " \ |
| 25 | +"Experimental features may be unstable.") |
| 26 | +#else |
| 27 | +#warning "NAPI_EXPERIMENTAL is enabled. " \ |
| 28 | +"Experimental features may be unstable." |
| 29 | +#endif |
| 30 | +#endif |
| 31 | + |
4 | 32 | // This file needs to be compatible with C compilers. |
5 | 33 | // This is a public include file, and these includes have essentially |
6 | 34 | // became part of it's API. |
|