Skip to content

Commit

Permalink
Rename 'thread_local' macro to 'SE1_THREADLOCAL' to avoid conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamyCecil committed Feb 5, 2024
1 parent a1516c9 commit 6045225
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Sources/Engine/Base/Stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ ULONG _ulMaxLenghtOfSavingFile = (1UL<<20)*128;
extern INDEX fil_bPreferZips = FALSE;

// set if current thread has currently enabled stream handling
static thread_local BOOL _bThreadCanHandleStreams = FALSE;
static SE1_THREADLOCAL BOOL _bThreadCanHandleStreams = FALSE;
// list of currently opened streams
static thread_local CListHead *_plhOpenedStreams = NULL;
static SE1_THREADLOCAL CListHead *_plhOpenedStreams = NULL;

ULONG _ulVirtuallyAllocatedSpace = 0;
ULONG _ulVirtuallyAllocatedSpaceTotal = 0;
Expand Down
2 changes: 1 addition & 1 deletion Sources/Engine/Base/Synchronization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ typedef struct {
HANDLE hEvent;
} OPTEX, *POPTEX;

thread_local INDEX _iLastLockedMutex = 0;
SE1_THREADLOCAL INDEX _iLastLockedMutex = 0;

BOOL OPTEX_Initialize (POPTEX poptex) {

Expand Down
2 changes: 1 addition & 1 deletion Sources/Engine/Base/Timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static inline SQUAD ReadTSC(void)
#pragma comment(lib, "winmm.lib")

// current game time always valid for the currently active task
static thread_local TIME _CurrentTickTimer = 0.0f;
static SE1_THREADLOCAL TIME _CurrentTickTimer = 0.0f;

// CTimer implementation

Expand Down
2 changes: 1 addition & 1 deletion Sources/Engine/Network/MessageDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class CMessageBuffer {
};

// the thread's local buffer
static thread_local CMessageBuffer mbReceivedMessage = { 0,0 };
static SE1_THREADLOCAL CMessageBuffer mbReceivedMessage = { 0,0 };

void CMessageBuffer::Allocate(void)
{
Expand Down
10 changes: 5 additions & 5 deletions Sources/Engine/OS/PlatformSpecific.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define SE_INCL_PLATFORMSPECIFIC_H

// Thread-local variables specifier
#ifndef thread_local
#ifndef SE1_THREADLOCAL
#if SE1_WIN
#define thread_local __declspec(thread)
#define SE1_THREADLOCAL __declspec(thread)
#elif __STDC_VERSION__ >= 201112L
#define thread_local _Thread_local
#define SE1_THREADLOCAL _Thread_local
#else
#define thread_local __thread
#define SE1_THREADLOCAL __thread
#endif
#endif // thread_local
#endif // SE1_THREADLOCAL

// Unix-specific
#if SE1_UNIX
Expand Down

0 comments on commit 6045225

Please sign in to comment.