env.Append(CPPDEFINES = [
'_GDI32_', # prevent wgl* being declared __declspec(dllimport)
'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers
+ 'WIN32_THREADS', # use Win32 thread API
])
sources = [
#include <windows.h>
+#include "glapi/glthread.h"
#include "util/u_debug.h"
#include "pipe/p_screen.h"
#include "shared/stw_pixelformat.h"
#include "shared/stw_public.h"
+#ifdef WIN32_THREADS
+extern _glthread_Mutex OneTimeLock;
+extern void FreeAllTSD(void);
+#endif
+
struct stw_device *stw_dev = NULL;
stw_dev->stw_winsys = stw_winsys;
+#ifdef WIN32_THREADS
+ _glthread_INIT_MUTEX(OneTimeLock);
+#endif
+
stw_dev->screen = stw_winsys->create_screen();
if(!stw_dev->screen)
goto error1;
stw_dev->screen->destroy(stw_dev->screen);
+#ifdef WIN32_THREADS
+ _glthread_DESTROY_MUTEX(OneTimeLock);
+ FreeAllTSD();
+#endif
+
#ifdef DEBUG
debug_memory_end(stw_dev->memdbg_no);
#endif
env.Append(CPPDEFINES = [
'_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS headers
'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers
+ 'WIN32_THREADS', # use Win32 thread API
])
#