Skip to content

Commit cc58f98

Browse files
committed
chore: Update wasi toolchain
Signed-off-by: Roberto Raggi <[email protected]>
1 parent 57cfd14 commit cc58f98

File tree

5 files changed

+68
-48
lines changed

5 files changed

+68
-48
lines changed

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ set_target_properties(nlohmann_json::nlohmann_json PROPERTIES
108108

109109
FetchContent_Declare(
110110
wasi_sysroot
111-
URL https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-22/wasi-sysroot-22.0.tar.gz
112-
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patches/wasi-sysroot.patch
111+
URL https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sysroot-25.0.tar.gz
113112
)
114113

115114
FetchContent_MakeAvailable(wasi_sysroot)

scripts/update-predefined-macros.mjs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,16 @@
2222

2323
import "zx/globals";
2424

25-
const workspacePath = path.join(__dirname, "../");
26-
2725
async function main() {
28-
const gcc = argv.cc ?? "g++";
29-
const std = argv.std ?? "c++20";
30-
3126
const predefinedMacros = String(
32-
await $`${gcc} -E -dM -x c++ -std=${std} - < /dev/null`.quiet(),
27+
// await $`${gcc} -E -dM -x c++ -std=${std} - < /dev/null`.quiet()
28+
await $`wasm32-clang++ -target wasm32-wasi -xc++ -std=c++26 -E -dM - < /dev/null`.quiet()
3329
);
3430

3531
const out = [];
3632
const emit = (s) => out.push(s);
3733

38-
const toolchain = "GCCLinuxToolchain";
34+
const toolchain = "Wasm32WasiToolchain";
3935

4036
emit(`void ${toolchain}::addPredefinedMacros() {`);
4137

src/parser/cxx/parser.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,8 +797,11 @@ Parser::Parser(TranslationUnit* unit) : unit(unit) {
797797
// temporary workarounds to the gnu until we have a proper
798798
// support for templates
799799
mark_maybe_template_name(control_->getIdentifier("__make_integer_seq"));
800-
mark_maybe_template_name(control_->getIdentifier("__type_pack_element"));
800+
mark_maybe_template_name(control_->getIdentifier("__remove_reference_t"));
801+
mark_maybe_template_name(control_->getIdentifier("__integer_pack"));
802+
801803
template_names_.insert(control_->getIdentifier("_S_invoke"));
804+
template_names_.insert(control_->getIdentifier("__type_pack_element"));
802805
}
803806

804807
Parser::~Parser() = default;

src/parser/cxx/preprocessor.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ std::unordered_set<std::string_view> enabledBuiltins{
101101
"__is_void",
102102
"__is_volatile",
103103

104+
"__remove_reference_t",
105+
"__integer_pack",
106+
"__type_pack_element",
107+
104108
#if false
105109
"__add_lvalue_reference", "__add_pointer", "__add_rvalue_reference",
106110
"__array_extent", "__array_rank", "__atomic_add_fetch", "__atomic_load_n",

src/parser/cxx/wasm32_wasi_toolchain.cc

Lines changed: 56 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ void Wasm32WasiToolchain::addPredefinedMacros() {
9292
defineMacro("__ATOMIC_SEQ_CST", "5");
9393
defineMacro("__BIGGEST_ALIGNMENT__", "16");
9494
defineMacro("__BITINT_MAXWIDTH__", "128");
95-
defineMacro("__BOOL_WIDTH__", "8");
95+
defineMacro("__BOOL_WIDTH__", "1");
9696
defineMacro("__BYTE_ORDER__", "__ORDER_LITTLE_ENDIAN__");
97-
defineMacro("__CHAR16_TYPE__", "unsigned");
98-
defineMacro("__CHAR32_TYPE__", "unsigned");
97+
defineMacro("__CHAR16_TYPE__", "unsigned short");
98+
defineMacro("__CHAR32_TYPE__", "unsigned int");
9999
defineMacro("__CHAR_BIT__", "8");
100100
defineMacro("__CLANG_ATOMIC_BOOL_LOCK_FREE", "2");
101101
defineMacro("__CLANG_ATOMIC_CHAR16_T_LOCK_FREE", "2");
@@ -123,6 +123,7 @@ void Wasm32WasiToolchain::addPredefinedMacros() {
123123
defineMacro("__DBL_MIN_10_EXP__", "(-307)");
124124
defineMacro("__DBL_MIN_EXP__", "(-1021)");
125125
defineMacro("__DBL_MIN__", "2.2250738585072014e-308");
126+
defineMacro("__DBL_NORM_MAX__", "1.7976931348623157e+308");
126127
defineMacro("__DECIMAL_DIG__", "__LDBL_DECIMAL_DIG__");
127128
defineMacro("__DEPRECATED", "1");
128129
defineMacro("__EXCEPTIONS", "1");
@@ -142,6 +143,7 @@ void Wasm32WasiToolchain::addPredefinedMacros() {
142143
defineMacro("__FLT_MIN_10_EXP__", "(-37)");
143144
defineMacro("__FLT_MIN_EXP__", "(-125)");
144145
defineMacro("__FLT_MIN__", "1.17549435e-38F");
146+
defineMacro("__FLT_NORM_MAX__", "3.40282347e+38F");
145147
defineMacro("__FLT_RADIX__", "2");
146148
defineMacro("__FPCLASS_NEGINF", "0x0004");
147149
defineMacro("__FPCLASS_NEGNORMAL", "0x0008");
@@ -165,6 +167,8 @@ void Wasm32WasiToolchain::addPredefinedMacros() {
165167
defineMacro("__GCC_ATOMIC_SHORT_LOCK_FREE", "2");
166168
defineMacro("__GCC_ATOMIC_TEST_AND_SET_TRUEVAL", "1");
167169
defineMacro("__GCC_ATOMIC_WCHAR_T_LOCK_FREE", "2");
170+
defineMacro("__GCC_CONSTRUCTIVE_SIZE", "64");
171+
defineMacro("__GCC_DESTRUCTIVE_SIZE", "64");
168172
defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1", "1");
169173
defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2", "1");
170174
defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4", "1");
@@ -193,22 +197,22 @@ void Wasm32WasiToolchain::addPredefinedMacros() {
193197
defineMacro("__INT64_FMTd__", "\"lld\"");
194198
defineMacro("__INT64_FMTi__", "\"lli\"");
195199
defineMacro("__INT64_MAX__", "9223372036854775807LL");
196-
defineMacro("__INT64_TYPE__", "long");
200+
defineMacro("__INT64_TYPE__", "long long int");
197201
defineMacro("__INT8_C_SUFFIX__", "");
198202
defineMacro("__INT8_FMTd__", "\"hhd\"");
199203
defineMacro("__INT8_FMTi__", "\"hhi\"");
200204
defineMacro("__INT8_MAX__", "127");
201-
defineMacro("__INT8_TYPE__", "signed");
205+
defineMacro("__INT8_TYPE__", "signed char");
202206
defineMacro("__INTMAX_C_SUFFIX__", "LL");
203207
defineMacro("__INTMAX_FMTd__", "\"lld\"");
204208
defineMacro("__INTMAX_FMTi__", "\"lli\"");
205209
defineMacro("__INTMAX_MAX__", "9223372036854775807LL");
206-
defineMacro("__INTMAX_TYPE__", "long");
210+
defineMacro("__INTMAX_TYPE__", "long long int");
207211
defineMacro("__INTMAX_WIDTH__", "64");
208212
defineMacro("__INTPTR_FMTd__", "\"ld\"");
209213
defineMacro("__INTPTR_FMTi__", "\"li\"");
210214
defineMacro("__INTPTR_MAX__", "2147483647L");
211-
defineMacro("__INTPTR_TYPE__", "long");
215+
defineMacro("__INTPTR_TYPE__", "long int");
212216
defineMacro("__INTPTR_WIDTH__", "32");
213217
defineMacro("__INT_FAST16_FMTd__", "\"hd\"");
214218
defineMacro("__INT_FAST16_FMTi__", "\"hi\"");
@@ -223,12 +227,12 @@ void Wasm32WasiToolchain::addPredefinedMacros() {
223227
defineMacro("__INT_FAST64_FMTd__", "\"lld\"");
224228
defineMacro("__INT_FAST64_FMTi__", "\"lli\"");
225229
defineMacro("__INT_FAST64_MAX__", "9223372036854775807LL");
226-
defineMacro("__INT_FAST64_TYPE__", "long");
230+
defineMacro("__INT_FAST64_TYPE__", "long long int");
227231
defineMacro("__INT_FAST64_WIDTH__", "64");
228232
defineMacro("__INT_FAST8_FMTd__", "\"hhd\"");
229233
defineMacro("__INT_FAST8_FMTi__", "\"hhi\"");
230234
defineMacro("__INT_FAST8_MAX__", "127");
231-
defineMacro("__INT_FAST8_TYPE__", "signed");
235+
defineMacro("__INT_FAST8_TYPE__", "signed char");
232236
defineMacro("__INT_FAST8_WIDTH__", "8");
233237
defineMacro("__INT_LEAST16_FMTd__", "\"hd\"");
234238
defineMacro("__INT_LEAST16_FMTi__", "\"hi\"");
@@ -243,12 +247,12 @@ void Wasm32WasiToolchain::addPredefinedMacros() {
243247
defineMacro("__INT_LEAST64_FMTd__", "\"lld\"");
244248
defineMacro("__INT_LEAST64_FMTi__", "\"lli\"");
245249
defineMacro("__INT_LEAST64_MAX__", "9223372036854775807LL");
246-
defineMacro("__INT_LEAST64_TYPE__", "long");
250+
defineMacro("__INT_LEAST64_TYPE__", "long long int");
247251
defineMacro("__INT_LEAST64_WIDTH__", "64");
248252
defineMacro("__INT_LEAST8_FMTd__", "\"hhd\"");
249253
defineMacro("__INT_LEAST8_FMTi__", "\"hhi\"");
250254
defineMacro("__INT_LEAST8_MAX__", "127");
251-
defineMacro("__INT_LEAST8_TYPE__", "signed");
255+
defineMacro("__INT_LEAST8_TYPE__", "signed char");
252256
defineMacro("__INT_LEAST8_WIDTH__", "8");
253257
defineMacro("__INT_MAX__", "2147483647");
254258
defineMacro("__INT_WIDTH__", "32");
@@ -266,6 +270,7 @@ void Wasm32WasiToolchain::addPredefinedMacros() {
266270
defineMacro("__LDBL_MIN_10_EXP__", "(-4931)");
267271
defineMacro("__LDBL_MIN_EXP__", "(-16381)");
268272
defineMacro("__LDBL_MIN__", "3.36210314311209350626267781732175260e-4932L");
273+
defineMacro("__LDBL_NORM_MAX__", "1.18973149535723176508575932662800702e+4932L");
269274
defineMacro("__LITTLE_ENDIAN__", "1");
270275
defineMacro("__LLONG_WIDTH__", "64");
271276
defineMacro("__LONG_LONG_MAX__", "9223372036854775807LL");
@@ -292,7 +297,7 @@ void Wasm32WasiToolchain::addPredefinedMacros() {
292297
defineMacro("__PTRDIFF_FMTd__", "\"ld\"");
293298
defineMacro("__PTRDIFF_FMTi__", "\"li\"");
294299
defineMacro("__PTRDIFF_MAX__", "2147483647L");
295-
defineMacro("__PTRDIFF_TYPE__", "long");
300+
defineMacro("__PTRDIFF_TYPE__", "long int");
296301
defineMacro("__PTRDIFF_WIDTH__", "32");
297302
defineMacro("__SCHAR_MAX__", "127");
298303
defineMacro("__SHRT_MAX__", "32767");
@@ -317,9 +322,12 @@ void Wasm32WasiToolchain::addPredefinedMacros() {
317322
defineMacro("__SIZE_FMTu__", "\"lu\"");
318323
defineMacro("__SIZE_FMTx__", "\"lx\"");
319324
defineMacro("__SIZE_MAX__", "4294967295UL");
320-
defineMacro("__SIZE_TYPE__", "long");
325+
defineMacro("__SIZE_TYPE__", "long unsigned int");
321326
defineMacro("__SIZE_WIDTH__", "32");
322327
defineMacro("__STDCPP_DEFAULT_NEW_ALIGNMENT__", "16UL");
328+
defineMacro("__STDC_EMBED_EMPTY__", "2");
329+
defineMacro("__STDC_EMBED_FOUND__", "1");
330+
defineMacro("__STDC_EMBED_NOT_FOUND__", "0");
323331
defineMacro("__STDC_HOSTED__", "1");
324332
defineMacro("__STDC_UTF_16__", "1");
325333
defineMacro("__STDC_UTF_32__", "1");
@@ -331,93 +339,93 @@ void Wasm32WasiToolchain::addPredefinedMacros() {
331339
defineMacro("__UINT16_FMTu__", "\"hu\"");
332340
defineMacro("__UINT16_FMTx__", "\"hx\"");
333341
defineMacro("__UINT16_MAX__", "65535");
334-
defineMacro("__UINT16_TYPE__", "unsigned");
342+
defineMacro("__UINT16_TYPE__", "unsigned short");
335343
defineMacro("__UINT32_C_SUFFIX__", "U");
336344
defineMacro("__UINT32_FMTX__", "\"X\"");
337345
defineMacro("__UINT32_FMTo__", "\"o\"");
338346
defineMacro("__UINT32_FMTu__", "\"u\"");
339347
defineMacro("__UINT32_FMTx__", "\"x\"");
340348
defineMacro("__UINT32_MAX__", "4294967295U");
341-
defineMacro("__UINT32_TYPE__", "unsigned");
349+
defineMacro("__UINT32_TYPE__", "unsigned int");
342350
defineMacro("__UINT64_C_SUFFIX__", "ULL");
343351
defineMacro("__UINT64_FMTX__", "\"llX\"");
344352
defineMacro("__UINT64_FMTo__", "\"llo\"");
345353
defineMacro("__UINT64_FMTu__", "\"llu\"");
346354
defineMacro("__UINT64_FMTx__", "\"llx\"");
347355
defineMacro("__UINT64_MAX__", "18446744073709551615ULL");
348-
defineMacro("__UINT64_TYPE__", "long");
356+
defineMacro("__UINT64_TYPE__", "long long unsigned int");
349357
defineMacro("__UINT8_C_SUFFIX__", "");
350358
defineMacro("__UINT8_FMTX__", "\"hhX\"");
351359
defineMacro("__UINT8_FMTo__", "\"hho\"");
352360
defineMacro("__UINT8_FMTu__", "\"hhu\"");
353361
defineMacro("__UINT8_FMTx__", "\"hhx\"");
354362
defineMacro("__UINT8_MAX__", "255");
355-
defineMacro("__UINT8_TYPE__", "unsigned");
363+
defineMacro("__UINT8_TYPE__", "unsigned char");
356364
defineMacro("__UINTMAX_C_SUFFIX__", "ULL");
357365
defineMacro("__UINTMAX_FMTX__", "\"llX\"");
358366
defineMacro("__UINTMAX_FMTo__", "\"llo\"");
359367
defineMacro("__UINTMAX_FMTu__", "\"llu\"");
360368
defineMacro("__UINTMAX_FMTx__", "\"llx\"");
361369
defineMacro("__UINTMAX_MAX__", "18446744073709551615ULL");
362-
defineMacro("__UINTMAX_TYPE__", "long");
370+
defineMacro("__UINTMAX_TYPE__", "long long unsigned int");
363371
defineMacro("__UINTMAX_WIDTH__", "64");
364372
defineMacro("__UINTPTR_FMTX__", "\"lX\"");
365373
defineMacro("__UINTPTR_FMTo__", "\"lo\"");
366374
defineMacro("__UINTPTR_FMTu__", "\"lu\"");
367375
defineMacro("__UINTPTR_FMTx__", "\"lx\"");
368376
defineMacro("__UINTPTR_MAX__", "4294967295UL");
369-
defineMacro("__UINTPTR_TYPE__", "long");
377+
defineMacro("__UINTPTR_TYPE__", "long unsigned int");
370378
defineMacro("__UINTPTR_WIDTH__", "32");
371379
defineMacro("__UINT_FAST16_FMTX__", "\"hX\"");
372380
defineMacro("__UINT_FAST16_FMTo__", "\"ho\"");
373381
defineMacro("__UINT_FAST16_FMTu__", "\"hu\"");
374382
defineMacro("__UINT_FAST16_FMTx__", "\"hx\"");
375383
defineMacro("__UINT_FAST16_MAX__", "65535");
376-
defineMacro("__UINT_FAST16_TYPE__", "unsigned");
384+
defineMacro("__UINT_FAST16_TYPE__", "unsigned short");
377385
defineMacro("__UINT_FAST32_FMTX__", "\"X\"");
378386
defineMacro("__UINT_FAST32_FMTo__", "\"o\"");
379387
defineMacro("__UINT_FAST32_FMTu__", "\"u\"");
380388
defineMacro("__UINT_FAST32_FMTx__", "\"x\"");
381389
defineMacro("__UINT_FAST32_MAX__", "4294967295U");
382-
defineMacro("__UINT_FAST32_TYPE__", "unsigned");
390+
defineMacro("__UINT_FAST32_TYPE__", "unsigned int");
383391
defineMacro("__UINT_FAST64_FMTX__", "\"llX\"");
384392
defineMacro("__UINT_FAST64_FMTo__", "\"llo\"");
385393
defineMacro("__UINT_FAST64_FMTu__", "\"llu\"");
386394
defineMacro("__UINT_FAST64_FMTx__", "\"llx\"");
387395
defineMacro("__UINT_FAST64_MAX__", "18446744073709551615ULL");
388-
defineMacro("__UINT_FAST64_TYPE__", "long");
396+
defineMacro("__UINT_FAST64_TYPE__", "long long unsigned int");
389397
defineMacro("__UINT_FAST8_FMTX__", "\"hhX\"");
390398
defineMacro("__UINT_FAST8_FMTo__", "\"hho\"");
391399
defineMacro("__UINT_FAST8_FMTu__", "\"hhu\"");
392400
defineMacro("__UINT_FAST8_FMTx__", "\"hhx\"");
393401
defineMacro("__UINT_FAST8_MAX__", "255");
394-
defineMacro("__UINT_FAST8_TYPE__", "unsigned");
402+
defineMacro("__UINT_FAST8_TYPE__", "unsigned char");
395403
defineMacro("__UINT_LEAST16_FMTX__", "\"hX\"");
396404
defineMacro("__UINT_LEAST16_FMTo__", "\"ho\"");
397405
defineMacro("__UINT_LEAST16_FMTu__", "\"hu\"");
398406
defineMacro("__UINT_LEAST16_FMTx__", "\"hx\"");
399407
defineMacro("__UINT_LEAST16_MAX__", "65535");
400-
defineMacro("__UINT_LEAST16_TYPE__", "unsigned");
408+
defineMacro("__UINT_LEAST16_TYPE__", "unsigned short");
401409
defineMacro("__UINT_LEAST32_FMTX__", "\"X\"");
402410
defineMacro("__UINT_LEAST32_FMTo__", "\"o\"");
403411
defineMacro("__UINT_LEAST32_FMTu__", "\"u\"");
404412
defineMacro("__UINT_LEAST32_FMTx__", "\"x\"");
405413
defineMacro("__UINT_LEAST32_MAX__", "4294967295U");
406-
defineMacro("__UINT_LEAST32_TYPE__", "unsigned");
414+
defineMacro("__UINT_LEAST32_TYPE__", "unsigned int");
407415
defineMacro("__UINT_LEAST64_FMTX__", "\"llX\"");
408416
defineMacro("__UINT_LEAST64_FMTo__", "\"llo\"");
409417
defineMacro("__UINT_LEAST64_FMTu__", "\"llu\"");
410418
defineMacro("__UINT_LEAST64_FMTx__", "\"llx\"");
411419
defineMacro("__UINT_LEAST64_MAX__", "18446744073709551615ULL");
412-
defineMacro("__UINT_LEAST64_TYPE__", "long");
420+
defineMacro("__UINT_LEAST64_TYPE__", "long long unsigned int");
413421
defineMacro("__UINT_LEAST8_FMTX__", "\"hhX\"");
414422
defineMacro("__UINT_LEAST8_FMTo__", "\"hho\"");
415423
defineMacro("__UINT_LEAST8_FMTu__", "\"hhu\"");
416424
defineMacro("__UINT_LEAST8_FMTx__", "\"hhx\"");
417425
defineMacro("__UINT_LEAST8_MAX__", "255");
418-
defineMacro("__UINT_LEAST8_TYPE__", "unsigned");
426+
defineMacro("__UINT_LEAST8_TYPE__", "unsigned char");
419427
defineMacro("__USER_LABEL_PREFIX__", "");
420-
defineMacro("__VERSION__", "\"Clang");
428+
defineMacro("__VERSION__", "\"Clang 20.0.0git\"");
421429
defineMacro("__WCHAR_MAX__", "2147483647");
422430
defineMacro("__WCHAR_TYPE__", "int");
423431
defineMacro("__WCHAR_WIDTH__", "32");
@@ -426,10 +434,10 @@ void Wasm32WasiToolchain::addPredefinedMacros() {
426434
defineMacro("__WINT_WIDTH__", "32");
427435
defineMacro("__clang__", "1");
428436
defineMacro("__clang_literal_encoding__", "\"UTF-8\"");
429-
defineMacro("__clang_major__", "18");
430-
defineMacro("__clang_minor__", "1");
431-
defineMacro("__clang_patchlevel__", "2");
432-
defineMacro("__clang_version__", "\"18.1.2-wasi-sdk");
437+
defineMacro("__clang_major__", "20");
438+
defineMacro("__clang_minor__", "0");
439+
defineMacro("__clang_patchlevel__", "0");
440+
defineMacro("__clang_version__", "\"20.0.0git \"");
433441
defineMacro("__clang_wide_literal_encoding__", "\"UTF-32\"");
434442
defineMacro("__cplusplus", "202400L");
435443
defineMacro("__cpp_aggregate_bases", "201603L");
@@ -442,17 +450,18 @@ void Wasm32WasiToolchain::addPredefinedMacros() {
442450
defineMacro("__cpp_binary_literals", "201304L");
443451
defineMacro("__cpp_capture_star_this", "201603L");
444452
defineMacro("__cpp_char8_t", "202207L");
445-
defineMacro("__cpp_concepts", "201907L");
453+
defineMacro("__cpp_concepts", "202002");
446454
defineMacro("__cpp_conditional_explicit", "201806L");
447455
defineMacro("__cpp_consteval", "202211L");
448-
defineMacro("__cpp_constexpr", "202306L");
456+
defineMacro("__cpp_constexpr", "202406L");
449457
defineMacro("__cpp_constexpr_dynamic_alloc", "201907L");
450458
defineMacro("__cpp_constexpr_in_decltype", "201711L");
451459
defineMacro("__cpp_constinit", "201907L");
452460
defineMacro("__cpp_decltype", "200707L");
453461
defineMacro("__cpp_decltype_auto", "201304L");
454462
defineMacro("__cpp_deduction_guides", "201703L");
455463
defineMacro("__cpp_delegating_constructors", "200604L");
464+
defineMacro("__cpp_deleted_function", "202403L");
456465
defineMacro("__cpp_designated_initializers", "201707L");
457466
defineMacro("__cpp_digit_separators", "201309L");
458467
defineMacro("__cpp_enumerator_attributes", "201411L");
@@ -466,7 +475,7 @@ void Wasm32WasiToolchain::addPredefinedMacros() {
466475
defineMacro("__cpp_impl_coroutine", "201902L");
467476
defineMacro("__cpp_impl_destroying_delete", "201806L");
468477
defineMacro("__cpp_impl_three_way_comparison", "201907L");
469-
defineMacro("__cpp_implicit_move", "202011L");
478+
defineMacro("__cpp_implicit_move", "202207L");
470479
defineMacro("__cpp_inheriting_constructors", "201511L");
471480
defineMacro("__cpp_init_captures", "201803L");
472481
defineMacro("__cpp_initializer_lists", "200806L");
@@ -480,23 +489,27 @@ void Wasm32WasiToolchain::addPredefinedMacros() {
480489
defineMacro("__cpp_nontype_template_args", "201411L");
481490
defineMacro("__cpp_nontype_template_parameter_auto", "201606L");
482491
defineMacro("__cpp_nsdmi", "200809L");
492+
defineMacro("__cpp_pack_indexing", "202311L");
483493
defineMacro("__cpp_placeholder_variables", "202306L");
484-
defineMacro("__cpp_range_based_for", "201603L");
494+
defineMacro("__cpp_range_based_for", "202211L");
485495
defineMacro("__cpp_raw_strings", "200710L");
486496
defineMacro("__cpp_ref_qualifiers", "200710L");
487497
defineMacro("__cpp_return_type_deduction", "201304L");
488498
defineMacro("__cpp_rtti", "199711L");
489499
defineMacro("__cpp_rvalue_references", "200610L");
490500
defineMacro("__cpp_size_t_suffix", "202011L");
501+
defineMacro("__cpp_sized_deallocation", "201309L");
491502
defineMacro("__cpp_static_assert", "202306L");
492503
defineMacro("__cpp_static_call_operator", "202207L");
493-
defineMacro("__cpp_structured_bindings", "201606L");
504+
defineMacro("__cpp_structured_bindings", "202403L");
494505
defineMacro("__cpp_template_auto", "201606L");
506+
defineMacro("__cpp_template_template_args", "201611L");
495507
defineMacro("__cpp_unicode_characters", "200704L");
496508
defineMacro("__cpp_unicode_literals", "200710L");
497509
defineMacro("__cpp_user_defined_literals", "200809L");
498510
defineMacro("__cpp_using_enum", "201907L");
499511
defineMacro("__cpp_variable_templates", "201304L");
512+
defineMacro("__cpp_variadic_friend", "202403L");
500513
defineMacro("__cpp_variadic_templates", "200704L");
501514
defineMacro("__cpp_variadic_using", "201611L");
502515
defineMacro("__llvm__", "1");
@@ -506,9 +519,14 @@ void Wasm32WasiToolchain::addPredefinedMacros() {
506519
defineMacro("__wasm32", "1");
507520
defineMacro("__wasm32__", "1");
508521
defineMacro("__wasm__", "1");
522+
defineMacro("__wasm_bulk_memory__", "1");
523+
defineMacro("__wasm_bulk_memory_opt__", "1");
524+
defineMacro("__wasm_multivalue__", "1");
509525
defineMacro("__wasm_mutable_globals__", "1");
526+
defineMacro("__wasm_nontrapping_fptoint__", "1");
527+
defineMacro("__wasm_reference_types__", "1");
510528
defineMacro("__wasm_sign_ext__", "1");
511-
// clang-format on
529+
// clang-format off
512530
}
513531

514532
} // namespace cxx

0 commit comments

Comments
 (0)