From 7b38f80119ddc45a28251129b6c8a7fbbcf60846 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 21 Sep 2023 23:38:02 +0300 Subject: [PATCH] [STLPORT] Make stl thread-safe Define _STLP_THREADS to make stl thread safe. Also remove defined(__BUILDING_STLPORT) from the preprocessor conditions for which STLPInterlockedExchangePointer is defined, because that function is used in _threads.h, which can get included by apps using the stl through stl headers. --- sdk/include/c++/stlport/stl/config/_reactos.h | 5 ++++- sdk/include/c++/stlport/stl/config/_windows.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sdk/include/c++/stlport/stl/config/_reactos.h b/sdk/include/c++/stlport/stl/config/_reactos.h index d1e7d1683e9..dd08393e256 100644 --- a/sdk/include/c++/stlport/stl/config/_reactos.h +++ b/sdk/include/c++/stlport/stl/config/_reactos.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2010 - * Jérôme Gardou + * Jérôme Gardou * * * This material is provided "as is", with absolutely no warranty expressed @@ -302,6 +302,9 @@ // Calling convention #define _STLP_CALL __cdecl +// Always build multithreaded code +#define _STLP_THREADS + #if 0 #ifdef _M_AMD64 diff --git a/sdk/include/c++/stlport/stl/config/_windows.h b/sdk/include/c++/stlport/stl/config/_windows.h index ac9856eb31d..8af985ea82b 100644 --- a/sdk/include/c++/stlport/stl/config/_windows.h +++ b/sdk/include/c++/stlport/stl/config/_windows.h @@ -205,7 +205,7 @@ _STLP_IMPORT_DECLSPEC void _STLP_STDCALL OutputDebugStringA(const char* lpOutput * to avoid macro definition conflict. */ # if !defined (_WIN64) /* Under 32 bits platform we rely on a simple InterlockedExchange call. */ -# if defined (__cplusplus) && defined(__BUILDING_STLPORT) +# if defined (__cplusplus) /* We do not define this function if we are not in a C++ translation unit just * because of the 'inline' keyword portability issue it would introduce. We will * have to fix it the day we need this function for a C translation unit.