9 #if __cplusplus >= 201703L
&& !__has_include("v8-gn.h")
10 #error Missing v8-gn.h. The configuration for v8 is missing from the include path
11 . Add it with -I<path> to the command line
19 #if defined(__ANDROID__)
20 # include <sys/cdefs.h>
21 #elif defined(__APPLE__)
22 # include <TargetConditionals.h>
23 #elif defined(__linux__
)
24 # include <features.h>
35 #if defined(__GLIBC__
) && defined(__GLIBC_MINOR__
)
36 # define V8_GLIBC_PREREQ(major, minor)
37 ((__GLIBC__
* 100
+ __GLIBC_MINOR__
) >= ((major) * 100
+ (minor)))
39 # define V8_GLIBC_PREREQ(major, minor) 0
50 #if defined(__GNUC__
) && defined(__GNUC_MINOR__
) && defined(__GNUC_PATCHLEVEL__
)
51 # define V8_GNUC_PREREQ(major, minor, patchlevel)
52 ((__GNUC__
* 10000
+ __GNUC_MINOR__
* 100
+ __GNUC_PATCHLEVEL__
) >=
53 ((major) * 10000
+ (minor) * 100
+ (patchlevel)))
54 #elif defined(__GNUC__) && defined(__GNUC_MINOR__)
55 # define V8_GNUC_PREREQ(major, minor, patchlevel)
56 ((__GNUC__ * 10000
+ __GNUC_MINOR__ * 100
) >=
57 ((major) * 10000
+ (minor) * 100
+ (patchlevel)))
59 # define V8_GNUC_PREREQ(major, minor, patchlevel) 0
86 #if defined(__ANDROID__)
87 # define V8_OS_ANDROID 1
88 # define V8_OS_LINUX 1
89 # define V8_OS_POSIX 1
90 # define V8_OS_STRING "android"
92 #elif defined(__APPLE__)
93 # define V8_OS_POSIX 1
95 # define V8_OS_DARWIN 1
96 # if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
98 # define V8_OS_STRING "ios"
100 # define V8_OS_MACOS 1
101 # define V8_OS_STRING "macos"
104 #elif defined(__CYGWIN__)
105 # define V8_OS_CYGWIN 1
106 # define V8_OS_POSIX 1
107 # define V8_OS_STRING "cygwin"
109 #elif defined(__linux__
)
110 # define V8_OS_LINUX 1
111 # define V8_OS_POSIX 1
112 # define V8_OS_STRING "linux"
115 # define V8_OS_POSIX 1
116 # define V8_OS_SOLARIS 1
117 # define V8_OS_STRING "sun"
119 #elif defined(STARBOARD)
120 # define V8_OS_STARBOARD 1
121 # define V8_OS_STRING "starboard"
124 # define V8_OS_POSIX 1
126 # define V8_OS_STRING "aix"
128 #elif defined(__FreeBSD__)
130 # define V8_OS_FREEBSD 1
131 # define V8_OS_POSIX 1
132 # define V8_OS_STRING "freebsd"
134 #elif defined(__Fuchsia__)
135 # define V8_OS_FUCHSIA 1
136 # define V8_OS_POSIX 1
137 # define V8_OS_STRING "fuchsia"
139 #elif defined(__DragonFly__)
141 # define V8_OS_DRAGONFLYBSD 1
142 # define V8_OS_POSIX 1
143 # define V8_OS_STRING "dragonflybsd"
145 #elif defined(__NetBSD__)
147 # define V8_OS_NETBSD 1
148 # define V8_OS_POSIX 1
149 # define V8_OS_STRING "netbsd"
151 #elif defined(__OpenBSD__)
153 # define V8_OS_OPENBSD 1
154 # define V8_OS_POSIX 1
155 # define V8_OS_STRING "openbsd"
157 #elif defined(__QNXNTO__)
158 # define V8_OS_POSIX 1
160 # define V8_OS_STRING "qnx"
162 #elif defined(_WIN32)
164 # define V8_OS_STRING "windows"
179 #ifdef V8_HAVE_TARGET_OS
182 # if !defined(V8_TARGET_OS_ANDROID)
183 && !defined(V8_TARGET_OS_FUCHSIA)
184 && !defined(V8_TARGET_OS_IOS)
185 && !defined(V8_TARGET_OS_LINUX)
186 && !defined(V8_TARGET_OS_MACOS)
187 && !defined(V8_TARGET_OS_WIN)
188 # error No known target OS defined.
193 # if defined(V8_TARGET_OS_ANDROID)
194 || defined(V8_TARGET_OS_FUCHSIA)
195 || defined(V8_TARGET_OS_IOS)
196 || defined(V8_TARGET_OS_LINUX)
197 || defined(V8_TARGET_OS_MACOS)
198 || defined(V8_TARGET_OS_WIN)
199 # error A target OS is defined but V8_HAVE_TARGET_OS is unset.
204 # define V8_TARGET_OS_ANDROID
208 # define V8_TARGET_OS_FUCHSIA
212 # define V8_TARGET_OS_IOS
216 # define V8_TARGET_OS_LINUX
220 # define V8_TARGET_OS_MACOS
224 # define V8_TARGET_OS_WIN
229 #if defined(V8_TARGET_OS_ANDROID)
230 # define V8_TARGET_OS_STRING "android"
231 #elif defined(V8_TARGET_OS_FUCHSIA)
232 # define V8_TARGET_OS_STRING "fuchsia"
233 #elif defined(V8_TARGET_OS_IOS)
234 # define V8_TARGET_OS_STRING "ios"
235 #elif defined(V8_TARGET_OS_LINUX
)
236 # define V8_TARGET_OS_STRING "linux"
237 #elif defined(V8_TARGET_OS_MACOS)
238 # define V8_TARGET_OS_STRING "macos"
239 #elif defined(V8_TARGET_OS_WINDOWS)
240 # define V8_TARGET_OS_STRING "windows"
242 # define V8_TARGET_OS_STRING "unknown"
260 #if defined (_MSC_VER)
261 # define V8_LIBC_MSVCRT 1
262 #elif defined(__BIONIC__)
263 # define V8_LIBC_BIONIC 1
264 # define V8_LIBC_BSD 1
265 #elif defined(__UCLIBC__)
267 # define V8_LIBC_UCLIBC 1
268 #elif defined(__GLIBC__
) || defined(__GNU_LIBRARY__
)
269 # define V8_LIBC_GLIBC 1
271 # define V8_LIBC_BSD V8_OS_BSD
323 #if defined(__has_cpp_attribute
)
324 #define V8_HAS_CPP_ATTRIBUTE(FEATURE) __has_cpp_attribute(FEATURE)
326 #define V8_HAS_CPP_ATTRIBUTE(FEATURE) 0
329 #if defined(__clang__
)
331 #if defined(__GNUC__
)
335 # define V8_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline))
336 # define V8_HAS_ATTRIBUTE_NONNULL (__has_attribute(nonnull))
337 # define V8_HAS_ATTRIBUTE_NOINLINE (__has_attribute(noinline))
338 # define V8_HAS_ATTRIBUTE_UNUSED (__has_attribute(unused))
339 # define V8_HAS_ATTRIBUTE_VISIBILITY (__has_attribute(visibility))
340 # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT
341 (__has_attribute(warn_unused_result))
343 # define V8_HAS_CPP_ATTRIBUTE_NODISCARD (V8_HAS_CPP_ATTRIBUTE(nodiscard))
344 # define V8_HAS_CPP_ATTRIBUTE_NO_UNIQUE_ADDRESS
345 (V8_HAS_CPP_ATTRIBUTE(no_unique_address))
347 # define V8_HAS_BUILTIN_ASSUME_ALIGNED (__has_builtin(__builtin_assume_aligned))
348 # define V8_HAS_BUILTIN_BSWAP16 (__has_builtin(__builtin_bswap16))
349 # define V8_HAS_BUILTIN_BSWAP32 (__has_builtin(__builtin_bswap32))
350 # define V8_HAS_BUILTIN_BSWAP64 (__has_builtin(__builtin_bswap64))
351 # define V8_HAS_BUILTIN_CLZ (__has_builtin(__builtin_clz))
352 # define V8_HAS_BUILTIN_CTZ (__has_builtin(__builtin_ctz))
353 # define V8_HAS_BUILTIN_EXPECT (__has_builtin(__builtin_expect))
354 # define V8_HAS_BUILTIN_FRAME_ADDRESS (__has_builtin(__builtin_frame_address))
355 # define V8_HAS_BUILTIN_POPCOUNT (__has_builtin(__builtin_popcount))
356 # define V8_HAS_BUILTIN_SADD_OVERFLOW (__has_builtin(__builtin_sadd_overflow))
357 # define V8_HAS_BUILTIN_SSUB_OVERFLOW (__has_builtin(__builtin_ssub_overflow))
358 # define V8_HAS_BUILTIN_UADD_OVERFLOW (__has_builtin(__builtin_uadd_overflow))
362 # define V8_HAS_COMPUTED_GOTO 1
364 #elif defined(__GNUC__)
367 # if defined(__INTEL_COMPILER)
368 # define V8_CC_INTEL 1
370 # if defined(__MINGW32__)
371 # define V8_CC_MINGW32 1
373 # if defined(__MINGW64__)
374 # define V8_CC_MINGW64 1
376 # define V8_CC_MINGW (V8_CC_MINGW32 || V8_CC_MINGW64)
381 # define V8_HAS_ATTRIBUTE_ALWAYS_INLINE 1
382 # define V8_HAS_ATTRIBUTE_NOINLINE 1
383 # define V8_HAS_ATTRIBUTE_UNUSED 1
384 # define V8_HAS_ATTRIBUTE_VISIBILITY 1
385 # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT (!V8_CC_INTEL)
391 # define V8_HAS_BUILTIN_ASSUME_ALIGNED 1
392 # define V8_HAS_BUILTIN_CLZ 1
393 # define V8_HAS_BUILTIN_CTZ 1
394 # define V8_HAS_BUILTIN_EXPECT 1
395 # define V8_HAS_BUILTIN_FRAME_ADDRESS 1
396 # define V8_HAS_BUILTIN_POPCOUNT 1
399 #define V8_HAS_COMPUTED_GOTO 1
403 #if defined(_MSC_VER)
404 # define V8_CC_MSVC 1
406 # define V8_HAS_DECLSPEC_NOINLINE 1
407 # define V8_HAS_DECLSPEC_SELECTANY 1
409 # define V8_HAS___FORCEINLINE 1
420 #if !defined(DEBUG) && V8_HAS_ATTRIBUTE_ALWAYS_INLINE
421 # define V8_INLINE inline __attribute__((always_inline))
422 #elif !defined(DEBUG) && V8_HAS___FORCEINLINE
423 # define V8_INLINE __forceinline
425 # define V8_INLINE inline
428 #if V8_HAS_BUILTIN_ASSUME_ALIGNED
429 # define V8_ASSUME_ALIGNED(ptr, alignment)
430 __builtin_assume_aligned((ptr), (alignment))
432 # define V8_ASSUME_ALIGNED(ptr, alignment) (ptr)
439 #if V8_HAS_ATTRIBUTE_NONNULL
440 # define V8_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
442 # define V8_NONNULL(...)
449 #if V8_HAS_ATTRIBUTE_NOINLINE
450 # define V8_NOINLINE __attribute__((noinline))
451 #elif V8_HAS_DECLSPEC_NOINLINE
452 # define V8_NOINLINE __declspec(noinline)
459 #if defined(V8_DEPRECATION_WARNINGS)
460 # define V8_DEPRECATED(message) [[deprecated(message)]]
462 # define V8_DEPRECATED(message)
467 #if defined(V8_IMMINENT_DEPRECATION_WARNINGS)
468 # define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
470 # define V8_DEPRECATE_SOON(message)
474 #if defined(__GNUC__
) && !defined(__clang__
) && (__GNUC__
< 6
)
475 # define V8_ENUM_DEPRECATED(message)
476 # define V8_ENUM_DEPRECATE_SOON(message)
484 #if V8_HAS_BUILTIN_EXPECT
485 # define V8_UNLIKELY(condition) (__builtin_expect(!!(condition), 0
))
486 # define V8_LIKELY(condition) (__builtin_expect(!!(condition), 1
))
488 # define V8_UNLIKELY(condition) (condition)
489 # define V8_LIKELY(condition) (condition)
496 #if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT
497 #define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
499 #define V8_WARN_UNUSED_RESULT
510 #if V8_HAS_CPP_ATTRIBUTE_NODISCARD
511 #define V8_NODISCARD [[nodiscard]]
531 #if V8_HAS_CPP_ATTRIBUTE_NO_UNIQUE_ADDRESS
532 #define V8_NO_UNIQUE_ADDRESS [[no_unique_address]]
534 #define V8_NO_UNIQUE_ADDRESS
538 #if defined(__clang__
) && defined(__has_attribute
)
539 #if __has_attribute
(no_sanitize)
540 #define V8_CLANG_NO_SANITIZE(what) __attribute__((no_sanitize(what)))
544 #define V8_CLANG_NO_SANITIZE(what)
547 #if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED)
548 #error Inconsistent build configuration: To build the V8 shared library set
549 BUILDING_V8_SHARED, to include its headers for linking against the V8
550 shared library set USING_V8_SHARED.
560 #ifdef BUILDING_V8_SHARED
561 # define V8_EXPORT __declspec(dllexport)
562 #elif USING_V8_SHARED
563 # define V8_EXPORT __declspec(dllimport)
571 #if V8_HAS_ATTRIBUTE_VISIBILITY
572 # ifdef BUILDING_V8_SHARED
573 # define V8_EXPORT __attribute__ ((visibility("default")))
586 #if defined(V8_COMPRESS_POINTERS)
587 #define V8_SANDBOX_IS_AVAILABLE
590 #if defined(V8_SANDBOX) && !defined(V8_SANDBOX_IS_AVAILABLE)
591 #error Inconsistent configuration: sandbox is enabled but not available
597 #if __cplusplus
< 201703L
&& (!defined(_MSVC_LANG) || _MSVC_LANG < 201703L
)
598 #define V8_STATIC_CONSTEXPR_VARIABLES_NEED_DEFINITIONS
603 #undef V8_HAS_CPP_ATTRIBUTE