Fixed bug 3092 - Statically link sdl2 with /MT for msvc
authorSam Lantinga <slouken@libsdl.org>
Sat, 02 Jan 2016 10:25:53 -0800
changeset 99994de94185790e
parent 9998 f67cf37e9cd4
child 10000 acd714e378f4
Fixed bug 3092 - Statically link sdl2 with /MT for msvc

Martin Gerhardy

According to https://msdn.microsoft.com/de-de/library/2kzt1wy3%28v=vs.120%29.aspx when one is using /MT for msvc compilations the libcmt.lib is already linked to the binary. This lib includes the symbol that is now guarded (see attached patch) by the #ifndef _MT.
src/stdlib/SDL_stdlib.c
     1.1 --- a/src/stdlib/SDL_stdlib.c	Sat Jan 02 10:10:34 2016 -0800
     1.2 +++ b/src/stdlib/SDL_stdlib.c	Sat Jan 02 10:25:53 2016 -0800
     1.3 @@ -275,8 +275,11 @@
     1.4  
     1.5  #ifndef __FLTUSED__
     1.6  #define __FLTUSED__
     1.7 +/* the multithreaded runtime already includes libcmt.lib - and this symbol is in there. */
     1.8 +#ifndef _MT
     1.9  __declspec(selectany) int _fltused = 1;
    1.10  #endif
    1.11 +#endif
    1.12  
    1.13  /* The optimizer on Visual Studio 2005 and later generates memcpy() calls */
    1.14  #if (_MSC_VER >= 1400) && defined(_WIN64) && !defined(_DEBUG)