From 0977f0ac0d1ecf3284554b2613bbdd1bb03359a8 Mon Sep 17 00:00:00 2001 From: Nikolay Nikolov Date: Fri, 28 Feb 2025 15:07:21 +0200 Subject: [PATCH] * WASI system.pp: check that WebAssembly threads are always turned off for the wasip1 target, and always turned on for the wasip1threads target --- rtl/wasicommon/system.pp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rtl/wasicommon/system.pp b/rtl/wasicommon/system.pp index 250c364692..15604af216 100644 --- a/rtl/wasicommon/system.pp +++ b/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}