Index: CMakeLists.txt =================================================================== --- CMakeLists.txt (revision 15231) +++ CMakeLists.txt (working copy) @@ -153,7 +153,7 @@ endif(NOT IPHONE) option(NO_FPU "No floating point unit" off) -option(WANT_DLL_TLS "Force use of DllMain for TLS (Windows)" on) +option(WANT_DLL_TLS "Force use of DllMain for TLS (Windows) Probably not OK for static builds, but there are corner cases where this might be needed (for example allegro used in a plugin library)." on) option(WANT_DEMO "Build demo programs" on) option(WANT_EXAMPLES "Build example programs" on) option(WANT_POPUP_EXAMPLES "Use popups instead of printf for fatal errors" on) @@ -173,14 +173,12 @@ endif(CMAKE_COMPILER_IS_GNUCC) if(WIN32) - if(WANT_DLL_TLS AND SHARED) + if(WANT_DLL_TLS) set(ALLEGRO_CFG_DLL_TLS 1) - endif(WANT_DLL_TLS AND SHARED) + endif(WANT_DLL_TLS) endif(WIN32) if(MSVC) - # MSVC never needs DLL TLS and it just confuses - set(ALLEGRO_CFG_DLL_TLS 0) set(COMPILER_MSVC 1) set(ALLEGRO_MSVC 1) Index: src/tls.c =================================================================== --- src/tls.c (revision 15231) +++ src/tls.c (working copy) @@ -132,13 +132,6 @@ _al_fill_display_settings(&tls->new_display_settings); } -// FIXME: The TLS implementation below only works for dynamic linking -// right now - instead of using DllMain we should simply initialize -// on first request. -#ifdef ALLEGRO_STATICLINK - #undef ALLEGRO_CFG_DLL_TLS -#endif - #if defined(ALLEGRO_CFG_DLL_TLS) #include