diff --git a/debugdraw.c b/debugdraw.c index 44cd5fb..5ae2843 100644 --- a/debugdraw.c +++ b/debugdraw.c @@ -27,8 +27,15 @@ typedef struct Command // thread local variables so debug drawing in server thread // doesn't fuck up main thread -static __declspec(thread) Command commands[MAX_COMMANDS] = {0}; -static __declspec(thread) int command_i = 0; + +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) +#define THREADLOCAL __declspec(thread) +#else +#define THREADLOCAL __thread +#endif + +static THREADLOCAL Command commands[MAX_COMMANDS] = {0}; +static THREADLOCAL int command_i = 0; void dbg_drawall() {