Selaa lähdekoodia

* WASI system.pp: check that WebAssembly threads are always turned off for the wasip1 target, and always turned on for the wasip1threads target

Nikolay Nikolov 5 kuukautta sitten
vanhempi
commit
0977f0ac0d
1 muutettua tiedostoa jossa 8 lisäystä ja 0 poistoa
  1. 8 0
      rtl/wasicommon/system.pp

+ 8 - 0
rtl/wasicommon/system.pp

@@ -23,6 +23,14 @@ interface
 {$ENDIF}
 
 {$define FPC_IS_SYSTEM}
+
+{$if defined(WASIp1threads) and not defined(FPC_WASM_THREADS)}
+  {$fatal The wasip1threads target requires that WebAssembly threads are turned on! Maybe you want to use the wasip1 target, instead?}
+{$endif}
+{$if defined(WASIp1) and not defined(WASIp1threads) and defined(FPC_WASM_THREADS)}
+  {$fatal The wasip1 target requires that WebAssembly threads are turned off! Maybe you want to use the wasip1threads target, instead?}
+{$endif}
+
 {$ifdef FPC_WASM_THREADS}
   {$define DISABLE_NO_THREAD_MANAGER}
 {$else FPC_WASM_THREADS}