comparison duktape/duk_config.h @ 14:9acbab647d05

duktape: upgrade to 1.5.0
author David Demelier <markand@malikania.fr>
date Sun, 08 May 2016 10:52:04 +0200
parents 543b0653ea27
children 12bf6de5b67a
comparison
equal deleted inserted replaced
13:4a6be381e420 14:9acbab647d05
1 /* 1 /*
2 * duk_config.h configuration header generated by genconfig.py. 2 * duk_config.h configuration header generated by genconfig.py.
3 * 3 *
4 * Git commit: cad6f595382a0cc1a7e4207794ade5be11b3e397 4 * Git commit: 83d557704ee63f68ab40b6fcb00995c9b3d6777c
5 * Git describe: v1.4.0 5 * Git describe: v1.5.0
6 * Git branch: master 6 * Git branch: master
7 * 7 *
8 * Supported platforms: 8 * Supported platforms:
9 * - Mac OSX, iPhone, Darwin 9 * - Mac OSX, iPhone, Darwin
10 * - OpenBSD 10 * - OpenBSD
332 /* VBCC */ 332 /* VBCC */
333 #if defined(__VBCC__) 333 #if defined(__VBCC__)
334 #define DUK_F_VBCC 334 #define DUK_F_VBCC
335 #endif 335 #endif
336 336
337 /* Atari Mint */
338 #if defined(__MINT__)
339 #define DUK_F_MINT
340 #endif
341
337 /* 342 /*
338 * Platform autodetection 343 * Platform autodetection
339 */ 344 */
340 345
341 /* Workaround for older C++ compilers before including <inttypes.h>, 346 /* Workaround for older C++ compilers before including <inttypes.h>,
364 #if TARGET_IPHONE_SIMULATOR 369 #if TARGET_IPHONE_SIMULATOR
365 #define DUK_USE_OS_STRING "iphone-sim" 370 #define DUK_USE_OS_STRING "iphone-sim"
366 #elif TARGET_OS_IPHONE 371 #elif TARGET_OS_IPHONE
367 #define DUK_USE_OS_STRING "iphone" 372 #define DUK_USE_OS_STRING "iphone"
368 #elif TARGET_OS_MAC 373 #elif TARGET_OS_MAC
369 #define DUK_USE_OS_STRING "ios" 374 #define DUK_USE_OS_STRING "osx"
370 #else 375 #else
371 #define DUK_USE_OS_STRING "ios-unknown" 376 #define DUK_USE_OS_STRING "osx-unknown"
372 #endif 377 #endif
373 378
374 /* Use _setjmp() on Apple by default, see GH-55. */ 379 /* Use _setjmp() on Apple by default, see GH-55. */
375 #define DUK_USE_UNDERSCORE_SETJMP 380 #define DUK_JMPBUF_TYPE jmp_buf
376 #define DUK_SETJMP(jb) _setjmp((jb)) 381 #define DUK_SETJMP(jb) _setjmp((jb))
377 #define DUK_LONGJMP(jb) _longjmp((jb), 1) 382 #define DUK_LONGJMP(jb) _longjmp((jb), 1)
378 #elif defined(DUK_F_OPENBSD) 383 #elif defined(DUK_F_OPENBSD)
379 /* --- OpenBSD --- */ 384 /* --- OpenBSD --- */
380 /* http://www.monkey.org/openbsd/archive/ports/0401/msg00089.html */ 385 /* http://www.monkey.org/openbsd/archive/ports/0401/msg00089.html */
622 #include <endian.h> 627 #include <endian.h>
623 #include <sys/param.h> 628 #include <sys/param.h>
624 #include <sys/time.h> 629 #include <sys/time.h>
625 #include <time.h> 630 #include <time.h>
626 631
627 #define DUK_USE_UNDERSCORE_SETJMP 632 #define DUK_JMPBUF_TYPE jmp_buf
628 #define DUK_SETJMP(jb) _setjmp((jb)) 633 #define DUK_SETJMP(jb) _setjmp((jb))
629 #define DUK_LONGJMP(jb) _longjmp((jb), 1) 634 #define DUK_LONGJMP(jb) _longjmp((jb), 1)
630 635
631 #define DUK_USE_OS_STRING "windows" 636 #define DUK_USE_OS_STRING "windows"
632 #elif defined(DUK_F_UNIX) 637 #elif defined(DUK_F_UNIX)
907 #define DUK_INTERNAL_DECL extern 912 #define DUK_INTERNAL_DECL extern
908 #define DUK_INTERNAL /*empty*/ 913 #define DUK_INTERNAL /*empty*/
909 #endif 914 #endif
910 #define DUK_LOCAL_DECL static 915 #define DUK_LOCAL_DECL static
911 #define DUK_LOCAL static 916 #define DUK_LOCAL static
912
913 #else 917 #else
914 #define DUK_EXTERNAL_DECL __attribute__ ((visibility("default"))) extern 918 #define DUK_EXTERNAL_DECL __attribute__ ((visibility("default"))) extern
915 #define DUK_EXTERNAL __attribute__ ((visibility("default"))) 919 #define DUK_EXTERNAL __attribute__ ((visibility("default")))
916 #if defined(DUK_SINGLE_FILE) 920 #if defined(DUK_SINGLE_FILE)
917 #define DUK_INTERNAL_DECL static 921 #define DUK_INTERNAL_DECL static
933 #undef DUK_USE_VARIADIC_MACROS 937 #undef DUK_USE_VARIADIC_MACROS
934 #if defined(DUK_F_C99) || defined(DUK_F_CPP11) 938 #if defined(DUK_F_C99) || defined(DUK_F_CPP11)
935 #define DUK_USE_VARIADIC_MACROS 939 #define DUK_USE_VARIADIC_MACROS
936 #endif 940 #endif
937 941
942 #define DUK_USE_UNION_INITIALIZERS
943
938 #undef DUK_USE_FLEX_C99 944 #undef DUK_USE_FLEX_C99
939 #undef DUK_USE_FLEX_ZEROSIZE 945 #undef DUK_USE_FLEX_ZEROSIZE
940 #undef DUK_USE_FLEX_ONESIZE 946 #undef DUK_USE_FLEX_ONESIZE
941 #if defined(DUK_F_C99) 947 #if defined(DUK_F_C99)
942 #define DUK_USE_FLEX_C99 948 #define DUK_USE_FLEX_C99
944 #define DUK_USE_FLEX_ZEROSIZE 950 #define DUK_USE_FLEX_ZEROSIZE
945 #endif 951 #endif
946 952
947 #undef DUK_USE_GCC_PRAGMAS 953 #undef DUK_USE_GCC_PRAGMAS
948 #define DUK_USE_PACK_CLANG_ATTR 954 #define DUK_USE_PACK_CLANG_ATTR
949 #define DUK_F_VARIADIC_MACROS_PROVIDED
950 #elif defined(DUK_F_GCC) 955 #elif defined(DUK_F_GCC)
951 /* --- GCC --- */ 956 /* --- GCC --- */
952 #if defined(DUK_F_C99) || defined(DUK_F_CPP11) 957 #if defined(DUK_F_C99) || defined(DUK_F_CPP11)
953 /* C99 / C++11 and above: rely on va_copy() which is required. */ 958 /* C99 / C++11 and above: rely on va_copy() which is required. */
954 #define DUK_VA_COPY(dest,src) va_copy(dest,src) 959 #define DUK_VA_COPY(dest,src) va_copy(dest,src)
1001 #define DUK_INTERNAL_DECL extern 1006 #define DUK_INTERNAL_DECL extern
1002 #define DUK_INTERNAL /*empty*/ 1007 #define DUK_INTERNAL /*empty*/
1003 #endif 1008 #endif
1004 #define DUK_LOCAL_DECL static 1009 #define DUK_LOCAL_DECL static
1005 #define DUK_LOCAL static 1010 #define DUK_LOCAL static
1006
1007 #elif defined(DUK_F_GCC_VERSION) && (DUK_F_GCC_VERSION >= 40000) 1011 #elif defined(DUK_F_GCC_VERSION) && (DUK_F_GCC_VERSION >= 40000)
1008 #define DUK_EXTERNAL_DECL __attribute__ ((visibility("default"))) extern 1012 #define DUK_EXTERNAL_DECL __attribute__ ((visibility("default"))) extern
1009 #define DUK_EXTERNAL __attribute__ ((visibility("default"))) 1013 #define DUK_EXTERNAL __attribute__ ((visibility("default")))
1010 #if defined(DUK_SINGLE_FILE) 1014 #if defined(DUK_SINGLE_FILE)
1011 #define DUK_INTERNAL_DECL static 1015 #define DUK_INTERNAL_DECL static
1035 #undef DUK_USE_VARIADIC_MACROS 1039 #undef DUK_USE_VARIADIC_MACROS
1036 #if defined(DUK_F_C99) || (defined(DUK_F_CPP11) && defined(__GNUC__)) 1040 #if defined(DUK_F_C99) || (defined(DUK_F_CPP11) && defined(__GNUC__))
1037 #define DUK_USE_VARIADIC_MACROS 1041 #define DUK_USE_VARIADIC_MACROS
1038 #endif 1042 #endif
1039 1043
1044 #define DUK_USE_UNION_INITIALIZERS
1045
1040 #undef DUK_USE_FLEX_C99 1046 #undef DUK_USE_FLEX_C99
1041 #undef DUK_USE_FLEX_ZEROSIZE 1047 #undef DUK_USE_FLEX_ZEROSIZE
1042 #undef DUK_USE_FLEX_ONESIZE 1048 #undef DUK_USE_FLEX_ONESIZE
1043 #if defined(DUK_F_C99) 1049 #if defined(DUK_F_C99)
1044 #define DUK_USE_FLEX_C99 1050 #define DUK_USE_FLEX_C99
1051 #else 1057 #else
1052 #undef DUK_USE_GCC_PRAGMAS 1058 #undef DUK_USE_GCC_PRAGMAS
1053 #endif 1059 #endif
1054 1060
1055 #define DUK_USE_PACK_GCC_ATTR 1061 #define DUK_USE_PACK_GCC_ATTR
1056 #define DUK_F_VARIADIC_MACROS_PROVIDED
1057 #elif defined(DUK_F_MSVC) 1062 #elif defined(DUK_F_MSVC)
1058 /* --- MSVC --- */ 1063 /* --- MSVC --- */
1059 /* http://msdn.microsoft.com/en-us/library/aa235362(VS.60).aspx */ 1064 /* http://msdn.microsoft.com/en-us/library/aa235362(VS.60).aspx */
1060 #define DUK_NORETURN(decl) __declspec(noreturn) decl 1065 #define DUK_NORETURN(decl) __declspec(noreturn) decl
1061 1066
1084 #define DUK_INTERNAL_DECL extern 1089 #define DUK_INTERNAL_DECL extern
1085 #define DUK_INTERNAL /*empty*/ 1090 #define DUK_INTERNAL /*empty*/
1086 #endif 1091 #endif
1087 #define DUK_LOCAL_DECL static 1092 #define DUK_LOCAL_DECL static
1088 #define DUK_LOCAL static 1093 #define DUK_LOCAL static
1089
1090 #endif 1094 #endif
1091 1095
1092 #if defined(DUK_F_CPP) 1096 #if defined(DUK_F_CPP)
1093 #define DUK_USE_COMPILER_STRING "msvc++" 1097 #define DUK_USE_COMPILER_STRING "msvc++"
1094 #else 1098 #else
1101 #elif defined(_MSC_VER) && (_MSC_VER >= 1400) 1105 #elif defined(_MSC_VER) && (_MSC_VER >= 1400)
1102 /* VS2005+ should have variadic macros even when they're not C99. */ 1106 /* VS2005+ should have variadic macros even when they're not C99. */
1103 #define DUK_USE_VARIADIC_MACROS 1107 #define DUK_USE_VARIADIC_MACROS
1104 #endif 1108 #endif
1105 1109
1110 #undef DUK_USE_UNION_INITIALIZERS
1111 #if defined(_MSC_VER) && (_MSC_VER >= 1800)
1112 /* VS2013+ supports union initializers but there's a bug involving union-inside-struct:
1113 * https://connect.microsoft.com/VisualStudio/feedback/details/805981
1114 * The bug was fixed (at least) in VS2015 so check for VS2015 for now:
1115 * https://blogs.msdn.microsoft.com/vcblog/2015/07/01/c-compiler-front-end-fixes-in-vs2015/
1116 * Manually tested using VS2013, CL reports 18.00.31101, so enable for VS2013 too.
1117 */
1118 #define DUK_USE_UNION_INITIALIZERS
1119 #endif
1120
1106 #undef DUK_USE_FLEX_C99 1121 #undef DUK_USE_FLEX_C99
1107 #undef DUK_USE_FLEX_ZEROSIZE 1122 #undef DUK_USE_FLEX_ZEROSIZE
1108 #undef DUK_USE_FLEX_ONESIZE 1123 #undef DUK_USE_FLEX_ONESIZE
1109 #if defined(DUK_F_C99) 1124 #if defined(DUK_F_C99)
1110 #define DUK_USE_FLEX_C99 1125 #define DUK_USE_FLEX_C99
1114 1129
1115 #undef DUK_USE_GCC_PRAGMAS 1130 #undef DUK_USE_GCC_PRAGMAS
1116 1131
1117 #define DUK_USE_PACK_MSVC_PRAGMA 1132 #define DUK_USE_PACK_MSVC_PRAGMA
1118 1133
1134 /* These have been tested from VS2008 onwards; may work in older VS versions
1135 * too but not enabled by default.
1136 */
1137 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
1138 #define DUK_NOINLINE __declspec(noinline)
1139 #define DUK_INLINE __inline
1140 #define DUK_ALWAYS_INLINE __forceinline
1141 #endif
1142
1119 #if defined(_MSC_VER) && (_MSC_VER >= 1900) 1143 #if defined(_MSC_VER) && (_MSC_VER >= 1900)
1120 #define DUK_SNPRINTF snprintf 1144 #define DUK_SNPRINTF snprintf
1121 #define DUK_VSNPRINTF vsnprintf 1145 #define DUK_VSNPRINTF vsnprintf
1122 #else 1146 #else
1123 /* (v)snprintf() is missing before MSVC 2015. Note that _(v)snprintf() does 1147 /* (v)snprintf() is missing before MSVC 2015. Note that _(v)snprintf() does
1125 * http://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010 1149 * http://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010
1126 */ 1150 */
1127 #define DUK_SNPRINTF _snprintf 1151 #define DUK_SNPRINTF _snprintf
1128 #define DUK_VSNPRINTF _vsnprintf 1152 #define DUK_VSNPRINTF _vsnprintf
1129 #endif 1153 #endif
1130 #define DUK_F_VARIADIC_MACROS_PROVIDED
1131 #elif defined(DUK_F_EMSCRIPTEN) 1154 #elif defined(DUK_F_EMSCRIPTEN)
1132 /* --- Emscripten --- */ 1155 /* --- Emscripten --- */
1133 #define DUK_NORETURN(decl) decl __attribute__((noreturn)) 1156 #define DUK_NORETURN(decl) decl __attribute__((noreturn))
1134 1157
1135 #if defined(__clang__) && defined(__has_builtin) 1158 #if defined(__clang__) && defined(__has_builtin)
1165 #undef DUK_USE_VARIADIC_MACROS 1188 #undef DUK_USE_VARIADIC_MACROS
1166 #if defined(DUK_F_C99) || defined(DUK_F_CPP11) 1189 #if defined(DUK_F_C99) || defined(DUK_F_CPP11)
1167 #define DUK_USE_VARIADIC_MACROS 1190 #define DUK_USE_VARIADIC_MACROS
1168 #endif 1191 #endif
1169 1192
1193 #define DUK_USE_UNION_INITIALIZERS
1194
1170 #undef DUK_USE_FLEX_C99 1195 #undef DUK_USE_FLEX_C99
1171 #undef DUK_USE_FLEX_ZEROSIZE 1196 #undef DUK_USE_FLEX_ZEROSIZE
1172 #undef DUK_USE_FLEX_ONESIZE 1197 #undef DUK_USE_FLEX_ONESIZE
1173 #if defined(DUK_F_C99) 1198 #if defined(DUK_F_C99)
1174 #define DUK_USE_FLEX_C99 1199 #define DUK_USE_FLEX_C99
1176 #define DUK_USE_FLEX_ZEROSIZE 1201 #define DUK_USE_FLEX_ZEROSIZE
1177 #endif 1202 #endif
1178 1203
1179 #undef DUK_USE_GCC_PRAGMAS 1204 #undef DUK_USE_GCC_PRAGMAS
1180 #define DUK_USE_PACK_CLANG_ATTR 1205 #define DUK_USE_PACK_CLANG_ATTR
1181 #define DUK_F_VARIADIC_MACROS_PROVIDED
1182 #elif defined(DUK_F_TINYC) 1206 #elif defined(DUK_F_TINYC)
1183 /* --- TinyC --- */ 1207 /* --- TinyC --- */
1184 #undef DUK_USE_BRANCH_HINTS 1208 #undef DUK_USE_BRANCH_HINTS
1185 1209
1186 #if defined(DUK_F_CPP) 1210 #if defined(DUK_F_CPP)
1190 #endif 1214 #endif
1191 1215
1192 /* http://bellard.org/tcc/tcc-doc.html#SEC7 */ 1216 /* http://bellard.org/tcc/tcc-doc.html#SEC7 */
1193 #define DUK_USE_VARIADIC_MACROS 1217 #define DUK_USE_VARIADIC_MACROS
1194 1218
1219 #define DUK_USE_UNION_INITIALIZERS
1220
1195 /* Most portable, wastes space */ 1221 /* Most portable, wastes space */
1196 #define DUK_USE_FLEX_ONESIZE 1222 #define DUK_USE_FLEX_ONESIZE
1197 1223
1198 /* Most portable, potentially wastes space */ 1224 /* Most portable, potentially wastes space */
1199 #define DUK_USE_PACK_DUMMY_MEMBER 1225 #define DUK_USE_PACK_DUMMY_MEMBER
1200 #define DUK_F_VARIADIC_MACROS_PROVIDED
1201 #elif defined(DUK_F_VBCC) 1226 #elif defined(DUK_F_VBCC)
1202 /* --- VBCC --- */ 1227 /* --- VBCC --- */
1203 #undef DUK_USE_BRANCH_HINTS 1228 #undef DUK_USE_BRANCH_HINTS
1204 1229
1205 #if defined(DUK_F_CPP) 1230 #if defined(DUK_F_CPP)
1211 #undef DUK_USE_VARIADIC_MACROS 1236 #undef DUK_USE_VARIADIC_MACROS
1212 #if defined(DUK_F_C99) || defined(DUK_F_CPP11) 1237 #if defined(DUK_F_C99) || defined(DUK_F_CPP11)
1213 #define DUK_USE_VARIADIC_MACROS 1238 #define DUK_USE_VARIADIC_MACROS
1214 #endif 1239 #endif
1215 1240
1241 /* VBCC supports C99 so check only for C99 for union initializer support.
1242 * Designated union initializers would possibly work even without a C99 check.
1243 */
1244 #undef DUK_USE_UNION_INITIALIZERS
1245 #if defined(DUK_F_C99)
1246 #define DUK_USE_UNION_INITIALIZERS
1247 #endif
1248
1216 #define DUK_USE_FLEX_ZEROSIZE 1249 #define DUK_USE_FLEX_ZEROSIZE
1217 #define DUK_USE_PACK_DUMMY_MEMBER 1250 #define DUK_USE_PACK_DUMMY_MEMBER
1218 #define DUK_F_VARIADIC_MACROS_PROVIDED
1219 #elif defined(DUK_F_BCC) 1251 #elif defined(DUK_F_BCC)
1220 /* --- Bruce's C compiler --- */ 1252 /* --- Bruce's C compiler --- */
1221 #undef DUK_USE_BRANCH_HINTS 1253 #undef DUK_USE_BRANCH_HINTS
1222 1254
1223 #if defined(DUK_F_CPP) 1255 #if defined(DUK_F_CPP)
1224 #define DUK_USE_COMPILER_STRING "bcc++" 1256 #define DUK_USE_COMPILER_STRING "bcc++"
1225 #else 1257 #else
1226 #define DUK_USE_COMPILER_STRING "bcc" 1258 #define DUK_USE_COMPILER_STRING "bcc"
1227 #endif 1259 #endif
1228 1260
1229 /* XXX */ 1261 /* Most portable */
1230 #undef DUK_USE_VARIADIC_MACROS 1262 #undef DUK_USE_VARIADIC_MACROS
1263
1264 /* Most portable, wastes space */
1265 #undef DUK_USE_UNION_INITIALIZERS
1231 1266
1232 /* Most portable, wastes space */ 1267 /* Most portable, wastes space */
1233 #define DUK_USE_FLEX_ONESIZE 1268 #define DUK_USE_FLEX_ONESIZE
1234 1269
1235 /* Most portable, potentially wastes space */ 1270 /* Most portable, potentially wastes space */
1237 1272
1238 /* BCC, assume we're on x86. */ 1273 /* BCC, assume we're on x86. */
1239 #if !defined(DUK_USE_BYTEORDER) 1274 #if !defined(DUK_USE_BYTEORDER)
1240 #define DUK_USE_BYTEORDER 1 1275 #define DUK_USE_BYTEORDER 1
1241 #endif 1276 #endif
1242 #define DUK_F_VARIADIC_MACROS_PROVIDED
1243 #else 1277 #else
1244 /* --- Generic --- */ 1278 /* --- Generic --- */
1245 #undef DUK_USE_BRANCH_HINTS 1279 #undef DUK_USE_BRANCH_HINTS
1246 1280
1247 #if defined(DUK_F_CPP) 1281 #if defined(DUK_F_CPP)
1253 #undef DUK_USE_VARIADIC_MACROS 1287 #undef DUK_USE_VARIADIC_MACROS
1254 #if defined(DUK_F_C99) || defined(DUK_F_CPP11) 1288 #if defined(DUK_F_C99) || defined(DUK_F_CPP11)
1255 #define DUK_USE_VARIADIC_MACROS 1289 #define DUK_USE_VARIADIC_MACROS
1256 #endif 1290 #endif
1257 1291
1292 /* C++ doesn't have standard designated union initializers ({ .foo = 1 }). */
1293 #undef DUK_USE_UNION_INITIALIZERS
1294 #if defined(DUK_F_C99)
1295 #define DUK_USE_UNION_INITIALIZERS
1296 #endif
1297
1258 /* Most portable, wastes space */ 1298 /* Most portable, wastes space */
1259 #define DUK_USE_FLEX_ONESIZE 1299 #define DUK_USE_FLEX_ONESIZE
1260 1300
1261 /* Most portable, potentially wastes space */ 1301 /* Most portable, potentially wastes space */
1262 #define DUK_USE_PACK_DUMMY_MEMBER 1302 #define DUK_USE_PACK_DUMMY_MEMBER
1263 #define DUK_F_VARIADIC_MACROS_PROVIDED
1264 #endif /* autodetect compiler */ 1303 #endif /* autodetect compiler */
1265 1304
1266 /* uclibc */ 1305 /* uclibc */
1267 #if defined(__UCLIBC__) 1306 #if defined(__UCLIBC__)
1268 #define DUK_F_UCLIBC 1307 #define DUK_F_UCLIBC
1827 /* 1866 /*
1828 * Fill-ins for platform, architecture, and compiler 1867 * Fill-ins for platform, architecture, and compiler
1829 */ 1868 */
1830 1869
1831 #if !defined(DUK_SETJMP) 1870 #if !defined(DUK_SETJMP)
1832 #define DUK_USE_SETJMP 1871 #define DUK_JMPBUF_TYPE jmp_buf
1833 #define DUK_SETJMP(jb) setjmp((jb)) 1872 #define DUK_SETJMP(jb) setjmp((jb))
1834 #define DUK_LONGJMP(jb) longjmp((jb), 1) 1873 #define DUK_LONGJMP(jb) longjmp((jb), 1)
1874 #endif
1875
1876 #if 0
1877 /* sigsetjmp() alternative */
1878 #define DUK_JMPBUF_TYPE sigjmp_buf
1879 #define DUK_SETJMP(jb) sigsetjmp((jb))
1880 #define DUK_LONGJMP(jb) siglongjmp((jb), 1)
1835 #endif 1881 #endif
1836 1882
1837 typedef FILE duk_file; 1883 typedef FILE duk_file;
1838 #if !defined(DUK_STDIN) 1884 #if !defined(DUK_STDIN)
1839 #define DUK_STDIN stdin 1885 #define DUK_STDIN stdin
2089 #undef DUK_USE_MATH_ROUND 2135 #undef DUK_USE_MATH_ROUND
2090 #if defined(DUK_F_UCLIBC) 2136 #if defined(DUK_F_UCLIBC)
2091 /* uclibc may be missing these */ 2137 /* uclibc may be missing these */
2092 #elif defined(DUK_F_AMIGAOS) && defined(DUK_F_VBCC) 2138 #elif defined(DUK_F_AMIGAOS) && defined(DUK_F_VBCC)
2093 /* vbcc + AmigaOS may be missing these */ 2139 /* vbcc + AmigaOS may be missing these */
2140 #elif defined(DUK_F_MINT)
2141 /* mint clib is missing these */
2094 #elif !defined(DUK_F_C99) && !defined(DUK_F_CPP11) 2142 #elif !defined(DUK_F_C99) && !defined(DUK_F_CPP11)
2095 /* build is not C99 or C++11, play it safe */ 2143 /* build is not C99 or C++11, play it safe */
2096 #else 2144 #else
2097 /* C99 or C++11, no known issues */ 2145 /* C99 or C++11, no known issues */
2098 #define DUK_USE_MATH_FMIN 2146 #define DUK_USE_MATH_FMIN
2483 #define DUK_BSWAP16(x) \ 2531 #define DUK_BSWAP16(x) \
2484 ((duk_uint16_t) (x) >> 8) | \ 2532 ((duk_uint16_t) (x) >> 8) | \
2485 ((duk_uint16_t) (x) << 8) 2533 ((duk_uint16_t) (x) << 8)
2486 #endif 2534 #endif
2487 2535
2488 /* Explicit marker needed; may be 'defined', 'undefined, 'or 'not provided'. */ 2536 /* DUK_USE_VARIADIC_MACROS: required from compilers, so no fill-in. */
2489 #if !defined(DUK_F_VARIADIC_MACROS_PROVIDED) 2537 /* DUK_USE_UNION_INITIALIZERS: required from compilers, so no fill-in. */
2490 #undef DUK_USE_VARIADIC_MACROS
2491 #if defined(DUK_F_C99) || defined(DUK_F_CPP11)
2492 #define DUK_USE_VARIADIC_MACROS
2493 #endif
2494 #endif
2495 2538
2496 #if !(defined(DUK_USE_FLEX_C99) || defined(DUK_USE_FLEX_ZEROSIZE) || defined(DUK_USE_FLEX_ONESIZE)) 2539 #if !(defined(DUK_USE_FLEX_C99) || defined(DUK_USE_FLEX_ZEROSIZE) || defined(DUK_USE_FLEX_ONESIZE))
2497 #if defined(DUK_F_C99) 2540 #if defined(DUK_F_C99)
2498 #define DUK_USE_FLEX_C99 2541 #define DUK_USE_FLEX_C99
2499 #else 2542 #else
2749 #undef DUK_USE_DEBUGGER_FWD_PRINTALERT 2792 #undef DUK_USE_DEBUGGER_FWD_PRINTALERT
2750 #else 2793 #else
2751 #undef DUK_USE_DEBUGGER_FWD_PRINTALERT 2794 #undef DUK_USE_DEBUGGER_FWD_PRINTALERT
2752 #endif 2795 #endif
2753 2796
2797 #if defined(DUK_OPT_DEBUGGER_INSPECT)
2798 #define DUK_USE_DEBUGGER_INSPECT
2799 #elif defined(DUK_OPT_NO_DEBUGGER_INSPECT)
2800 #undef DUK_USE_DEBUGGER_INSPECT
2801 #else
2802 #undef DUK_USE_DEBUGGER_INSPECT
2803 #endif
2804
2754 #if defined(DUK_OPT_DEBUGGER_PAUSE_UNCAUGHT) 2805 #if defined(DUK_OPT_DEBUGGER_PAUSE_UNCAUGHT)
2755 #define DUK_USE_DEBUGGER_PAUSE_UNCAUGHT 2806 #define DUK_USE_DEBUGGER_PAUSE_UNCAUGHT
2756 #elif defined(DUK_OPT_NO_DEBUGGER_PAUSE_UNCAUGHT) 2807 #elif defined(DUK_OPT_NO_DEBUGGER_PAUSE_UNCAUGHT)
2757 #undef DUK_USE_DEBUGGER_PAUSE_UNCAUGHT 2808 #undef DUK_USE_DEBUGGER_PAUSE_UNCAUGHT
2758 #else 2809 #else
2857 #define DUK_USE_ES6_PROXY 2908 #define DUK_USE_ES6_PROXY
2858 #elif defined(DUK_OPT_NO_ES6_PROXY) 2909 #elif defined(DUK_OPT_NO_ES6_PROXY)
2859 #undef DUK_USE_ES6_PROXY 2910 #undef DUK_USE_ES6_PROXY
2860 #else 2911 #else
2861 #define DUK_USE_ES6_PROXY 2912 #define DUK_USE_ES6_PROXY
2913 #endif
2914
2915 #if defined(DUK_OPT_ES6_REGEXP_BRACES)
2916 #define DUK_USE_ES6_REGEXP_BRACES
2917 #elif defined(DUK_OPT_NO_ES6_REGEXP_BRACES)
2918 #undef DUK_USE_ES6_REGEXP_BRACES
2919 #else
2920 #define DUK_USE_ES6_REGEXP_BRACES
2862 #endif 2921 #endif
2863 2922
2864 #undef DUK_USE_EXEC_INDIRECT_BOUND_CHECK 2923 #undef DUK_USE_EXEC_INDIRECT_BOUND_CHECK
2865 #if defined(DUK_OPT_DEBUG) || defined(DUK_OPT_ASSERTIONS) 2924 #if defined(DUK_OPT_DEBUG) || defined(DUK_OPT_ASSERTIONS)
2866 /* Enabled with debug/assertions just so that any issues can be caught. */ 2925 /* Enabled with debug/assertions just so that any issues can be caught. */
2951 #define DUK_USE_HOBJECT_HASH_PART 3010 #define DUK_USE_HOBJECT_HASH_PART
2952 #if defined(DUK_OPT_OBJSIZES16) 3011 #if defined(DUK_OPT_OBJSIZES16)
2953 #undef DUK_USE_HOBJECT_HASH_PART 3012 #undef DUK_USE_HOBJECT_HASH_PART
2954 #endif 3013 #endif
2955 3014
3015 #if defined(DUK_OPT_HSTRING_CLEN)
3016 #define DUK_USE_HSTRING_CLEN
3017 #elif defined(DUK_OPT_NO_HSTRING_CLEN)
3018 #undef DUK_USE_HSTRING_CLEN
3019 #else
3020 #define DUK_USE_HSTRING_CLEN
3021 #endif
3022
2956 #if defined(DUK_OPT_EXTERNAL_STRINGS) 3023 #if defined(DUK_OPT_EXTERNAL_STRINGS)
2957 #define DUK_USE_HSTRING_EXTDATA 3024 #define DUK_USE_HSTRING_EXTDATA
2958 #elif defined(DUK_OPT_NO_EXTERNAL_STRINGS) 3025 #elif defined(DUK_OPT_NO_EXTERNAL_STRINGS)
2959 #undef DUK_USE_HSTRING_EXTDATA 3026 #undef DUK_USE_HSTRING_EXTDATA
2960 #else 3027 #else
3124 #if defined(DUK_OPT_PACKED_TVAL) 3191 #if defined(DUK_OPT_PACKED_TVAL)
3125 #define DUK_USE_PACKED_TVAL 3192 #define DUK_USE_PACKED_TVAL
3126 #elif defined(DUK_OPT_NO_PACKED_TVAL) 3193 #elif defined(DUK_OPT_NO_PACKED_TVAL)
3127 #undef DUK_USE_PACKED_TVAL 3194 #undef DUK_USE_PACKED_TVAL
3128 #else 3195 #else
3129 #undef DUK_USE_PACKED_TVAL 3196 /* Already provided above */
3130 #endif 3197 #endif
3131 3198
3132 #undef DUK_USE_PANIC_ABORT 3199 #undef DUK_USE_PANIC_ABORT
3133 #if !defined(DUK_OPT_SEGFAULT_ON_PANIC) 3200 #if !defined(DUK_OPT_SEGFAULT_ON_PANIC)
3134 #define DUK_USE_PANIC_ABORT 3201 #define DUK_USE_PANIC_ABORT
3190 #undef DUK_USE_REGEXP_SUPPORT 3257 #undef DUK_USE_REGEXP_SUPPORT
3191 #else 3258 #else
3192 #define DUK_USE_REGEXP_SUPPORT 3259 #define DUK_USE_REGEXP_SUPPORT
3193 #endif 3260 #endif
3194 3261
3262 #if defined(DUK_OPT_ROM_GLOBAL_CLONE)
3263 #define DUK_USE_ROM_GLOBAL_CLONE
3264 #elif defined(DUK_OPT_NO_ROM_GLOBAL_CLONE)
3265 #undef DUK_USE_ROM_GLOBAL_CLONE
3266 #else
3267 #undef DUK_USE_ROM_GLOBAL_CLONE
3268 #endif
3269
3270 #if defined(DUK_OPT_ROM_GLOBAL_INHERIT)
3271 #define DUK_USE_ROM_GLOBAL_INHERIT
3272 #elif defined(DUK_OPT_NO_ROM_GLOBAL_INHERIT)
3273 #undef DUK_USE_ROM_GLOBAL_INHERIT
3274 #else
3275 #undef DUK_USE_ROM_GLOBAL_INHERIT
3276 #endif
3277
3278 #if defined(DUK_OPT_ROM_OBJECTS)
3279 #define DUK_USE_ROM_OBJECTS
3280 #elif defined(DUK_OPT_NO_ROM_OBJECTS)
3281 #undef DUK_USE_ROM_OBJECTS
3282 #else
3283 #undef DUK_USE_ROM_OBJECTS
3284 #endif
3285
3286 #if defined(DUK_OPT_ROM_STRINGS)
3287 #define DUK_USE_ROM_STRINGS
3288 #elif defined(DUK_OPT_NO_ROM_STRINGS)
3289 #undef DUK_USE_ROM_STRINGS
3290 #else
3291 #undef DUK_USE_ROM_STRINGS
3292 #endif
3293
3195 #if defined(DUK_OPT_SECTION_B) 3294 #if defined(DUK_OPT_SECTION_B)
3196 #define DUK_USE_SECTION_B 3295 #define DUK_USE_SECTION_B
3197 #elif defined(DUK_OPT_NO_SECTION_B) 3296 #elif defined(DUK_OPT_NO_SECTION_B)
3198 #undef DUK_USE_SECTION_B 3297 #undef DUK_USE_SECTION_B
3199 #else 3298 #else
3206 #undef DUK_USE_SELF_TESTS 3305 #undef DUK_USE_SELF_TESTS
3207 #else 3306 #else
3208 #undef DUK_USE_SELF_TESTS 3307 #undef DUK_USE_SELF_TESTS
3209 #endif 3308 #endif
3210 3309
3211 #if defined(DUK_OPT_SETJMP)
3212 #define DUK_USE_SETJMP
3213 #elif defined(DUK_OPT_NO_SETJMP)
3214 #undef DUK_USE_SETJMP
3215 #else
3216 #define DUK_USE_SETJMP
3217 #endif
3218
3219 #if defined(DUK_OPT_SHUFFLE_TORTURE) 3310 #if defined(DUK_OPT_SHUFFLE_TORTURE)
3220 #define DUK_USE_SHUFFLE_TORTURE 3311 #define DUK_USE_SHUFFLE_TORTURE
3221 #elif defined(DUK_OPT_NO_SHUFFLE_TORTURE) 3312 #elif defined(DUK_OPT_NO_SHUFFLE_TORTURE)
3222 #undef DUK_USE_SHUFFLE_TORTURE 3313 #undef DUK_USE_SHUFFLE_TORTURE
3223 #else 3314 #else
3224 #undef DUK_USE_SHUFFLE_TORTURE 3315 #undef DUK_USE_SHUFFLE_TORTURE
3225 #endif 3316 #endif
3226 3317
3227 #if defined(DUK_OPT_SIGSETJMP)
3228 #define DUK_USE_SIGSETJMP
3229 #elif defined(DUK_OPT_NO_SIGSETJMP)
3230 #undef DUK_USE_SIGSETJMP
3231 #else
3232 #undef DUK_USE_SIGSETJMP
3233 #endif
3234
3235 #if defined(DUK_OPT_SOURCE_NONBMP) 3318 #if defined(DUK_OPT_SOURCE_NONBMP)
3236 #define DUK_USE_SOURCE_NONBMP 3319 #define DUK_USE_SOURCE_NONBMP
3237 #elif defined(DUK_OPT_NO_SOURCE_NONBMP) 3320 #elif defined(DUK_OPT_NO_SOURCE_NONBMP)
3238 #undef DUK_USE_SOURCE_NONBMP 3321 #undef DUK_USE_SOURCE_NONBMP
3239 #else 3322 #else
3310 3393
3311 #if defined(DUK_OPT_TRACEBACK_DEPTH) 3394 #if defined(DUK_OPT_TRACEBACK_DEPTH)
3312 #define DUK_USE_TRACEBACK_DEPTH DUK_OPT_TRACEBACK_DEPTH 3395 #define DUK_USE_TRACEBACK_DEPTH DUK_OPT_TRACEBACK_DEPTH
3313 #else 3396 #else
3314 #define DUK_USE_TRACEBACK_DEPTH 10 3397 #define DUK_USE_TRACEBACK_DEPTH 10
3315 #endif
3316
3317 #if defined(DUK_OPT_UNDERSCORE_SETJMP)
3318 #define DUK_USE_UNDERSCORE_SETJMP
3319 #elif defined(DUK_OPT_NO_UNDERSCORE_SETJMP)
3320 #undef DUK_USE_UNDERSCORE_SETJMP
3321 #else
3322 #undef DUK_USE_UNDERSCORE_SETJMP
3323 #endif 3398 #endif
3324 3399
3325 #if defined(DUK_OPT_DECLARE) 3400 #if defined(DUK_OPT_DECLARE)
3326 #define DUK_USE_USER_DECLARE() DUK_OPT_DECLARE 3401 #define DUK_USE_USER_DECLARE() DUK_OPT_DECLARE
3327 #else 3402 #else
3376 #define DUK_USE_ESBC_MAX_LINENUMBER 2147418112L 3451 #define DUK_USE_ESBC_MAX_LINENUMBER 2147418112L
3377 #undef DUK_USE_EXEC_FUN_LOCAL 3452 #undef DUK_USE_EXEC_FUN_LOCAL
3378 #undef DUK_USE_EXPLICIT_NULL_INIT 3453 #undef DUK_USE_EXPLICIT_NULL_INIT
3379 #define DUK_USE_FAST_REFCOUNT_DEFAULT 3454 #define DUK_USE_FAST_REFCOUNT_DEFAULT
3380 #define DUK_USE_HEX_FASTPATH 3455 #define DUK_USE_HEX_FASTPATH
3456 #define DUK_USE_IDCHAR_FASTPATH
3381 #undef DUK_USE_INTERRUPT_DEBUG_FIXUP 3457 #undef DUK_USE_INTERRUPT_DEBUG_FIXUP
3382 #define DUK_USE_JSON_DECNUMBER_FASTPATH 3458 #define DUK_USE_JSON_DECNUMBER_FASTPATH
3383 #define DUK_USE_JSON_DECSTRING_FASTPATH 3459 #define DUK_USE_JSON_DECSTRING_FASTPATH
3384 #define DUK_USE_JSON_DEC_RECLIMIT 1000 3460 #define DUK_USE_JSON_DEC_RECLIMIT 1000
3385 #define DUK_USE_JSON_EATWHITE_FASTPATH 3461 #define DUK_USE_JSON_EATWHITE_FASTPATH
3394 #undef DUK_USE_PREFER_SIZE 3470 #undef DUK_USE_PREFER_SIZE
3395 #define DUK_USE_PROVIDE_DEFAULT_ALLOC_FUNCTIONS 3471 #define DUK_USE_PROVIDE_DEFAULT_ALLOC_FUNCTIONS
3396 #undef DUK_USE_REFZERO_FINALIZER_TORTURE 3472 #undef DUK_USE_REFZERO_FINALIZER_TORTURE
3397 #define DUK_USE_REGEXP_COMPILER_RECLIMIT 10000 3473 #define DUK_USE_REGEXP_COMPILER_RECLIMIT 10000
3398 #define DUK_USE_REGEXP_EXECUTOR_RECLIMIT 10000 3474 #define DUK_USE_REGEXP_EXECUTOR_RECLIMIT 10000
3475 #define DUK_USE_ROM_PTRCOMP_FIRST 63488L
3399 #undef DUK_USE_STRHASH_DENSE 3476 #undef DUK_USE_STRHASH_DENSE
3400 #define DUK_USE_STRHASH_SKIP_SHIFT 5 3477 #define DUK_USE_STRHASH_SKIP_SHIFT 5
3401 #undef DUK_USE_VALSTACK_UNSAFE 3478 #undef DUK_USE_VALSTACK_UNSAFE
3402 #define DUK_USE_VERBOSE_EXECUTOR_ERRORS 3479 #define DUK_USE_VERBOSE_EXECUTOR_ERRORS
3403 3480
3602 #error unsupported config option used (option has been removed): DUK_USE_PACKED_TVAL_POSSIBLE 3679 #error unsupported config option used (option has been removed): DUK_USE_PACKED_TVAL_POSSIBLE
3603 #endif 3680 #endif
3604 #if defined(DUK_USE_RDTSC) 3681 #if defined(DUK_USE_RDTSC)
3605 #error unsupported config option used (option has been removed): DUK_USE_RDTSC 3682 #error unsupported config option used (option has been removed): DUK_USE_RDTSC
3606 #endif 3683 #endif
3684 #if defined(DUK_USE_ROM_GLOBAL_CLONE) && !defined(DUK_USE_ROM_STRINGS)
3685 #error config option DUK_USE_ROM_GLOBAL_CLONE requires option DUK_USE_ROM_STRINGS (which is missing)
3686 #endif
3687 #if defined(DUK_USE_ROM_GLOBAL_CLONE) && !defined(DUK_USE_ROM_OBJECTS)
3688 #error config option DUK_USE_ROM_GLOBAL_CLONE requires option DUK_USE_ROM_OBJECTS (which is missing)
3689 #endif
3690 #if defined(DUK_USE_ROM_GLOBAL_CLONE) && defined(DUK_USE_ROM_GLOBAL_INHERIT)
3691 #error config option DUK_USE_ROM_GLOBAL_CLONE conflicts with option DUK_USE_ROM_GLOBAL_INHERIT (which is also defined)
3692 #endif
3693 #if defined(DUK_USE_ROM_GLOBAL_INHERIT) && !defined(DUK_USE_ROM_STRINGS)
3694 #error config option DUK_USE_ROM_GLOBAL_INHERIT requires option DUK_USE_ROM_STRINGS (which is missing)
3695 #endif
3696 #if defined(DUK_USE_ROM_GLOBAL_INHERIT) && !defined(DUK_USE_ROM_OBJECTS)
3697 #error config option DUK_USE_ROM_GLOBAL_INHERIT requires option DUK_USE_ROM_OBJECTS (which is missing)
3698 #endif
3699 #if defined(DUK_USE_ROM_GLOBAL_INHERIT) && defined(DUK_USE_ROM_GLOBAL_CLONE)
3700 #error config option DUK_USE_ROM_GLOBAL_INHERIT conflicts with option DUK_USE_ROM_GLOBAL_CLONE (which is also defined)
3701 #endif
3702 #if defined(DUK_USE_ROM_OBJECTS) && !defined(DUK_USE_ROM_STRINGS)
3703 #error config option DUK_USE_ROM_OBJECTS requires option DUK_USE_ROM_STRINGS (which is missing)
3704 #endif
3705 #if defined(DUK_USE_ROM_STRINGS) && !defined(DUK_USE_ROM_OBJECTS)
3706 #error config option DUK_USE_ROM_STRINGS requires option DUK_USE_ROM_OBJECTS (which is missing)
3707 #endif
3708 #if defined(DUK_USE_SETJMP)
3709 #error unsupported config option used (option has been removed): DUK_USE_SETJMP
3710 #endif
3711 #if defined(DUK_USE_SIGSETJMP)
3712 #error unsupported config option used (option has been removed): DUK_USE_SIGSETJMP
3713 #endif
3607 #if defined(DUK_USE_STRTAB_CHAIN_SIZE) && !defined(DUK_USE_STRTAB_CHAIN) 3714 #if defined(DUK_USE_STRTAB_CHAIN_SIZE) && !defined(DUK_USE_STRTAB_CHAIN)
3608 #error config option DUK_USE_STRTAB_CHAIN_SIZE requires option DUK_USE_STRTAB_CHAIN (which is missing) 3715 #error config option DUK_USE_STRTAB_CHAIN_SIZE requires option DUK_USE_STRTAB_CHAIN (which is missing)
3609 #endif 3716 #endif
3610 #if defined(DUK_USE_TAILCALL) && defined(DUK_USE_NONSTD_FUNC_CALLER_PROPERTY) 3717 #if defined(DUK_USE_TAILCALL) && defined(DUK_USE_NONSTD_FUNC_CALLER_PROPERTY)
3611 #error config option DUK_USE_TAILCALL conflicts with option DUK_USE_NONSTD_FUNC_CALLER_PROPERTY (which is also defined) 3718 #error config option DUK_USE_TAILCALL conflicts with option DUK_USE_NONSTD_FUNC_CALLER_PROPERTY (which is also defined)
3612 #endif 3719 #endif
3613 #if defined(DUK_USE_UNALIGNED_ACCESSES_POSSIBLE) 3720 #if defined(DUK_USE_UNALIGNED_ACCESSES_POSSIBLE)
3614 #error unsupported config option used (option has been removed): DUK_USE_UNALIGNED_ACCESSES_POSSIBLE 3721 #error unsupported config option used (option has been removed): DUK_USE_UNALIGNED_ACCESSES_POSSIBLE
3722 #endif
3723 #if defined(DUK_USE_UNDERSCORE_SETJMP)
3724 #error unsupported config option used (option has been removed): DUK_USE_UNDERSCORE_SETJMP
3615 #endif 3725 #endif
3616 3726
3617 #if defined(DUK_USE_CPP_EXCEPTIONS) && !defined(__cplusplus) 3727 #if defined(DUK_USE_CPP_EXCEPTIONS) && !defined(__cplusplus)
3618 #error DUK_USE_CPP_EXCEPTIONS enabled but not compiling with a C++ compiler 3728 #error DUK_USE_CPP_EXCEPTIONS enabled but not compiling with a C++ compiler
3619 #endif 3729 #endif