62#if !defined(DUK_CONFIG_H_INCLUDED)
63#define DUK_CONFIG_H_INCLUDED
79#if defined(__FreeBSD__) || defined(__FreeBSD)
84#if defined(DUK_F_FREEBSD) && defined(__ORBIS__)
89#if defined(__OpenBSD__) || defined(__OpenBSD)
94#if defined(__NetBSD__) || defined(__NetBSD)
99#if defined(DUK_F_FREEBSD) || defined(DUK_F_NETBSD) || defined(DUK_F_OPENBSD) || \
100 defined(__bsdi__) || defined(__DragonFly__)
114#if defined(__m68k__) || defined(M68000) || defined(__MC68K__)
121#if defined(AMIGA) || defined(__amigaos__)
126#if defined(__powerpc) || defined(__powerpc__) || defined(__PPC__)
128#if defined(__PPC64__) || defined(__LP64__) || defined(_LP64)
136#if defined(_DURANGO) || defined(_XBOX_ONE)
141#if defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64) || \
142 defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__)
144#if defined(_WIN64) || defined(WIN64)
152#if defined(__FLASHPLAYER__)
153#define DUK_F_FLASHPLAYER
162#if defined(_TINSPIRE)
163#define DUK_F_TINSPIRE
167#if defined(EMSCRIPTEN)
168#define DUK_F_EMSCRIPTEN
172#if defined(__BCC__) || defined(__BCC_VERSION__)
176#if defined(ANDROID) || defined(__ANDROID__)
181#if defined(__linux) || defined(__linux__) || defined(linux)
186#if defined(__sun) && defined(__SVR4)
188#if defined(__SUNPRO_C) && (__SUNPRO_C < 0x550)
189#define DUK_F_OLD_SOLARIS
194#include <sys/isa_defs.h>
208#define DUK_F_HPUX_ITANIUM
218#if defined(__CYGWIN__)
223#if defined(__unix) || defined(__unix__) || defined(unix) || \
224 defined(DUK_F_LINUX) || defined(DUK_F_BSD)
235#if defined(__amd64__) || defined(__amd64) || \
236 defined(__x86_64__) || defined(__x86_64) || \
237 defined(_M_X64) || defined(_M_AMD64)
238#if defined(__ILP32__) || defined(_ILP32)
243#elif defined(i386) || defined(__i386) || defined(__i386__) || \
244 defined(__i486__) || defined(__i586__) || defined(__i686__) || \
245 defined(__IA32__) || defined(_M_IX86) || defined(__X86__) || \
246 defined(_X86_) || defined(__THW_INTEL__) || defined(__I86__)
247#if defined(__LP64__) || defined(_LP64)
256#if defined(__arm__) || defined(__thumb__) || defined(_ARM) || defined(_M_ARM) || defined(_M_ARM64) || defined(__aarch64__)
258#if defined(__LP64__) || defined(_LP64) || defined(__arm64) || defined(__arm64__) || defined(_M_ARM64) || defined(__aarch64__)
266#if defined(__mips__) || defined(mips) || defined(_MIPS_ISA) || \
267 defined(_R3000) || defined(_R4000) || defined(_R5900) || \
268 defined(_MIPS_ISA_MIPS1) || defined(_MIPS_ISA_MIPS2) || \
269 defined(_MIPS_ISA_MIPS3) || defined(_MIPS_ISA_MIPS4) || \
270 defined(__mips) || defined(__MIPS__)
272#if defined(__LP64__) || defined(_LP64) || defined(__mips64) || \
273 defined(__mips64__) || defined(__mips_n64)
281#if defined(sparc) || defined(__sparc) || defined(__sparc__)
283#if defined(__LP64__) || defined(_LP64)
293#if defined(__riscv_xlen)
294#if (__riscv_xlen == 32)
296#elif (__riscv_xlen == 64)
299#error __riscv_xlen has unsupported value (not 32 or 64)
302#error __riscv defined without __riscv_xlen
307#if defined(__sh__) || \
308 defined(__sh1__) || defined(__SH1__) || \
309 defined(__sh2__) || defined(__SH2__) || \
310 defined(__sh3__) || defined(__SH3__) || \
311 defined(__sh4__) || defined(__SH4__) || \
312 defined(__sh5__) || defined(__SH5__)
317#if defined(__clang__)
323#if defined(__cplusplus)
329#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
335#if defined(__cplusplus) && (__cplusplus >= 201103L)
340#if defined(__GNUC__) && !defined(__clang__) && !defined(DUK_F_CLANG)
342#if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
344#define DUK_F_GCC_VERSION (__GNUC__ * 10000L + __GNUC_MINOR__ * 100L + __GNUC_PATCHLEVEL__)
346#error cannot figure out gcc version
351#if defined(__MINGW32__) || defined(__MINGW64__)
362#if defined(_MSC_FULL_VER)
363#if (_MSC_FULL_VER > 100000000)
364#define DUK_F_MSVC_FULL_VER _MSC_FULL_VER
366#define DUK_F_MSCV_FULL_VER (_MSC_FULL_VER * 10)
372#if defined(__TINYC__)
394#if defined(__cplusplus) && !defined(__STDC_LIMIT_MACROS)
395#define __STDC_LIMIT_MACROS
397#if defined(__cplusplus) && !defined(__STDC_CONSTANT_MACROS)
398#define __STDC_CONSTANT_MACROS
401#if defined(DUK_F_APPLE)
403#define DUK_USE_DATE_NOW_GETTIMEOFDAY
404#define DUK_USE_DATE_TZO_GMTIME_R
405#define DUK_USE_DATE_PRS_STRPTIME
406#define DUK_USE_DATE_FMT_STRFTIME
407#include <TargetConditionals.h>
408#include <architecture/byte_order.h>
409#include <sys/param.h>
414#if TARGET_IPHONE_SIMULATOR
415#define DUK_USE_OS_STRING "iphone-sim"
416#elif TARGET_OS_IPHONE
417#define DUK_USE_OS_STRING "iphone"
419#define DUK_USE_OS_STRING "osx"
421#define DUK_USE_OS_STRING "osx-unknown"
425#define DUK_JMPBUF_TYPE jmp_buf
426#define DUK_SETJMP(jb) _setjmp((jb))
427#define DUK_LONGJMP(jb) _longjmp((jb), 1)
428#elif defined(DUK_F_ORBIS)
431#define DUK_USE_DATE_NOW_GETTIMEOFDAY
432#define DUK_USE_DATE_TZO_GMTIME_S
434#define DUK_USE_DATE_FMT_STRFTIME
435#include <sys/types.h>
436#include <machine/endian.h>
437#include <sys/param.h>
441#define DUK_USE_OS_STRING "orbis"
442#elif defined(DUK_F_OPENBSD)
445#define DUK_USE_DATE_NOW_GETTIMEOFDAY
446#define DUK_USE_DATE_TZO_GMTIME_R
447#define DUK_USE_DATE_PRS_STRPTIME
448#define DUK_USE_DATE_FMT_STRFTIME
449#include <sys/types.h>
450#include <sys/endian.h>
451#include <sys/param.h>
455#define DUK_USE_OS_STRING "openbsd"
456#elif defined(DUK_F_BSD)
458#define DUK_USE_DATE_NOW_GETTIMEOFDAY
459#define DUK_USE_DATE_TZO_GMTIME_R
460#define DUK_USE_DATE_PRS_STRPTIME
461#define DUK_USE_DATE_FMT_STRFTIME
462#include <sys/types.h>
463#include <sys/endian.h>
464#include <sys/param.h>
468#define DUK_USE_OS_STRING "bsd"
469#elif defined(DUK_F_TOS)
471#define DUK_USE_DATE_NOW_TIME
472#define DUK_USE_DATE_TZO_GMTIME
474#define DUK_USE_DATE_FMT_STRFTIME
477#define DUK_USE_OS_STRING "tos"
480#if !defined(DUK_USE_BYTEORDER) && defined(DUK_F_M68K)
481#define DUK_USE_BYTEORDER 3
483#elif defined(DUK_F_AMIGAOS)
485#if defined(DUK_F_M68K)
487#define DUK_USE_DATE_NOW_TIME
488#define DUK_USE_DATE_TZO_GMTIME
490#define DUK_USE_DATE_FMT_STRFTIME
492#elif defined(DUK_F_PPC)
493#define DUK_USE_DATE_NOW_GETTIMEOFDAY
494#define DUK_USE_DATE_TZO_GMTIME_R
495#define DUK_USE_DATE_PRS_STRPTIME
496#define DUK_USE_DATE_FMT_STRFTIME
498#if !defined(UINTPTR_MAX)
499#define UINTPTR_MAX UINT_MAX
502#error AmigaOS but not M68K/PPC, not supported now
505#define DUK_USE_OS_STRING "amigaos"
508#if !defined(DUK_USE_BYTEORDER) && (defined(DUK_F_M68K) || defined(DUK_F_PPC))
509#define DUK_USE_BYTEORDER 3
511#elif defined(DUK_F_DURANGO)
522#if defined(DUK_COMPILING_DUKTAPE) && !defined(_CRT_SECURE_NO_WARNINGS)
523#define _CRT_SECURE_NO_WARNINGS
527#define DUK_USE_DATE_NOW_WINDOWS
528#define DUK_USE_DATE_TZO_WINDOWS_NO_DST
533#if defined(DUK_COMPILING_DUKTAPE)
540#define DUK_USE_OS_STRING "durango"
542#if !defined(DUK_USE_BYTEORDER)
543#define DUK_USE_BYTEORDER 1
545#elif defined(DUK_F_WINDOWS)
556#if defined(DUK_COMPILING_DUKTAPE) && !defined(_CRT_SECURE_NO_WARNINGS)
557#define _CRT_SECURE_NO_WARNINGS
563#if defined(DUK_COMPILING_DUKTAPE)
573#if defined(DUK_USE_DATE_NOW_WINDOWS_SUBMS) || defined(DUK_USE_DATE_NOW_WINDOWS)
576#if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0602)
577#define DUK_USE_DATE_NOW_WINDOWS_SUBMS
579#define DUK_USE_DATE_NOW_WINDOWS
583#define DUK_USE_DATE_TZO_WINDOWS
593#if !defined(DUK_USE_GET_MONOTONIC_TIME_WINDOWS_QPC) && \
594 defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600)
595#define DUK_USE_GET_MONOTONIC_TIME_WINDOWS_QPC
598#define DUK_USE_OS_STRING "windows"
603#if !defined(DUK_USE_BYTEORDER)
604#define DUK_USE_BYTEORDER 1
606#elif defined(DUK_F_FLASHPLAYER)
608#define DUK_USE_DATE_NOW_GETTIMEOFDAY
609#define DUK_USE_DATE_TZO_GMTIME_R
610#define DUK_USE_DATE_PRS_STRPTIME
611#define DUK_USE_DATE_FMT_STRFTIME
613#include <sys/param.h>
617#define DUK_USE_OS_STRING "flashplayer"
619#if !defined(DUK_USE_BYTEORDER) && defined(DUK_F_FLASHPLAYER)
620#define DUK_USE_BYTEORDER 1
622#elif defined(DUK_F_QNX)
624#if defined(DUK_F_QNX) && defined(DUK_COMPILING_DUKTAPE)
626#define _XOPEN_SOURCE 600
627#define _POSIX_C_SOURCE 200112L
630#define DUK_USE_DATE_NOW_GETTIMEOFDAY
631#define DUK_USE_DATE_TZO_GMTIME_R
632#define DUK_USE_DATE_PRS_STRPTIME
633#define DUK_USE_DATE_FMT_STRFTIME
634#include <sys/types.h>
635#include <sys/param.h>
639#define DUK_USE_OS_STRING "qnx"
640#elif defined(DUK_F_TINSPIRE)
642#if defined(DUK_COMPILING_DUKTAPE) && !defined(_XOPEN_SOURCE)
646#define DUK_USE_DATE_NOW_GETTIMEOFDAY
647#define DUK_USE_DATE_TZO_GMTIME_R
648#define DUK_USE_DATE_PRS_STRPTIME
649#define DUK_USE_DATE_FMT_STRFTIME
650#include <sys/types.h>
651#include <sys/param.h>
655#define DUK_USE_OS_STRING "tinspire"
656#elif defined(DUK_F_EMSCRIPTEN)
658#if defined(DUK_COMPILING_DUKTAPE)
659#if !defined(_POSIX_C_SOURCE)
660#define _POSIX_C_SOURCE 200809L
662#if !defined(_GNU_SOURCE)
665#if !defined(_XOPEN_SOURCE)
670#include <sys/types.h>
671#if defined(DUK_F_BCC)
676#include <sys/param.h>
681#define DUK_USE_DATE_NOW_GETTIMEOFDAY
682#define DUK_USE_DATE_TZO_GMTIME_R
683#define DUK_USE_DATE_PRS_STRPTIME
684#define DUK_USE_DATE_FMT_STRFTIME
686#define DUK_USE_OS_STRING "emscripten"
687#elif defined(DUK_F_ANDROID)
689#if defined(DUK_COMPILING_DUKTAPE)
690#if !defined(_POSIX_C_SOURCE)
691#define _POSIX_C_SOURCE 200809L
693#if !defined(_GNU_SOURCE)
696#if !defined(_XOPEN_SOURCE)
701#include <sys/types.h>
702#if defined(DUK_F_BCC)
708#include <sys/param.h>
712#define DUK_USE_DATE_NOW_GETTIMEOFDAY
713#define DUK_USE_DATE_TZO_GMTIME_R
714#define DUK_USE_DATE_PRS_STRPTIME
715#define DUK_USE_DATE_FMT_STRFTIME
718#define DUK_USE_GET_MONOTONIC_TIME_CLOCK_GETTIME
721#define DUK_USE_OS_STRING "android"
722#elif defined(DUK_F_LINUX)
724#if defined(DUK_COMPILING_DUKTAPE)
725#if !defined(_POSIX_C_SOURCE)
726#define _POSIX_C_SOURCE 200809L
728#if !defined(_GNU_SOURCE)
731#if !defined(_XOPEN_SOURCE)
736#include <sys/types.h>
737#if defined(DUK_F_BCC)
743#include <sys/param.h>
747#define DUK_USE_DATE_NOW_GETTIMEOFDAY
748#define DUK_USE_DATE_TZO_GMTIME_R
749#define DUK_USE_DATE_PRS_STRPTIME
750#define DUK_USE_DATE_FMT_STRFTIME
753#define DUK_USE_GET_MONOTONIC_TIME_CLOCK_GETTIME
756#define DUK_USE_OS_STRING "linux"
757#elif defined(DUK_F_SUN)
759#define DUK_USE_DATE_NOW_GETTIMEOFDAY
760#define DUK_USE_DATE_TZO_GMTIME_R
761#define DUK_USE_DATE_PRS_STRPTIME
762#define DUK_USE_DATE_FMT_STRFTIME
764#include <sys/types.h>
765#if defined(DUK_F_OLD_SOLARIS)
767#define DUK_F_NO_STDINT_H
768#if !defined(DUK_USE_BYTEORDER)
769#define DUK_USE_BYTEORDER 3
772#include <sys/param.h>
775#include <sys/param.h>
779#define DUK_USE_OS_STRING "solaris"
780#elif defined(DUK_F_AIX)
782#if !defined(DUK_USE_BYTEORDER)
783#define DUK_USE_BYTEORDER 3
785#define DUK_USE_DATE_NOW_GETTIMEOFDAY
786#define DUK_USE_DATE_TZO_GMTIME_R
787#define DUK_USE_DATE_PRS_STRPTIME
788#define DUK_USE_DATE_FMT_STRFTIME
789#include <sys/param.h>
793#define DUK_USE_OS_STRING "aix"
794#elif defined(DUK_F_HPUX)
796#define DUK_F_NO_STDINT_H
797#if !defined(DUK_USE_BYTEORDER)
798#define DUK_USE_BYTEORDER 3
800#define DUK_USE_DATE_NOW_GETTIMEOFDAY
801#define DUK_USE_DATE_TZO_GMTIME_R
802#define DUK_USE_DATE_PRS_STRPTIME
803#define DUK_USE_DATE_FMT_STRFTIME
804#include <sys/param.h>
808#define DUK_USE_OS_STRING "hpux"
809#elif defined(DUK_F_POSIX)
811#define DUK_USE_DATE_NOW_GETTIMEOFDAY
812#define DUK_USE_DATE_TZO_GMTIME_R
813#define DUK_USE_DATE_PRS_STRPTIME
814#define DUK_USE_DATE_FMT_STRFTIME
815#include <sys/types.h>
817#include <sys/param.h>
821#define DUK_USE_OS_STRING "posix"
822#elif defined(DUK_F_CYGWIN)
825#define DUK_USE_DATE_NOW_GETTIMEOFDAY
826#define DUK_USE_DATE_TZO_GMTIME_R
827#define DUK_USE_DATE_FMT_STRFTIME
828#include <sys/types.h>
830#include <sys/param.h>
834#define DUK_JMPBUF_TYPE jmp_buf
835#define DUK_SETJMP(jb) _setjmp((jb))
836#define DUK_LONGJMP(jb) _longjmp((jb), 1)
838#define DUK_USE_OS_STRING "windows"
839#elif defined(DUK_F_UNIX)
841#define DUK_USE_DATE_NOW_GETTIMEOFDAY
842#define DUK_USE_DATE_TZO_GMTIME_R
843#define DUK_USE_DATE_PRS_STRPTIME
844#define DUK_USE_DATE_FMT_STRFTIME
847#define DUK_USE_OS_STRING "unknown"
853#define DUK_USE_DATE_NOW_TIME
858#define DUK_USE_DATE_TZO_GMTIME
861#undef DUK_USE_DATE_PRS_STRPTIME
862#undef DUK_USE_DATE_FMT_STRFTIME
867#define DUK_USE_OS_STRING "unknown"
883#if defined(DUK_F_NO_STDINT_H)
899#if defined(DUK_F_X86)
901#define DUK_USE_ARCH_STRING "x86"
902#if !defined(DUK_USE_BYTEORDER)
903#define DUK_USE_BYTEORDER 1
906#define DUK_USE_PACKED_TVAL
911#if defined(DUK_F_FREEBSD) && defined(DUK_F_X86) && \
912 defined(__clang__) && defined(__clang_major__) && (__clang_major__ < 5)
913#undef DUK_USE_PACKED_TVAL
915#define DUK_F_PACKED_TVAL_PROVIDED
916#elif defined(DUK_F_X64)
918#define DUK_USE_ARCH_STRING "x64"
919#if !defined(DUK_USE_BYTEORDER)
920#define DUK_USE_BYTEORDER 1
922#undef DUK_USE_PACKED_TVAL
923#define DUK_F_PACKED_TVAL_PROVIDED
924#elif defined(DUK_F_X32)
926#define DUK_USE_ARCH_STRING "x32"
927#if !defined(DUK_USE_BYTEORDER)
928#define DUK_USE_BYTEORDER 1
930#define DUK_USE_PACKED_TVAL
931#define DUK_F_PACKED_TVAL_PROVIDED
932#elif defined(DUK_F_ARM32)
934#define DUK_USE_ARCH_STRING "arm32"
936#define DUK_USE_PACKED_TVAL
937#define DUK_F_PACKED_TVAL_PROVIDED
938#elif defined(DUK_F_ARM64)
940#define DUK_USE_ARCH_STRING "arm64"
942#undef DUK_USE_PACKED_TVAL
943#define DUK_F_PACKED_TVAL_PROVIDED
944#elif defined(DUK_F_MIPS32)
946#define DUK_USE_ARCH_STRING "mips32"
948#define DUK_USE_PACKED_TVAL
949#define DUK_F_PACKED_TVAL_PROVIDED
950#elif defined(DUK_F_MIPS64)
952#define DUK_USE_ARCH_STRING "mips64"
954#undef DUK_USE_PACKED_TVAL
955#define DUK_F_PACKED_TVAL_PROVIDED
956#elif defined(DUK_F_PPC32)
958#define DUK_USE_ARCH_STRING "ppc32"
959#if !defined(DUK_USE_BYTEORDER)
960#define DUK_USE_BYTEORDER 3
962#define DUK_USE_PACKED_TVAL
963#define DUK_F_PACKED_TVAL_PROVIDED
964#elif defined(DUK_F_PPC64)
966#define DUK_USE_ARCH_STRING "ppc64"
968#undef DUK_USE_PACKED_TVAL
969#define DUK_F_PACKED_TVAL_PROVIDED
970#elif defined(DUK_F_SPARC32)
972#define DUK_USE_ARCH_STRING "sparc32"
974#define DUK_USE_PACKED_TVAL
975#define DUK_F_PACKED_TVAL_PROVIDED
976#elif defined(DUK_F_SPARC64)
978#define DUK_USE_ARCH_STRING "sparc64"
980#undef DUK_USE_PACKED_TVAL
981#define DUK_F_PACKED_TVAL_PROVIDED
982#elif defined(DUK_F_RISCV32)
984#define DUK_USE_ARCH_STRING "riscv32"
985#define DUK_USE_BYTEORDER 1
986#define DUK_USE_PACKED_TVAL
987#define DUK_F_PACKED_TVAL_PROVIDED
988#elif defined(DUK_F_RISCV64)
990#define DUK_USE_ARCH_STRING "riscv64"
991#define DUK_USE_BYTEORDER 1
992#undef DUK_USE_PACKED_TVAL
993#define DUK_F_PACKED_TVAL_PROVIDED
994#elif defined(DUK_F_SUPERH)
996#define DUK_USE_ARCH_STRING "sh"
998#define DUK_USE_PACKED_TVAL
999#define DUK_F_PACKED_TVAL_PROVIDED
1000#elif defined(DUK_F_M68K)
1002#define DUK_USE_ARCH_STRING "m68k"
1003#if !defined(DUK_USE_BYTEORDER)
1004#define DUK_USE_BYTEORDER 3
1006#define DUK_USE_PACKED_TVAL
1007#define DUK_F_PACKED_TVAL_PROVIDED
1008#elif defined(DUK_F_EMSCRIPTEN)
1010#define DUK_USE_ARCH_STRING "emscripten"
1011#if !defined(DUK_USE_BYTEORDER)
1012#define DUK_USE_BYTEORDER 1
1014#undef DUK_USE_PACKED_TVAL
1015#define DUK_F_PACKED_TVAL_PROVIDED
1019#define DUK_USE_ARCH_STRING "generic"
1027#if defined(DUK_F_CLANG)
1029#if defined(DUK_F_C99) || defined(DUK_F_CPP11)
1031#define DUK_VA_COPY(dest,src) va_copy(dest,src)
1034#define DUK_VA_COPY(dest,src) __va_copy(dest,src)
1037#define DUK_NORETURN(decl) decl __attribute__((noreturn))
1039#if defined(__clang__) && defined(__has_builtin)
1040#if __has_builtin(__builtin_unreachable)
1041#define DUK_UNREACHABLE() do { __builtin_unreachable(); } while (0)
1045#define DUK_USE_BRANCH_HINTS
1046#define DUK_LIKELY(x) __builtin_expect((x), 1)
1047#define DUK_UNLIKELY(x) __builtin_expect((x), 0)
1048#if defined(__clang__) && defined(__has_builtin)
1049#if __has_builtin(__builtin_unpredictable)
1050#define DUK_UNPREDICTABLE(x) __builtin_unpredictable((x))
1054#if defined(DUK_F_C99) || defined(DUK_F_CPP11)
1055#define DUK_NOINLINE __attribute__((noinline))
1056#define DUK_INLINE inline
1057#define DUK_ALWAYS_INLINE inline __attribute__((always_inline))
1063#if defined(DUK_F_DLL_BUILD) && defined(DUK_F_WINDOWS)
1067#if defined(DUK_COMPILING_DUKTAPE)
1068#define DUK_EXTERNAL_DECL extern __declspec(dllexport)
1069#define DUK_EXTERNAL __declspec(dllexport)
1071#define DUK_EXTERNAL_DECL extern __declspec(dllimport)
1072#define DUK_EXTERNAL should_not_happen
1074#if defined(DUK_SINGLE_FILE)
1075#define DUK_INTERNAL_DECL static
1076#define DUK_INTERNAL static
1078#define DUK_INTERNAL_DECL extern
1081#define DUK_LOCAL_DECL static
1082#define DUK_LOCAL static
1084#define DUK_EXTERNAL_DECL __attribute__ ((visibility("default"))) extern
1085#define DUK_EXTERNAL __attribute__ ((visibility("default")))
1086#if defined(DUK_SINGLE_FILE)
1087#if (defined(DUK_F_GCC_VERSION) && DUK_F_GCC_VERSION >= 30101) || defined(DUK_F_CLANG)
1093#define DUK_INTERNAL_DECL static __attribute__ ((unused))
1094#define DUK_INTERNAL static __attribute__ ((unused))
1096#define DUK_INTERNAL_DECL static
1097#define DUK_INTERNAL static
1100#if (defined(DUK_F_GCC_VERSION) && DUK_F_GCC_VERSION >= 30101) || defined(DUK_F_CLANG)
1101#define DUK_INTERNAL_DECL __attribute__ ((visibility("hidden"))) __attribute__ ((unused)) extern
1102#define DUK_INTERNAL __attribute__ ((visibility("hidden"))) __attribute__ ((unused))
1104#define DUK_INTERNAL_DECL __attribute__ ((visibility("hidden"))) extern
1105#define DUK_INTERNAL __attribute__ ((visibility("hidden")))
1108#define DUK_LOCAL_DECL static
1109#define DUK_LOCAL static
1112#if defined(DUK_F_CPP)
1113#define DUK_USE_COMPILER_STRING "clang"
1115#define DUK_USE_COMPILER_STRING "clang"
1118#undef DUK_USE_VARIADIC_MACROS
1119#if defined(DUK_F_C99) || defined(DUK_F_CPP11)
1120#define DUK_USE_VARIADIC_MACROS
1123#define DUK_USE_UNION_INITIALIZERS
1125#undef DUK_USE_FLEX_C99
1126#undef DUK_USE_FLEX_ZEROSIZE
1127#undef DUK_USE_FLEX_ONESIZE
1128#if defined(DUK_F_C99)
1129#define DUK_USE_FLEX_C99
1131#define DUK_USE_FLEX_ZEROSIZE
1134#define DUK_USE_CLANG_PRAGMAS
1135#define DUK_USE_PACK_CLANG_ATTR
1137#if defined(__clang__) && defined(__has_builtin)
1138#if __has_builtin(__builtin_bswap64)
1139#define DUK_BSWAP64(x) ((duk_uint64_t) __builtin_bswap64((duk_uint64_t) (x)))
1141#if __has_builtin(__builtin_bswap32)
1142#define DUK_BSWAP32(x) ((duk_uint32_t) __builtin_bswap32((duk_uint32_t) (x)))
1144#if __has_builtin(__builtin_bswap16)
1145#define DUK_BSWAP16(x) ((duk_uint16_t) __builtin_bswap16((duk_uint16_t) (x)))
1148#elif defined(DUK_F_GCC)
1150#if defined(DUK_F_C99) || defined(DUK_F_CPP11)
1152#define DUK_VA_COPY(dest,src) va_copy(dest,src)
1155#define DUK_VA_COPY(dest,src) __va_copy(dest,src)
1158#if defined(DUK_F_GCC_VERSION) && (DUK_F_GCC_VERSION >= 20500L) && (DUK_F_GCC_VERSION < 50000L)
1164#define DUK_NORETURN(decl) decl __attribute__((noreturn))
1167#if defined(DUK_F_GCC_VERSION) && (DUK_F_GCC_VERSION >= 40500L)
1169#define DUK_UNREACHABLE() do { __builtin_unreachable(); } while (0)
1172#define DUK_USE_BRANCH_HINTS
1173#if defined(DUK_F_GCC_VERSION) && (DUK_F_GCC_VERSION >= 40500L)
1177#define DUK_LIKELY(x) __builtin_expect((x), 1)
1178#define DUK_UNLIKELY(x) __builtin_expect((x), 0)
1182#if (defined(DUK_F_C99) || defined(DUK_F_CPP11)) && \
1183 defined(DUK_F_GCC_VERSION) && (DUK_F_GCC_VERSION >= 30101)
1184#define DUK_NOINLINE __attribute__((noinline))
1185#define DUK_INLINE inline
1186#define DUK_ALWAYS_INLINE inline __attribute__((always_inline))
1189#if (defined(DUK_F_C99) || defined(DUK_F_CPP11)) && \
1190 defined(DUK_F_GCC_VERSION) && (DUK_F_GCC_VERSION >= 40300)
1191#define DUK_HOT __attribute__((hot))
1192#define DUK_COLD __attribute__((cold))
1195#if defined(DUK_F_DLL_BUILD) && defined(DUK_F_WINDOWS)
1199#if defined(DUK_COMPILING_DUKTAPE)
1200#define DUK_EXTERNAL_DECL extern __declspec(dllexport)
1201#define DUK_EXTERNAL __declspec(dllexport)
1203#define DUK_EXTERNAL_DECL extern __declspec(dllimport)
1204#define DUK_EXTERNAL should_not_happen
1206#if defined(DUK_SINGLE_FILE)
1207#define DUK_INTERNAL_DECL static
1208#define DUK_INTERNAL static
1210#define DUK_INTERNAL_DECL extern
1213#define DUK_LOCAL_DECL static
1214#define DUK_LOCAL static
1215#elif defined(DUK_F_GCC_VERSION) && (DUK_F_GCC_VERSION >= 40000)
1216#define DUK_EXTERNAL_DECL __attribute__ ((visibility("default"))) extern
1217#define DUK_EXTERNAL __attribute__ ((visibility("default")))
1218#if defined(DUK_SINGLE_FILE)
1219#if (defined(DUK_F_GCC_VERSION) && DUK_F_GCC_VERSION >= 30101) || defined(DUK_F_CLANG)
1225#define DUK_INTERNAL_DECL static __attribute__ ((unused))
1226#define DUK_INTERNAL static __attribute__ ((unused))
1228#define DUK_INTERNAL_DECL static
1229#define DUK_INTERNAL static
1232#if (defined(DUK_F_GCC_VERSION) && DUK_F_GCC_VERSION >= 30101) || defined(DUK_F_CLANG)
1233#define DUK_INTERNAL_DECL __attribute__ ((visibility("hidden"))) __attribute__ ((unused)) extern
1234#define DUK_INTERNAL __attribute__ ((visibility("hidden"))) __attribute__ ((unused))
1236#define DUK_INTERNAL_DECL __attribute__ ((visibility("hidden"))) extern
1237#define DUK_INTERNAL __attribute__ ((visibility("hidden")))
1240#define DUK_LOCAL_DECL static
1241#define DUK_LOCAL static
1244#if defined(DUK_F_MINGW)
1245#if defined(DUK_F_CPP)
1246#define DUK_USE_COMPILER_STRING "mingw++"
1248#define DUK_USE_COMPILER_STRING "mingw"
1251#if defined(DUK_F_CPP)
1252#define DUK_USE_COMPILER_STRING "g++"
1254#define DUK_USE_COMPILER_STRING "gcc"
1258#undef DUK_USE_VARIADIC_MACROS
1259#if defined(DUK_F_C99) || (defined(DUK_F_CPP11) && defined(__GNUC__))
1260#define DUK_USE_VARIADIC_MACROS
1263#define DUK_USE_UNION_INITIALIZERS
1265#undef DUK_USE_FLEX_C99
1266#undef DUK_USE_FLEX_ZEROSIZE
1267#undef DUK_USE_FLEX_ONESIZE
1268#if defined(DUK_F_C99)
1269#define DUK_USE_FLEX_C99
1271#define DUK_USE_FLEX_ZEROSIZE
1275#if defined(DUK_F_GCC_VERSION) && (DUK_F_GCC_VERSION >= 40600)
1276#define DUK_USE_GCC_PRAGMAS
1278#undef DUK_USE_GCC_PRAGMAS
1281#define DUK_USE_PACK_GCC_ATTR
1287#if defined(DUK_F_GCC_VERSION) && (DUK_F_GCC_VERSION >= 50000L)
1288#define DUK_BSWAP64(x) ((duk_uint64_t) __builtin_bswap64((duk_uint64_t) (x)))
1289#define DUK_BSWAP32(x) ((duk_uint32_t) __builtin_bswap32((duk_uint32_t) (x)))
1290#define DUK_BSWAP16(x) ((duk_uint16_t) __builtin_bswap16((duk_uint16_t) (x)))
1292#elif defined(DUK_F_MSVC)
1295#define DUK_NORETURN(decl) __declspec(noreturn) decl
1299#undef DUK_USE_BRANCH_HINTS
1304#if defined(DUK_F_DLL_BUILD) && defined(DUK_F_WINDOWS)
1308#if defined(DUK_COMPILING_DUKTAPE)
1309#define DUK_EXTERNAL_DECL extern __declspec(dllexport)
1310#define DUK_EXTERNAL __declspec(dllexport)
1312#define DUK_EXTERNAL_DECL extern __declspec(dllimport)
1313#define DUK_EXTERNAL should_not_happen
1315#if defined(DUK_SINGLE_FILE)
1316#define DUK_INTERNAL_DECL static
1317#define DUK_INTERNAL static
1319#define DUK_INTERNAL_DECL extern
1322#define DUK_LOCAL_DECL static
1323#define DUK_LOCAL static
1326#if defined(DUK_F_CPP)
1327#define DUK_USE_COMPILER_STRING "msvc++"
1329#define DUK_USE_COMPILER_STRING "msvc"
1332#undef DUK_USE_VARIADIC_MACROS
1333#if defined(DUK_F_C99)
1334#define DUK_USE_VARIADIC_MACROS
1335#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
1337#define DUK_USE_VARIADIC_MACROS
1340#undef DUK_USE_UNION_INITIALIZERS
1341#if defined(_MSC_VER) && (_MSC_VER >= 1800)
1348#define DUK_USE_UNION_INITIALIZERS
1351#undef DUK_USE_FLEX_C99
1352#undef DUK_USE_FLEX_ZEROSIZE
1353#undef DUK_USE_FLEX_ONESIZE
1354#if defined(DUK_F_C99)
1355#define DUK_USE_FLEX_C99
1357#define DUK_USE_FLEX_ZEROSIZE
1360#undef DUK_USE_GCC_PRAGMAS
1362#define DUK_USE_PACK_MSVC_PRAGMA
1367#if defined(_MSC_VER) && (_MSC_VER >= 1500)
1368#define DUK_NOINLINE __declspec(noinline)
1369#define DUK_INLINE __inline
1370#define DUK_ALWAYS_INLINE __forceinline
1373#if defined(_MSC_VER) && (_MSC_VER >= 1900)
1374#define DUK_SNPRINTF snprintf
1375#define DUK_VSNPRINTF vsnprintf
1381#define DUK_SNPRINTF _snprintf
1382#define DUK_VSNPRINTF _vsnprintf
1386#if defined(_MSC_VER) && (_MSC_VER < 1500)
1387#pragma warning(disable: 4100 4101 4550 4551)
1390#define DUK_UNREF(x) do { __pragma(warning(suppress:4100 4101 4550 4551)) (x); } while (0)
1394#define DUK_U64_CONSTANT(x) x##ui64
1395#define DUK_I64_CONSTANT(x) x##i64
1396#elif defined(DUK_F_EMSCRIPTEN)
1398#define DUK_NORETURN(decl) decl __attribute__((noreturn))
1400#if defined(__clang__) && defined(__has_builtin)
1401#if __has_builtin(__builtin_unreachable)
1402#define DUK_UNREACHABLE() do { __builtin_unreachable(); } while (0)
1406#define DUK_USE_BRANCH_HINTS
1407#define DUK_LIKELY(x) __builtin_expect((x), 1)
1408#define DUK_UNLIKELY(x) __builtin_expect((x), 0)
1409#if defined(__clang__) && defined(__has_builtin)
1410#if __has_builtin(__builtin_unpredictable)
1411#define DUK_UNPREDICTABLE(x) __builtin_unpredictable((x))
1415#if defined(DUK_F_C99) || defined(DUK_F_CPP11)
1416#define DUK_NOINLINE __attribute__((noinline))
1417#define DUK_INLINE inline
1418#define DUK_ALWAYS_INLINE inline __attribute__((always_inline))
1421#define DUK_EXTERNAL_DECL __attribute__ ((visibility("default"))) extern
1422#define DUK_EXTERNAL __attribute__ ((visibility("default")))
1423#if defined(DUK_SINGLE_FILE)
1424#if (defined(DUK_F_GCC_VERSION) && DUK_F_GCC_VERSION >= 30101) || defined(DUK_F_CLANG)
1430#define DUK_INTERNAL_DECL static __attribute__ ((unused))
1431#define DUK_INTERNAL static __attribute__ ((unused))
1433#define DUK_INTERNAL_DECL static
1434#define DUK_INTERNAL static
1437#if (defined(DUK_F_GCC_VERSION) && DUK_F_GCC_VERSION >= 30101) || defined(DUK_F_CLANG)
1438#define DUK_INTERNAL_DECL __attribute__ ((visibility("hidden"))) __attribute__ ((unused)) extern
1439#define DUK_INTERNAL __attribute__ ((visibility("hidden"))) __attribute__ ((unused))
1441#define DUK_INTERNAL_DECL __attribute__ ((visibility("hidden"))) extern
1442#define DUK_INTERNAL __attribute__ ((visibility("hidden")))
1445#define DUK_LOCAL_DECL static
1446#define DUK_LOCAL static
1448#define DUK_USE_COMPILER_STRING "emscripten"
1450#undef DUK_USE_VARIADIC_MACROS
1451#if defined(DUK_F_C99) || defined(DUK_F_CPP11)
1452#define DUK_USE_VARIADIC_MACROS
1455#define DUK_USE_UNION_INITIALIZERS
1457#undef DUK_USE_FLEX_C99
1458#undef DUK_USE_FLEX_ZEROSIZE
1459#undef DUK_USE_FLEX_ONESIZE
1460#if defined(DUK_F_C99)
1461#define DUK_USE_FLEX_C99
1463#define DUK_USE_FLEX_ZEROSIZE
1466#undef DUK_USE_GCC_PRAGMAS
1467#define DUK_USE_PACK_CLANG_ATTR
1468#elif defined(DUK_F_TINYC)
1470#undef DUK_USE_BRANCH_HINTS
1472#if defined(DUK_F_CPP)
1473#define DUK_USE_COMPILER_STRING "tinyc++"
1475#define DUK_USE_COMPILER_STRING "tinyc"
1479#define DUK_USE_VARIADIC_MACROS
1481#define DUK_USE_UNION_INITIALIZERS
1484#define DUK_USE_FLEX_ONESIZE
1487#define DUK_USE_PACK_DUMMY_MEMBER
1488#elif defined(DUK_F_VBCC)
1490#undef DUK_USE_BRANCH_HINTS
1492#if defined(DUK_F_CPP)
1493#define DUK_USE_COMPILER_STRING "vbcc-c++"
1495#define DUK_USE_COMPILER_STRING "vbcc"
1498#undef DUK_USE_VARIADIC_MACROS
1499#if defined(DUK_F_C99) || defined(DUK_F_CPP11)
1500#define DUK_USE_VARIADIC_MACROS
1506#undef DUK_USE_UNION_INITIALIZERS
1507#if defined(DUK_F_C99)
1508#define DUK_USE_UNION_INITIALIZERS
1511#define DUK_USE_FLEX_ZEROSIZE
1512#define DUK_USE_PACK_DUMMY_MEMBER
1513#elif defined(DUK_F_BCC)
1515#undef DUK_USE_BRANCH_HINTS
1517#if defined(DUK_F_CPP)
1518#define DUK_USE_COMPILER_STRING "bcc++"
1520#define DUK_USE_COMPILER_STRING "bcc"
1524#undef DUK_USE_VARIADIC_MACROS
1527#undef DUK_USE_UNION_INITIALIZERS
1530#define DUK_USE_FLEX_ONESIZE
1533#define DUK_USE_PACK_DUMMY_MEMBER
1536#if !defined(DUK_USE_BYTEORDER)
1537#define DUK_USE_BYTEORDER 1
1541#undef DUK_USE_BRANCH_HINTS
1543#if defined(DUK_F_CPP)
1544#define DUK_USE_COMPILER_STRING "generic-c++"
1546#define DUK_USE_COMPILER_STRING "generic"
1549#undef DUK_USE_VARIADIC_MACROS
1550#if defined(DUK_F_C99) || defined(DUK_F_CPP11)
1551#define DUK_USE_VARIADIC_MACROS
1555#undef DUK_USE_UNION_INITIALIZERS
1556#if defined(DUK_F_C99)
1557#define DUK_USE_UNION_INITIALIZERS
1561#define DUK_USE_FLEX_ONESIZE
1564#define DUK_USE_PACK_DUMMY_MEMBER
1568#if defined(__UCLIBC__)
1600#if !defined(INT_MAX)
1601#error INT_MAX not defined
1607#if defined(INT_MAX) && defined(INT_MIN)
1608#if INT_MAX != -(INT_MIN + 1)
1609#error platform does not seem complement of two
1612#error cannot check complement of two
1618#if defined(DUK_F_X86) || defined(DUK_F_X32) || \
1619 defined(DUK_F_M68K) || defined(DUK_F_PPC32) || \
1620 defined(DUK_F_BCC) || \
1621 (defined(__WORDSIZE) && (__WORDSIZE == 32)) || \
1622 ((defined(DUK_F_OLD_SOLARIS) || defined(DUK_F_AIX) || \
1623 defined(DUK_F_HPUX)) && defined(_ILP32)) || \
1624 defined(DUK_F_ARM32)
1625#define DUK_F_32BIT_PTRS
1626#elif defined(DUK_F_X64) || \
1627 (defined(__WORDSIZE) && (__WORDSIZE == 64)) || \
1628 ((defined(DUK_F_OLD_SOLARIS) || defined(DUK_F_AIX) || \
1629 defined(DUK_F_HPUX)) && defined(_LP64)) || \
1630 defined(DUK_F_ARM64)
1631#define DUK_F_64BIT_PTRS
1637#undef DUK_F_HAVE_INTTYPES
1638#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
1639 !(defined(DUK_F_AMIGAOS) && defined(DUK_F_VBCC))
1641#define DUK_F_HAVE_INTTYPES
1642#elif defined(__cplusplus) && (__cplusplus >= 201103L)
1644#define DUK_F_HAVE_INTTYPES
1650#if defined(DUK_F_HAVE_INTTYPES)
1653#define DUK_F_HAVE_64BIT
1656typedef uint8_t duk_uint8_t;
1657typedef int8_t duk_int8_t;
1658typedef uint16_t duk_uint16_t;
1659typedef int16_t duk_int16_t;
1660typedef uint32_t duk_uint32_t;
1661typedef int32_t duk_int32_t;
1662typedef uint64_t duk_uint64_t;
1663typedef int64_t duk_int64_t;
1670typedef uint_least64_t duk_uint_least64_t;
1671typedef int_least64_t duk_int_least64_t;
1678typedef uint_fast64_t duk_uint_fast64_t;
1679typedef int_fast64_t duk_int_fast64_t;
1680typedef uintptr_t duk_uintptr_t;
1681typedef intptr_t duk_intptr_t;
1685#define DUK_UINT8_MIN 0
1686#define DUK_UINT8_MAX UINT8_MAX
1687#define DUK_INT8_MIN INT8_MIN
1688#define DUK_INT8_MAX INT8_MAX
1689#define DUK_UINT_LEAST8_MIN 0
1690#define DUK_UINT_LEAST8_MAX UINT_LEAST8_MAX
1691#define DUK_INT_LEAST8_MIN INT_LEAST8_MIN
1692#define DUK_INT_LEAST8_MAX INT_LEAST8_MAX
1693#define DUK_UINT_FAST8_MIN 0
1694#define DUK_UINT_FAST8_MAX UINT_FAST8_MAX
1695#define DUK_INT_FAST8_MIN INT_FAST8_MIN
1696#define DUK_INT_FAST8_MAX INT_FAST8_MAX
1697#define DUK_UINT16_MIN 0
1698#define DUK_UINT16_MAX UINT16_MAX
1699#define DUK_INT16_MIN INT16_MIN
1700#define DUK_INT16_MAX INT16_MAX
1701#define DUK_UINT_LEAST16_MIN 0
1702#define DUK_UINT_LEAST16_MAX UINT_LEAST16_MAX
1703#define DUK_INT_LEAST16_MIN INT_LEAST16_MIN
1704#define DUK_INT_LEAST16_MAX INT_LEAST16_MAX
1705#define DUK_UINT_FAST16_MIN 0
1706#define DUK_UINT_FAST16_MAX UINT_FAST16_MAX
1707#define DUK_INT_FAST16_MIN INT_FAST16_MIN
1708#define DUK_INT_FAST16_MAX INT_FAST16_MAX
1709#define DUK_UINT32_MIN 0
1710#define DUK_UINT32_MAX UINT32_MAX
1711#define DUK_INT32_MIN INT32_MIN
1712#define DUK_INT32_MAX INT32_MAX
1713#define DUK_UINT_LEAST32_MIN 0
1714#define DUK_UINT_LEAST32_MAX UINT_LEAST32_MAX
1715#define DUK_INT_LEAST32_MIN INT_LEAST32_MIN
1716#define DUK_INT_LEAST32_MAX INT_LEAST32_MAX
1717#define DUK_UINT_FAST32_MIN 0
1718#define DUK_UINT_FAST32_MAX UINT_FAST32_MAX
1719#define DUK_INT_FAST32_MIN INT_FAST32_MIN
1720#define DUK_INT_FAST32_MAX INT_FAST32_MAX
1721#define DUK_UINT64_MIN 0
1722#define DUK_UINT64_MAX UINT64_MAX
1723#define DUK_INT64_MIN INT64_MIN
1724#define DUK_INT64_MAX INT64_MAX
1725#define DUK_UINT_LEAST64_MIN 0
1726#define DUK_UINT_LEAST64_MAX UINT_LEAST64_MAX
1727#define DUK_INT_LEAST64_MIN INT_LEAST64_MIN
1728#define DUK_INT_LEAST64_MAX INT_LEAST64_MAX
1729#define DUK_UINT_FAST64_MIN 0
1730#define DUK_UINT_FAST64_MAX UINT_FAST64_MAX
1731#define DUK_INT_FAST64_MIN INT_FAST64_MIN
1732#define DUK_INT_FAST64_MAX INT_FAST64_MAX
1734#define DUK_UINTPTR_MIN 0
1735#define DUK_UINTPTR_MAX UINTPTR_MAX
1736#define DUK_INTPTR_MIN INTPTR_MIN
1737#define DUK_INTPTR_MAX INTPTR_MAX
1739#define DUK_UINTMAX_MIN 0
1740#define DUK_UINTMAX_MAX UINTMAX_MAX
1741#define DUK_INTMAX_MIN INTMAX_MIN
1742#define DUK_INTMAX_MAX INTMAX_MAX
1744#define DUK_SIZE_MIN 0
1745#define DUK_SIZE_MAX SIZE_MAX
1746#undef DUK_SIZE_MAX_COMPUTED
1761#if (defined(CHAR_BIT) && (CHAR_BIT == 8)) || \
1762 (defined(UCHAR_MAX) && (UCHAR_MAX == 255))
1763typedef unsigned char duk_uint8_t;
1764typedef signed char duk_int8_t;
1766#error cannot detect 8-bit type
1769#if defined(USHRT_MAX) && (USHRT_MAX == 65535UL)
1770typedef unsigned short duk_uint16_t;
1771typedef signed short duk_int16_t;
1772#elif defined(UINT_MAX) && (UINT_MAX == 65535UL)
1774typedef unsigned int duk_uint16_t;
1775typedef signed int duk_int16_t;
1777#error cannot detect 16-bit type
1780#if defined(UINT_MAX) && (UINT_MAX == 4294967295UL)
1781typedef unsigned int duk_uint32_t;
1782typedef signed int duk_int32_t;
1783#elif defined(ULONG_MAX) && (ULONG_MAX == 4294967295UL)
1785typedef unsigned long duk_uint32_t;
1786typedef signed long duk_int32_t;
1788#error cannot detect 32-bit type
1804#undef DUK_F_HAVE_64BIT
1805#if !defined(DUK_F_HAVE_64BIT) && defined(ULONG_MAX)
1806#if (ULONG_MAX > 4294967295UL)
1807#define DUK_F_HAVE_64BIT
1808typedef unsigned long duk_uint64_t;
1809typedef signed long duk_int64_t;
1812#if !defined(DUK_F_HAVE_64BIT) && defined(ULLONG_MAX)
1813#if (ULLONG_MAX > 4294967295UL)
1814#define DUK_F_HAVE_64BIT
1815typedef unsigned long long duk_uint64_t;
1816typedef signed long long duk_int64_t;
1819#if !defined(DUK_F_HAVE_64BIT) && defined(__ULONG_LONG_MAX__)
1820#if (__ULONG_LONG_MAX__ > 4294967295UL)
1821#define DUK_F_HAVE_64BIT
1822typedef unsigned long long duk_uint64_t;
1823typedef signed long long duk_int64_t;
1826#if !defined(DUK_F_HAVE_64BIT) && defined(__LONG_LONG_MAX__)
1827#if (__LONG_LONG_MAX__ > 2147483647L)
1828#define DUK_F_HAVE_64BIT
1829typedef unsigned long long duk_uint64_t;
1830typedef signed long long duk_int64_t;
1833#if !defined(DUK_F_HAVE_64BIT) && defined(DUK_F_MINGW)
1834#define DUK_F_HAVE_64BIT
1835typedef unsigned long duk_uint64_t;
1836typedef signed long duk_int64_t;
1838#if !defined(DUK_F_HAVE_64BIT) && defined(DUK_F_MSVC)
1839#define DUK_F_HAVE_64BIT
1840typedef unsigned __int64 duk_uint64_t;
1841typedef signed __int64 duk_int64_t;
1843#if !defined(DUK_F_HAVE_64BIT)
1859#if defined(DUK_F_HAVE_64BIT)
1860typedef duk_uint64_t duk_uint_least64_t;
1861typedef duk_int64_t duk_int_least64_t;
1862typedef duk_uint64_t duk_uint_fast64_t;
1863typedef duk_int64_t duk_int_fast64_t;
1865#if defined(DUK_F_HAVE_64BIT)
1877#define DUK_UINT8_MIN 0UL
1878#define DUK_UINT8_MAX 0xffUL
1879#define DUK_INT8_MIN (-0x80L)
1880#define DUK_INT8_MAX 0x7fL
1881#define DUK_UINT_LEAST8_MIN 0UL
1882#define DUK_UINT_LEAST8_MAX 0xffUL
1883#define DUK_INT_LEAST8_MIN (-0x80L)
1884#define DUK_INT_LEAST8_MAX 0x7fL
1885#define DUK_UINT_FAST8_MIN 0UL
1886#define DUK_UINT_FAST8_MAX 0xffUL
1887#define DUK_INT_FAST8_MIN (-0x80L)
1888#define DUK_INT_FAST8_MAX 0x7fL
1889#define DUK_UINT16_MIN 0UL
1890#define DUK_UINT16_MAX 0xffffUL
1891#define DUK_INT16_MIN (-0x7fffL - 1L)
1892#define DUK_INT16_MAX 0x7fffL
1893#define DUK_UINT_LEAST16_MIN 0UL
1894#define DUK_UINT_LEAST16_MAX 0xffffUL
1895#define DUK_INT_LEAST16_MIN (-0x7fffL - 1L)
1896#define DUK_INT_LEAST16_MAX 0x7fffL
1897#define DUK_UINT_FAST16_MIN 0UL
1898#define DUK_UINT_FAST16_MAX 0xffffUL
1899#define DUK_INT_FAST16_MIN (-0x7fffL - 1L)
1900#define DUK_INT_FAST16_MAX 0x7fffL
1901#define DUK_UINT32_MIN 0UL
1902#define DUK_UINT32_MAX 0xffffffffUL
1903#define DUK_INT32_MIN (-0x7fffffffL - 1L)
1904#define DUK_INT32_MAX 0x7fffffffL
1905#define DUK_UINT_LEAST32_MIN 0UL
1906#define DUK_UINT_LEAST32_MAX 0xffffffffUL
1907#define DUK_INT_LEAST32_MIN (-0x7fffffffL - 1L)
1908#define DUK_INT_LEAST32_MAX 0x7fffffffL
1909#define DUK_UINT_FAST32_MIN 0UL
1910#define DUK_UINT_FAST32_MAX 0xffffffffUL
1911#define DUK_INT_FAST32_MIN (-0x7fffffffL - 1L)
1912#define DUK_INT_FAST32_MAX 0x7fffffffL
1918#if defined(DUK_F_HAVE_64BIT)
1919#define DUK_UINT64_MIN ((duk_uint64_t) 0)
1920#define DUK_UINT64_MAX ((duk_uint64_t) -1)
1921#define DUK_INT64_MIN ((duk_int64_t) (~(DUK_UINT64_MAX >> 1)))
1922#define DUK_INT64_MAX ((duk_int64_t) (DUK_UINT64_MAX >> 1))
1923#define DUK_UINT_LEAST64_MIN DUK_UINT64_MIN
1924#define DUK_UINT_LEAST64_MAX DUK_UINT64_MAX
1925#define DUK_INT_LEAST64_MIN DUK_INT64_MIN
1926#define DUK_INT_LEAST64_MAX DUK_INT64_MAX
1927#define DUK_UINT_FAST64_MIN DUK_UINT64_MIN
1928#define DUK_UINT_FAST64_MAX DUK_UINT64_MAX
1929#define DUK_INT_FAST64_MIN DUK_INT64_MIN
1930#define DUK_INT_FAST64_MAX DUK_INT64_MAX
1931#define DUK_UINT64_MIN_COMPUTED
1932#define DUK_UINT64_MAX_COMPUTED
1933#define DUK_INT64_MIN_COMPUTED
1934#define DUK_INT64_MAX_COMPUTED
1935#define DUK_UINT_LEAST64_MIN_COMPUTED
1936#define DUK_UINT_LEAST64_MAX_COMPUTED
1937#define DUK_INT_LEAST64_MIN_COMPUTED
1938#define DUK_INT_LEAST64_MAX_COMPUTED
1939#define DUK_UINT_FAST64_MIN_COMPUTED
1940#define DUK_UINT_FAST64_MAX_COMPUTED
1941#define DUK_INT_FAST64_MIN_COMPUTED
1942#define DUK_INT_FAST64_MAX_COMPUTED
1945#if defined(DUK_F_HAVE_64BIT)
1946#define DUK_UINTMAX_MIN DUK_UINT64_MIN
1947#define DUK_UINTMAX_MAX DUK_UINT64_MAX
1948#define DUK_INTMAX_MIN DUK_INT64_MIN
1949#define DUK_INTMAX_MAX DUK_INT64_MAX
1950#define DUK_UINTMAX_MIN_COMPUTED
1951#define DUK_UINTMAX_MAX_COMPUTED
1952#define DUK_INTMAX_MIN_COMPUTED
1953#define DUK_INTMAX_MAX_COMPUTED
1955#define DUK_UINTMAX_MIN 0UL
1956#define DUK_UINTMAX_MAX 0xffffffffUL
1957#define DUK_INTMAX_MIN (-0x7fffffffL - 1L)
1958#define DUK_INTMAX_MAX 0x7fffffffL
1962#if defined(DUK_F_32BIT_PTRS)
1963typedef duk_int32_t duk_intptr_t;
1964typedef duk_uint32_t duk_uintptr_t;
1965#define DUK_UINTPTR_MIN DUK_UINT32_MIN
1966#define DUK_UINTPTR_MAX DUK_UINT32_MAX
1967#define DUK_INTPTR_MIN DUK_INT32_MIN
1968#define DUK_INTPTR_MAX DUK_INT32_MAX
1969#elif defined(DUK_F_64BIT_PTRS) && defined(DUK_F_HAVE_64BIT)
1970typedef duk_int64_t duk_intptr_t;
1971typedef duk_uint64_t duk_uintptr_t;
1972#define DUK_UINTPTR_MIN DUK_UINT64_MIN
1973#define DUK_UINTPTR_MAX DUK_UINT64_MAX
1974#define DUK_INTPTR_MIN DUK_INT64_MIN
1975#define DUK_INTPTR_MAX DUK_INT64_MAX
1976#define DUK_UINTPTR_MIN_COMPUTED
1977#define DUK_UINTPTR_MAX_COMPUTED
1978#define DUK_INTPTR_MIN_COMPUTED
1979#define DUK_INTPTR_MAX_COMPUTED
1981#error cannot determine intptr type
1985#undef DUK_SIZE_MAX_COMPUTED
1986#if !defined(SIZE_MAX)
1987#define DUK_SIZE_MAX_COMPUTED
1988#define SIZE_MAX ((size_t) (-1))
1990#define DUK_SIZE_MIN 0
1991#define DUK_SIZE_MAX SIZE_MAX
2003#if defined(UINT_MAX) && (UINT_MAX >= 0xffffffffUL)
2006#define DUK_INT_MIN INT_MIN
2007#define DUK_INT_MAX INT_MAX
2008#define DUK_UINT_MIN 0
2009#define DUK_UINT_MAX UINT_MAX
2013#define DUK_INT_MIN DUK_INT_FAST32_MIN
2014#define DUK_INT_MAX DUK_INT_FAST32_MAX
2015#define DUK_UINT_MIN DUK_UINT_FAST32_MIN
2016#define DUK_UINT_MAX DUK_UINT_FAST32_MAX
2025#define DUK_INT_FAST_MIN DUK_INT_FAST32_MIN
2026#define DUK_INT_FAST_MAX DUK_INT_FAST32_MAX
2027#define DUK_UINT_FAST_MIN DUK_UINT_FAST32_MIN
2028#define DUK_UINT_FAST_MAX DUK_UINT_FAST32_MAX
2035#define DUK_SMALL_INT_MIN INT_MIN
2036#define DUK_SMALL_INT_MAX INT_MAX
2037#define DUK_SMALL_UINT_MIN 0
2038#define DUK_SMALL_UINT_MAX UINT_MAX
2045#define DUK_SMALL_INT_FAST_MIN DUK_INT_FAST16_MIN
2046#define DUK_SMALL_INT_FAST_MAX DUK_INT_FAST16_MAX
2047#define DUK_SMALL_UINT_FAST_MIN DUK_UINT_FAST16_MIN
2048#define DUK_SMALL_UINT_FAST_MAX DUK_UINT_FAST16_MAX
2052#define DUK_BOOL_MIN DUK_SMALL_UINT_MIN
2053#define DUK_BOOL_MAX DUK_SMALL_UINT_MAX
2057#define DUK_IDX_MIN DUK_INT_MIN
2058#define DUK_IDX_MAX DUK_INT_MAX
2062#define DUK_UIDX_MIN DUK_UINT_MIN
2063#define DUK_UIDX_MAX DUK_UINT_MAX
2069#define DUK_UARRIDX_MIN DUK_UINT_MIN
2070#define DUK_UARRIDX_MAX DUK_UINT_MAX
2077#define DUK_RET_MIN DUK_SMALL_INT_MIN
2078#define DUK_RET_MAX DUK_SMALL_INT_MAX
2084#define DUK_ERRCODE_MIN DUK_INT_MIN
2085#define DUK_ERRCODE_MAX DUK_INT_MAX
2096#define DUK_CODEPOINT_MIN DUK_INT_MIN
2097#define DUK_CODEPOINT_MAX DUK_INT_MAX
2098#define DUK_UCODEPOINT_MIN DUK_UINT_MIN
2099#define DUK_UCODEPOINT_MAX DUK_UINT_MAX
2110#if !defined(DUK_SIZE_MAX)
2111#error DUK_SIZE_MAX is undefined, probably missing SIZE_MAX
2112#elif !defined(DUK_SIZE_MAX_COMPUTED)
2113#if DUK_SIZE_MAX < 0xffffffffUL
2134#if defined(DUK_F_HAVE_64BIT) && !defined(DUK_F_VBCC)
2135#define DUK_USE_64BIT_OPS
2137#undef DUK_USE_64BIT_OPS
2145#if !defined(DUK_ABORT)
2146#define DUK_ABORT abort
2149#if !defined(DUK_SETJMP)
2150#define DUK_JMPBUF_TYPE jmp_buf
2151#define DUK_SETJMP(jb) setjmp((jb))
2152#define DUK_LONGJMP(jb) longjmp((jb), 1)
2157#define DUK_JMPBUF_TYPE sigjmp_buf
2158#define DUK_SETJMP(jb) sigsetjmp((jb))
2159#define DUK_LONGJMP(jb) siglongjmp((jb), 1)
2166#if !defined(DUK_ANSI_MALLOC)
2167#define DUK_ANSI_MALLOC malloc
2169#if !defined(DUK_ANSI_REALLOC)
2170#define DUK_ANSI_REALLOC realloc
2172#if !defined(DUK_ANSI_CALLOC)
2173#define DUK_ANSI_CALLOC calloc
2175#if !defined(DUK_ANSI_FREE)
2176#define DUK_ANSI_FREE free
2200#if !defined(DUK_MEMCPY)
2201#if defined(DUK_F_UCLIBC)
2205#define DUK_MEMCPY memmove
2207#define DUK_MEMCPY memcpy
2210#if !defined(DUK_MEMMOVE)
2211#define DUK_MEMMOVE memmove
2213#if !defined(DUK_MEMCMP)
2214#define DUK_MEMCMP memcmp
2216#if !defined(DUK_MEMSET)
2217#define DUK_MEMSET memset
2219#if !defined(DUK_STRLEN)
2220#define DUK_STRLEN strlen
2222#if !defined(DUK_STRCMP)
2223#define DUK_STRCMP strcmp
2225#if !defined(DUK_STRNCMP)
2226#define DUK_STRNCMP strncmp
2228#if !defined(DUK_SPRINTF)
2229#define DUK_SPRINTF sprintf
2231#if !defined(DUK_SNPRINTF)
2233#define DUK_SNPRINTF snprintf
2235#if !defined(DUK_VSPRINTF)
2236#define DUK_VSPRINTF vsprintf
2238#if !defined(DUK_VSNPRINTF)
2240#define DUK_VSNPRINTF vsnprintf
2242#if !defined(DUK_SSCANF)
2243#define DUK_SSCANF sscanf
2245#if !defined(DUK_VSSCANF)
2246#define DUK_VSSCANF vsscanf
2248#if !defined(DUK_MEMZERO)
2249#define DUK_MEMZERO(p,n) DUK_MEMSET((p), 0, (n))
2252#if !defined(DUK_DOUBLE_INFINITY)
2253#undef DUK_USE_COMPUTED_INFINITY
2254#if defined(DUK_F_GCC_VERSION) && (DUK_F_GCC_VERSION < 40600)
2256#define DUK_DOUBLE_INFINITY (__builtin_inf())
2257#elif defined(INFINITY)
2258#define DUK_DOUBLE_INFINITY ((double) INFINITY)
2259#elif !defined(DUK_F_VBCC) && !defined(DUK_F_MSVC) && !defined(DUK_F_BCC) && \
2260 !defined(DUK_F_OLD_SOLARIS) && !defined(DUK_F_AIX)
2261#define DUK_DOUBLE_INFINITY (1.0 / 0.0)
2267#define DUK_USE_COMPUTED_INFINITY
2268#define DUK_DOUBLE_INFINITY duk_computed_infinity
2272#if !defined(DUK_DOUBLE_NAN)
2273#undef DUK_USE_COMPUTED_NAN
2275#define DUK_DOUBLE_NAN NAN
2276#elif !defined(DUK_F_VBCC) && !defined(DUK_F_MSVC) && !defined(DUK_F_BCC) && \
2277 !defined(DUK_F_OLD_SOLARIS) && !defined(DUK_F_AIX)
2278#define DUK_DOUBLE_NAN (0.0 / 0.0)
2285#define DUK_USE_COMPUTED_NAN
2286#define DUK_DOUBLE_NAN duk_computed_nan
2294#undef DUK_USE_REPL_FPCLASSIFY
2295#undef DUK_USE_REPL_SIGNBIT
2296#undef DUK_USE_REPL_ISFINITE
2297#undef DUK_USE_REPL_ISNAN
2298#undef DUK_USE_REPL_ISINF
2301#undef DUK_F_USE_REPL_ALL
2302#if !(defined(FP_NAN) && defined(FP_INFINITE) && defined(FP_ZERO) && \
2303 defined(FP_SUBNORMAL) && defined(FP_NORMAL))
2305#define DUK_F_USE_REPL_ALL
2306#elif defined(DUK_F_AMIGAOS) && defined(DUK_F_VBCC)
2308#define DUK_F_USE_REPL_ALL
2309#elif defined(DUK_F_AMIGAOS) && defined(DUK_F_M68K)
2314#define DUK_F_USE_REPL_ALL
2315#elif defined(DUK_F_FREEBSD) && defined(DUK_F_CLANG)
2319#define DUK_F_USE_REPL_ALL
2320#elif defined(DUK_F_UCLIBC)
2325#define DUK_F_USE_REPL_ALL
2326#elif defined(DUK_F_AIX)
2328#define DUK_F_USE_REPL_ALL
2331#if defined(DUK_F_USE_REPL_ALL)
2332#define DUK_USE_REPL_FPCLASSIFY
2333#define DUK_USE_REPL_SIGNBIT
2334#define DUK_USE_REPL_ISFINITE
2335#define DUK_USE_REPL_ISNAN
2336#define DUK_USE_REPL_ISINF
2337#define DUK_FPCLASSIFY duk_repl_fpclassify
2338#define DUK_SIGNBIT duk_repl_signbit
2339#define DUK_ISFINITE duk_repl_isfinite
2340#define DUK_ISNAN duk_repl_isnan
2341#define DUK_ISINF duk_repl_isinf
2343#define DUK_FP_INFINITE 1
2344#define DUK_FP_ZERO 2
2345#define DUK_FP_SUBNORMAL 3
2346#define DUK_FP_NORMAL 4
2348#define DUK_FPCLASSIFY fpclassify
2349#define DUK_SIGNBIT signbit
2350#define DUK_ISFINITE isfinite
2351#define DUK_ISNAN isnan
2352#define DUK_ISINF isinf
2353#define DUK_FP_NAN FP_NAN
2354#define DUK_FP_INFINITE FP_INFINITE
2355#define DUK_FP_ZERO FP_ZERO
2356#define DUK_FP_SUBNORMAL FP_SUBNORMAL
2357#define DUK_FP_NORMAL FP_NORMAL
2360#if defined(DUK_F_USE_REPL_ALL)
2361#undef DUK_F_USE_REPL_ALL
2368#if !defined(DUK_FABS)
2369#define DUK_FABS fabs
2371#if !defined(DUK_FLOOR)
2372#define DUK_FLOOR floor
2374#if !defined(DUK_CEIL)
2375#define DUK_CEIL ceil
2377#if !defined(DUK_FMOD)
2378#define DUK_FMOD fmod
2380#if !defined(DUK_POW)
2383#if !defined(DUK_ACOS)
2384#define DUK_ACOS acos
2386#if !defined(DUK_ASIN)
2387#define DUK_ASIN asin
2389#if !defined(DUK_ATAN)
2390#define DUK_ATAN atan
2392#if !defined(DUK_ATAN2)
2393#define DUK_ATAN2 atan2
2395#if !defined(DUK_SIN)
2398#if !defined(DUK_COS)
2401#if !defined(DUK_TAN)
2404#if !defined(DUK_EXP)
2407#if !defined(DUK_LOG)
2410#if !defined(DUK_SQRT)
2411#define DUK_SQRT sqrt
2419#if (defined(DUK_F_C99) || defined(DUK_F_CPP11) || (defined(_MSC_VER) && (_MSC_VER >= 1800))) && \
2420 !defined(DUK_F_ANDROID) && !defined(DUK_F_MINT)
2421#if !defined(DUK_CBRT)
2422#define DUK_CBRT cbrt
2424#if !defined(DUK_LOG2)
2425#define DUK_LOG2 log2
2427#if !defined(DUK_LOG10)
2428#define DUK_LOG10 log10
2430#if !defined(DUK_TRUNC)
2431#define DUK_TRUNC trunc
2440#undef DUK_USE_POW_WORKAROUNDS
2441#if defined(DUK_F_NETBSD) || defined(DUK_F_MINGW)
2442#define DUK_USE_POW_WORKAROUNDS
2448#undef DUK_USE_ATAN2_WORKAROUNDS
2449#if defined(DUK_F_MINGW)
2450#define DUK_USE_ATAN2_WORKAROUNDS
2457#undef DUK_USE_PARANOID_MATH
2467#undef DUK_USE_PARANOID_DATE_COMPUTATION
2468#if !defined(DUK_F_C99)
2469#define DUK_USE_PARANOID_DATE_COMPUTATION
2499#if !defined(DUK_USE_BYTEORDER) && defined(__BYTE_ORDER__)
2500#if defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
2501#if defined(__FLOAT_WORD_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__FLOAT_WORD_ORDER__ == __ORDER_LITTLE_ENDIAN__)
2502#define DUK_USE_BYTEORDER 1
2503#elif defined(__FLOAT_WORD_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__)
2504#define DUK_USE_BYTEORDER 2
2505#elif !defined(__FLOAT_WORD_ORDER__)
2507#define DUK_USE_BYTEORDER 1
2511#elif defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
2512#if defined(__FLOAT_WORD_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__)
2513#define DUK_USE_BYTEORDER 3
2514#elif !defined(__FLOAT_WORD_ORDER__)
2516#define DUK_USE_BYTEORDER 3
2533#if !defined(DUK_USE_BYTEORDER)
2534#if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && (__BYTE_ORDER == __LITTLE_ENDIAN) || \
2535 defined(_BYTE_ORDER) && defined(_LITTLE_ENDIAN) && (_BYTE_ORDER == _LITTLE_ENDIAN) || \
2536 defined(__LITTLE_ENDIAN__)
2537#if defined(__FLOAT_WORD_ORDER) && defined(__LITTLE_ENDIAN) && (__FLOAT_WORD_ORDER == __LITTLE_ENDIAN) || \
2538 defined(_FLOAT_WORD_ORDER) && defined(_LITTLE_ENDIAN) && (_FLOAT_WORD_ORDER == _LITTLE_ENDIAN)
2539#define DUK_USE_BYTEORDER 1
2540#elif defined(__FLOAT_WORD_ORDER) && defined(__BIG_ENDIAN) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) || \
2541 defined(_FLOAT_WORD_ORDER) && defined(_BIG_ENDIAN) && (_FLOAT_WORD_ORDER == _BIG_ENDIAN)
2542#define DUK_USE_BYTEORDER 2
2543#elif !defined(__FLOAT_WORD_ORDER) && !defined(_FLOAT_WORD_ORDER)
2545#define DUK_USE_BYTEORDER 1
2549#elif defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && (__BYTE_ORDER == __BIG_ENDIAN) || \
2550 defined(_BYTE_ORDER) && defined(_BIG_ENDIAN) && (_BYTE_ORDER == _BIG_ENDIAN) || \
2551 defined(__BIG_ENDIAN__)
2552#if defined(__FLOAT_WORD_ORDER) && defined(__BIG_ENDIAN) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) || \
2553 defined(_FLOAT_WORD_ORDER) && defined(_BIG_ENDIAN) && (_FLOAT_WORD_ORDER == _BIG_ENDIAN)
2554#define DUK_USE_BYTEORDER 3
2555#elif !defined(__FLOAT_WORD_ORDER) && !defined(_FLOAT_WORD_ORDER)
2557#define DUK_USE_BYTEORDER 3
2574#if !defined(DUK_USE_BYTEORDER)
2575#if defined(__LITTLEENDIAN__)
2576#define DUK_USE_BYTEORDER 1
2577#elif defined(__BIGENDIAN__)
2578#define DUK_USE_BYTEORDER 3
2594#if !defined(DUK_USE_ALIGN_BY)
2595#define DUK_USE_ALIGN_BY 8
2604#if !(defined(DUK_USE_PACK_MSVC_PRAGMA) || defined(DUK_USE_PACK_GCC_ATTR) || \
2605 defined(DUK_USE_PACK_CLANG_ATTR) || defined(DUK_USE_PACK_DUMMY_MEMBER))
2606#define DUK_USE_PACK_DUMMY_MEMBER
2609#if !defined(DUK_U64_CONSTANT)
2610#define DUK_U64_CONSTANT(x) x##ULL
2612#if !defined(DUK_I64_CONSTANT)
2613#define DUK_I64_CONSTANT(x) x##LL
2616#if !defined(DUK_VA_COPY)
2622#if defined(DUK_F_C99) || defined(DUK_F_CPP11)
2627#define DUK_VA_COPY(dest,src) va_copy(dest,src)
2634#define DUK_VA_COPY(dest,src) do { (dest) = (src); } while (0)
2638#if !defined(DUK_MACRO_STRINGIFY)
2642#define DUK_MACRO_STRINGIFY_HELPER(x) #x
2643#define DUK_MACRO_STRINGIFY(x) DUK_MACRO_STRINGIFY_HELPER(x)
2646#if !defined(DUK_CAUSE_SEGFAULT)
2650#define DUK_CAUSE_SEGFAULT() do { *((volatile duk_uint32_t *) NULL) = (duk_uint32_t) 0xdeadbeefUL; } while (0)
2653#if !defined(DUK_UNREF)
2660#define DUK_UNREF(x) do { (void) (x); } while (0)
2673#if defined(DUK_NORETURN)
2674#define DUK_WO_NORETURN(stmt) do { } while (0)
2676#define DUK_NORETURN(decl) decl
2677#define DUK_WO_NORETURN(stmt) do { stmt } while (0)
2680#if defined(DUK_UNREACHABLE)
2681#define DUK_WO_UNREACHABLE(stmt) do { } while (0)
2687#define DUK_UNREACHABLE() do { } while (0)
2688#define DUK_WO_UNREACHABLE(stmt) do { stmt } while (0)
2691#if !defined(DUK_LOSE_CONST)
2696#define DUK_LOSE_CONST(src) ((void *) (duk_uintptr_t) (src))
2699#if !defined(DUK_LIKELY)
2700#define DUK_LIKELY(x) (x)
2702#if !defined(DUK_UNLIKELY)
2703#define DUK_UNLIKELY(x) (x)
2705#if !defined(DUK_UNPREDICTABLE)
2706#define DUK_UNPREDICTABLE(x) (x)
2709#if !defined(DUK_NOINLINE)
2712#if !defined(DUK_INLINE)
2715#if !defined(DUK_ALWAYS_INLINE)
2716#define DUK_ALWAYS_INLINE
2719#if !defined(DUK_HOT)
2722#if !defined(DUK_COLD)
2726#if !defined(DUK_EXTERNAL_DECL)
2727#define DUK_EXTERNAL_DECL extern
2729#if !defined(DUK_EXTERNAL)
2732#if !defined(DUK_INTERNAL_DECL)
2733#if defined(DUK_SINGLE_FILE)
2734#define DUK_INTERNAL_DECL static
2736#define DUK_INTERNAL_DECL extern
2739#if !defined(DUK_INTERNAL)
2740#if defined(DUK_SINGLE_FILE)
2741#define DUK_INTERNAL static
2746#if !defined(DUK_LOCAL_DECL)
2747#define DUK_LOCAL_DECL static
2749#if !defined(DUK_LOCAL)
2750#define DUK_LOCAL static
2753#if !defined(DUK_FILE_MACRO)
2754#define DUK_FILE_MACRO __FILE__
2756#if !defined(DUK_LINE_MACRO)
2757#define DUK_LINE_MACRO __LINE__
2759#if !defined(DUK_FUNC_MACRO)
2760#if defined(DUK_F_C99) || defined(DUK_F_CPP11)
2761#define DUK_FUNC_MACRO __func__
2762#elif defined(__FUNCTION__)
2763#define DUK_FUNC_MACRO __FUNCTION__
2765#define DUK_FUNC_MACRO "unknown"
2769#if defined(DUK_F_HAVE_64BIT)
2770#if !defined(DUK_BSWAP64)
2771#define DUK_BSWAP64(x) \
2772 ((((duk_uint64_t) (x)) >> 56U) | \
2773 ((((duk_uint64_t) (x)) >> 40U) & DUK_U64_CONSTANT(0xff00)) | \
2774 ((((duk_uint64_t) (x)) >> 24U) & DUK_U64_CONSTANT(0xff0000)) | \
2775 ((((duk_uint64_t) (x)) >> 8U) & DUK_U64_CONSTANT(0xff000000)) | \
2776 ((((duk_uint64_t) (x)) << 8U) & DUK_U64_CONSTANT(0xff00000000)) | \
2777 ((((duk_uint64_t) (x)) << 24U) & DUK_U64_CONSTANT(0xff0000000000)) | \
2778 ((((duk_uint64_t) (x)) << 40U) & DUK_U64_CONSTANT(0xff000000000000)) | \
2779 (((duk_uint64_t) (x)) << 56U))
2782#if !defined(DUK_BSWAP32)
2783#define DUK_BSWAP32(x) \
2784 ((((duk_uint32_t) (x)) >> 24U) | \
2785 ((((duk_uint32_t) (x)) >> 8U) & 0xff00UL) | \
2786 ((((duk_uint32_t) (x)) << 8U) & 0xff0000UL) | \
2787 (((duk_uint32_t) (x)) << 24U))
2789#if !defined(DUK_BSWAP16)
2790#define DUK_BSWAP16(x) \
2791 ((duk_uint16_t) (x) >> 8U) | \
2792 ((duk_uint16_t) (x) << 8U)
2798#if !(defined(DUK_USE_FLEX_C99) || defined(DUK_USE_FLEX_ZEROSIZE) || defined(DUK_USE_FLEX_ONESIZE))
2799#if defined(DUK_F_C99)
2800#define DUK_USE_FLEX_C99
2802#define DUK_USE_FLEX_ZEROSIZE
2806#if !(defined(DUK_USE_PACK_GCC_ATTR) || defined(DUK_USE_PACK_CLANG_ATTR) || \
2807 defined(DUK_USE_PACK_MSVC_PRAGMA) || defined(DUK_USE_PACK_DUMMY_MEMBER))
2808#define DUK_USE_PACK_DUMMY_MEMBER
2812#undef DUK_USE_GCC_PRAGMAS
2818#if !defined(DUK_SINGLE_FILE)
2821#undef DUK_ALWAYS_INLINE
2824#define DUK_ALWAYS_INLINE
2836#if !defined(DUK_F_PACKED_TVAL_PROVIDED)
2837#undef DUK_F_PACKED_TVAL_POSSIBLE
2840#if !defined(DUK_F_PACKED_TVAL_POSSIBLE) && defined(DUK_UINTPTR_MAX)
2841#if (DUK_UINTPTR_MAX <= 0xffffffffUL)
2842#define DUK_F_PACKED_TVAL_POSSIBLE
2847#if !defined(DUK_F_PACKED_TVAL_POSSIBLE) && defined(DUK_UINTPTR_MAX) && !defined(DUK_UINTPTR_MAX_COMPUTED)
2848#if (DUK_UINTPTR_MAX <= 0xffffffffUL)
2849#define DUK_F_PACKED_TVAL_POSSIBLE
2854#if !defined(DUK_F_PACKED_TVAL_POSSIBLE) && defined(DUK_SIZE_MAX) && !defined(DUK_SIZE_MAX_COMPUTED)
2855#if (DUK_SIZE_MAX <= 0xffffffffUL)
2856#define DUK_F_PACKED_TVAL_POSSIBLE
2860#undef DUK_USE_PACKED_TVAL
2861#if defined(DUK_F_PACKED_TVAL_POSSIBLE)
2862#define DUK_USE_PACKED_TVAL
2864#undef DUK_F_PACKED_TVAL_POSSIBLE
2872#undef DUK_USE_HOBJECT_LAYOUT_1
2873#undef DUK_USE_HOBJECT_LAYOUT_2
2874#undef DUK_USE_HOBJECT_LAYOUT_3
2875#if (DUK_USE_ALIGN_BY == 1)
2880#define DUK_USE_HOBJECT_LAYOUT_1
2886#define DUK_USE_HOBJECT_LAYOUT_2
2892#if defined(__FAST_MATH__)
2893#error __FAST_MATH__ defined, refusing to compile
2900#undef DUK_USE_ALLOW_UNDEFINED_BEHAVIOR
2901#define DUK_USE_ARRAY_BUILTIN
2902#define DUK_USE_ARRAY_FASTPATH
2903#define DUK_USE_ARRAY_PROP_FASTPATH
2904#undef DUK_USE_ASSERTIONS
2905#define DUK_USE_AUGMENT_ERROR_CREATE
2906#define DUK_USE_AUGMENT_ERROR_THROW
2907#define DUK_USE_AVOID_PLATFORM_FUNCPTRS
2908#define DUK_USE_BASE64_FASTPATH
2909#define DUK_USE_BASE64_SUPPORT
2910#define DUK_USE_BOOLEAN_BUILTIN
2911#define DUK_USE_BUFFEROBJECT_SUPPORT
2912#undef DUK_USE_BUFLEN16
2913#define DUK_USE_BYTECODE_DUMP_SUPPORT
2914#define DUK_USE_CACHE_ACTIVATION
2915#define DUK_USE_CACHE_CATCHER
2916#define DUK_USE_CALLSTACK_LIMIT 10000
2917#define DUK_USE_CBOR_BUILTIN
2918#define DUK_USE_CBOR_DEC_RECLIMIT 1000
2919#define DUK_USE_CBOR_ENC_RECLIMIT 1000
2920#define DUK_USE_CBOR_SUPPORT
2921#define DUK_USE_COMPILER_RECLIMIT 2500
2922#define DUK_USE_COROUTINE_SUPPORT
2923#undef DUK_USE_CPP_EXCEPTIONS
2924#undef DUK_USE_DATAPTR16
2925#undef DUK_USE_DATAPTR_DEC16
2926#undef DUK_USE_DATAPTR_ENC16
2927#define DUK_USE_DATE_BUILTIN
2928#undef DUK_USE_DATE_FORMAT_STRING
2929#undef DUK_USE_DATE_GET_LOCAL_TZOFFSET
2930#undef DUK_USE_DATE_GET_NOW
2931#undef DUK_USE_DATE_PARSE_STRING
2932#undef DUK_USE_DATE_PRS_GETDATE
2934#undef DUK_USE_DEBUGGER_DUMPHEAP
2935#undef DUK_USE_DEBUGGER_INSPECT
2936#undef DUK_USE_DEBUGGER_PAUSE_UNCAUGHT
2937#undef DUK_USE_DEBUGGER_SUPPORT
2938#define DUK_USE_DEBUGGER_THROW_NOTIFY
2939#undef DUK_USE_DEBUGGER_TRANSPORT_TORTURE
2940#define DUK_USE_DEBUG_BUFSIZE 65536L
2941#define DUK_USE_DEBUG_LEVEL 0
2942#undef DUK_USE_DEBUG_WRITE
2943#define DUK_USE_DOUBLE_LINKED_HEAP
2944#define DUK_USE_DUKTAPE_BUILTIN
2945#define DUK_USE_ENCODING_BUILTINS
2946#define DUK_USE_ERRCREATE
2947#define DUK_USE_ERRTHROW
2949#define DUK_USE_ES6_OBJECT_PROTO_PROPERTY
2950#define DUK_USE_ES6_OBJECT_SETPROTOTYPEOF
2951#define DUK_USE_ES6_PROXY
2952#define DUK_USE_ES6_REGEXP_SYNTAX
2953#define DUK_USE_ES6_UNICODE_ESCAPE
2955#define DUK_USE_ES7_EXP_OPERATOR
2958#define DUK_USE_ESBC_LIMITS
2959#define DUK_USE_ESBC_MAX_BYTES 2147418112L
2960#define DUK_USE_ESBC_MAX_LINENUMBER 2147418112L
2961#undef DUK_USE_EXEC_FUN_LOCAL
2962#undef DUK_USE_EXEC_INDIRECT_BOUND_CHECK
2963#undef DUK_USE_EXEC_PREFER_SIZE
2964#define DUK_USE_EXEC_REGCONST_OPTIMIZE
2965#undef DUK_USE_EXEC_TIMEOUT_CHECK
2966#undef DUK_USE_EXPLICIT_NULL_INIT
2967#undef DUK_USE_EXTSTR_FREE
2968#undef DUK_USE_EXTSTR_INTERN_CHECK
2969#undef DUK_USE_FASTINT
2970#define DUK_USE_FAST_REFCOUNT_DEFAULT
2971#undef DUK_USE_FATAL_HANDLER
2972#define DUK_USE_FATAL_MAXLEN 128
2973#define DUK_USE_FINALIZER_SUPPORT
2974#undef DUK_USE_FINALIZER_TORTURE
2975#undef DUK_USE_FUNCPTR16
2976#undef DUK_USE_FUNCPTR_DEC16
2977#undef DUK_USE_FUNCPTR_ENC16
2978#define DUK_USE_FUNCTION_BUILTIN
2979#define DUK_USE_FUNC_FILENAME_PROPERTY
2980#define DUK_USE_FUNC_NAME_PROPERTY
2981#undef DUK_USE_GC_TORTURE
2982#undef DUK_USE_GET_MONOTONIC_TIME
2983#undef DUK_USE_GET_RANDOM_DOUBLE
2984#define DUK_USE_GLOBAL_BINDING
2985#define DUK_USE_GLOBAL_BUILTIN
2986#undef DUK_USE_HEAPPTR16
2987#undef DUK_USE_HEAPPTR_DEC16
2988#undef DUK_USE_HEAPPTR_ENC16
2989#define DUK_USE_HEX_FASTPATH
2990#define DUK_USE_HEX_SUPPORT
2991#define DUK_USE_HOBJECT_ARRAY_ABANDON_LIMIT 2
2992#define DUK_USE_HOBJECT_ARRAY_ABANDON_MINSIZE 257
2993#define DUK_USE_HOBJECT_ARRAY_FAST_RESIZE_LIMIT 9
2994#define DUK_USE_HOBJECT_ARRAY_MINGROW_ADD 16
2995#define DUK_USE_HOBJECT_ARRAY_MINGROW_DIVISOR 8
2996#define DUK_USE_HOBJECT_ENTRY_MINGROW_ADD 16
2997#define DUK_USE_HOBJECT_ENTRY_MINGROW_DIVISOR 8
2998#define DUK_USE_HOBJECT_HASH_PART
2999#define DUK_USE_HOBJECT_HASH_PROP_LIMIT 8
3000#define DUK_USE_HSTRING_ARRIDX
3001#define DUK_USE_HSTRING_CLEN
3002#undef DUK_USE_HSTRING_EXTDATA
3003#define DUK_USE_HSTRING_LAZY_CLEN
3004#define DUK_USE_HTML_COMMENTS
3005#define DUK_USE_IDCHAR_FASTPATH
3006#undef DUK_USE_INJECT_HEAP_ALLOC_ERROR
3007#undef DUK_USE_INTERRUPT_COUNTER
3008#undef DUK_USE_INTERRUPT_DEBUG_FIXUP
3010#define DUK_USE_JSON_BUILTIN
3011#define DUK_USE_JSON_DECNUMBER_FASTPATH
3012#define DUK_USE_JSON_DECSTRING_FASTPATH
3013#define DUK_USE_JSON_DEC_RECLIMIT 1000
3014#define DUK_USE_JSON_EATWHITE_FASTPATH
3015#define DUK_USE_JSON_ENC_RECLIMIT 1000
3016#define DUK_USE_JSON_QUOTESTRING_FASTPATH
3017#undef DUK_USE_JSON_STRINGIFY_FASTPATH
3018#define DUK_USE_JSON_SUPPORT
3020#define DUK_USE_LEXER_SLIDING_WINDOW
3021#undef DUK_USE_LIGHTFUNC_BUILTINS
3022#define DUK_USE_LITCACHE_SIZE 256
3023#define DUK_USE_MARK_AND_SWEEP_RECLIMIT 256
3024#define DUK_USE_MATH_BUILTIN
3025#define DUK_USE_NATIVE_CALL_RECLIMIT 1000
3026#undef DUK_USE_NATIVE_STACK_CHECK
3027#define DUK_USE_NONSTD_ARRAY_SPLICE_DELCOUNT
3028#undef DUK_USE_NONSTD_FUNC_CALLER_PROPERTY
3029#undef DUK_USE_NONSTD_FUNC_SOURCE_PROPERTY
3030#define DUK_USE_NONSTD_FUNC_STMT
3031#define DUK_USE_NONSTD_GETTER_KEY_ARGUMENT
3032#define DUK_USE_NONSTD_JSON_ESC_U2028_U2029
3033#define DUK_USE_NONSTD_SETTER_KEY_ARGUMENT
3034#define DUK_USE_NONSTD_STRING_FROMCHARCODE_32BIT
3035#define DUK_USE_NUMBER_BUILTIN
3036#define DUK_USE_OBJECT_BUILTIN
3037#undef DUK_USE_OBJSIZES16
3038#undef DUK_USE_PARANOID_ERRORS
3039#define DUK_USE_PC2LINE
3040#define DUK_USE_PERFORMANCE_BUILTIN
3041#undef DUK_USE_PREFER_SIZE
3042#undef DUK_USE_PROMISE_BUILTIN
3043#define DUK_USE_PROVIDE_DEFAULT_ALLOC_FUNCTIONS
3044#undef DUK_USE_REFCOUNT16
3045#define DUK_USE_REFCOUNT32
3046#define DUK_USE_REFERENCE_COUNTING
3047#define DUK_USE_REFLECT_BUILTIN
3048#define DUK_USE_REGEXP_CANON_BITMAP
3049#undef DUK_USE_REGEXP_CANON_WORKAROUND
3050#define DUK_USE_REGEXP_COMPILER_RECLIMIT 10000
3051#define DUK_USE_REGEXP_EXECUTOR_RECLIMIT 10000
3052#define DUK_USE_REGEXP_SUPPORT
3053#undef DUK_USE_ROM_GLOBAL_CLONE
3054#undef DUK_USE_ROM_GLOBAL_INHERIT
3055#undef DUK_USE_ROM_OBJECTS
3056#define DUK_USE_ROM_PTRCOMP_FIRST 63488L
3057#undef DUK_USE_ROM_STRINGS
3058#define DUK_USE_SECTION_B
3059#undef DUK_USE_SELF_TESTS
3060#define DUK_USE_SHEBANG_COMMENTS
3061#undef DUK_USE_SHUFFLE_TORTURE
3062#define DUK_USE_SOURCE_NONBMP
3063#undef DUK_USE_STRHASH16
3064#undef DUK_USE_STRHASH_DENSE
3065#define DUK_USE_STRHASH_SKIP_SHIFT 5
3066#define DUK_USE_STRICT_DECL
3067#undef DUK_USE_STRICT_UTF8_SOURCE
3068#define DUK_USE_STRING_BUILTIN
3069#undef DUK_USE_STRLEN16
3070#define DUK_USE_STRTAB_GROW_LIMIT 17
3071#define DUK_USE_STRTAB_MAXSIZE 268435456L
3072#define DUK_USE_STRTAB_MINSIZE 1024
3073#undef DUK_USE_STRTAB_PTRCOMP
3074#define DUK_USE_STRTAB_RESIZE_CHECK_MASK 255
3075#define DUK_USE_STRTAB_SHRINK_LIMIT 6
3076#undef DUK_USE_STRTAB_TORTURE
3077#define DUK_USE_SYMBOL_BUILTIN
3078#define DUK_USE_TAILCALL
3079#define DUK_USE_TARGET_INFO "unknown"
3080#define DUK_USE_TRACEBACKS
3081#define DUK_USE_TRACEBACK_DEPTH 10
3082#define DUK_USE_VALSTACK_GROW_SHIFT 2
3083#define DUK_USE_VALSTACK_LIMIT 1000000L
3084#define DUK_USE_VALSTACK_SHRINK_CHECK_SHIFT 2
3085#define DUK_USE_VALSTACK_SHRINK_SLACK_SHIFT 4
3086#undef DUK_USE_VALSTACK_UNSAFE
3087#define DUK_USE_VERBOSE_ERRORS
3088#define DUK_USE_VERBOSE_EXECUTOR_ERRORS
3089#define DUK_USE_VOLUNTARY_GC
3090#define DUK_USE_ZERO_BUFFER_DATA
3110#if defined(DUK_F_CPP) && defined(DUK_USE_CPP_EXCEPTIONS)
3123#if defined(DUK_COMPILING_DUKTAPE)
3125#if defined(DUK_USE_DATE_GET_NOW)
3127#elif defined(DUK_USE_DATE_NOW_GETTIMEOFDAY)
3128#define DUK_USE_DATE_GET_NOW(ctx) duk_bi_date_get_now_gettimeofday()
3129#elif defined(DUK_USE_DATE_NOW_TIME)
3130#define DUK_USE_DATE_GET_NOW(ctx) duk_bi_date_get_now_time()
3131#elif defined(DUK_USE_DATE_NOW_WINDOWS)
3132#define DUK_USE_DATE_GET_NOW(ctx) duk_bi_date_get_now_windows()
3133#elif defined(DUK_USE_DATE_NOW_WINDOWS_SUBMS)
3134#define DUK_USE_DATE_GET_NOW(ctx) duk_bi_date_get_now_windows_subms()
3136#error no provider for DUK_USE_DATE_GET_NOW()
3139#if defined(DUK_USE_DATE_GET_LOCAL_TZOFFSET)
3141#elif defined(DUK_USE_DATE_TZO_GMTIME_R) || defined(DUK_USE_DATE_TZO_GMTIME_S) || defined(DUK_USE_DATE_TZO_GMTIME)
3142#define DUK_USE_DATE_GET_LOCAL_TZOFFSET(d) duk_bi_date_get_local_tzoffset_gmtime((d))
3143#elif defined(DUK_USE_DATE_TZO_WINDOWS)
3144#define DUK_USE_DATE_GET_LOCAL_TZOFFSET(d) duk_bi_date_get_local_tzoffset_windows((d))
3145#elif defined(DUK_USE_DATE_TZO_WINDOWS_NO_DST)
3146#define DUK_USE_DATE_GET_LOCAL_TZOFFSET(d) duk_bi_date_get_local_tzoffset_windows_no_dst((d))
3148#error no provider for DUK_USE_DATE_GET_LOCAL_TZOFFSET()
3151#if defined(DUK_USE_DATE_PARSE_STRING)
3153#elif defined(DUK_USE_DATE_PRS_STRPTIME)
3154#define DUK_USE_DATE_PARSE_STRING(ctx,str) duk_bi_date_parse_string_strptime((ctx), (str))
3155#elif defined(DUK_USE_DATE_PRS_GETDATE)
3156#define DUK_USE_DATE_PARSE_STRING(ctx,str) duk_bi_date_parse_string_getdate((ctx), (str))
3161#if defined(DUK_USE_DATE_FORMAT_STRING)
3163#elif defined(DUK_USE_DATE_FMT_STRFTIME)
3164#define DUK_USE_DATE_FORMAT_STRING(ctx,parts,tzoffset,flags) \
3165 duk_bi_date_format_parts_strftime((ctx), (parts), (tzoffset), (flags))
3170#if defined(DUK_USE_GET_MONOTONIC_TIME)
3172#elif defined(DUK_USE_GET_MONOTONIC_TIME_CLOCK_GETTIME)
3173#define DUK_USE_GET_MONOTONIC_TIME(ctx) duk_bi_date_get_monotonic_time_clock_gettime()
3174#elif defined(DUK_USE_GET_MONOTONIC_TIME_WINDOWS_QPC)
3175#define DUK_USE_GET_MONOTONIC_TIME(ctx) duk_bi_date_get_monotonic_time_windows_qpc()
3187#if defined(DUK_USE_BYTEORDER)
3188#if (DUK_USE_BYTEORDER == 1)
3189#define DUK_USE_INTEGER_LE
3190#define DUK_USE_DOUBLE_LE
3191#elif (DUK_USE_BYTEORDER == 2)
3192#define DUK_USE_INTEGER_LE
3193#define DUK_USE_DOUBLE_ME
3194#elif (DUK_USE_BYTEORDER == 3)
3195#define DUK_USE_INTEGER_BE
3196#define DUK_USE_DOUBLE_BE
3198#error unsupported: byte order invalid
3201#error unsupported: byte order detection failed
duk_uint16_t duk_uint_least16_t
duk_int32_t duk_int_fast32_t
unsigned int duk_small_uint_t
duk_uint32_t duk_uint_least32_t
duk_uint_t duk_ucodepoint_t
duk_uint_fast32_t duk_uint_fast_t
duk_small_int_t duk_ret_t
duk_int_fast32_t duk_int_fast_t
duk_int8_t duk_int_least8_t
duk_small_uint_t duk_bool_t
duk_uint_fast16_t duk_small_uint_fast_t
duk_uint8_t duk_uint_fast8_t
duk_int_t duk_codepoint_t
duk_int_fast32_t duk_int_t
duk_int8_t duk_int_fast8_t
duk_int_fast16_t duk_small_int_fast_t
duk_int32_t duk_int_least32_t
duk_int16_t duk_int_fast16_t
duk_uint8_t duk_uint_least8_t
duk_uint_fast32_t duk_uint_t
duk_int16_t duk_int_least16_t
duk_uint32_t duk_uintmax_t
duk_uint32_t duk_uint_fast32_t
duk_uint16_t duk_uint_fast16_t
Custom configuration for duktape.
Netsurf additional integer type formatting macros.
Interface to utility string handling.
Interface to time operations.