diff --git a/flexdll.c b/flexdll.c index b19fe2a..a90a11f 100644 --- a/flexdll.c +++ b/flexdll.c @@ -47,8 +47,11 @@ typedef struct dlunit { } dlunit; typedef void *resolver(void*, const char*); -static int error = 0; -static char error_buffer[256]; +#ifdef _MSC_VER +#define __thread __declspec(thread) +#endif +static __thread int error = 0; +static __thread char error_buffer[256]; /* Emulate a low-level dlopen-like interface */