Partial fix for bug 3092 - Statically link sdl2 with /MT for msvc
authorSam Lantinga <slouken@libsdl.org>
Mon, 17 Oct 2016 21:47:33 -0700
changeset 10550d8a72d273dd2
parent 10549 1dfa58e94f88
child 10551 a5bc0d82dca4
Partial fix for bug 3092 - Statically link sdl2 with /MT for msvc

Mike Linford

I'm also having trouble statically linking SDL2 on Visual Studio 2015 with /MT. My symptom is that memcpy is being defined twice.
src/stdlib/SDL_stdlib.c
     1.1 --- a/src/stdlib/SDL_stdlib.c	Mon Oct 17 21:44:32 2016 -0700
     1.2 +++ b/src/stdlib/SDL_stdlib.c	Mon Oct 17 21:47:33 2016 -0700
     1.3 @@ -279,7 +279,7 @@
     1.4  #endif
     1.5  
     1.6  /* The optimizer on Visual Studio 2005 and later generates memcpy() calls */
     1.7 -#if (_MSC_VER >= 1400) && defined(_WIN64) && !defined(_DEBUG)
     1.8 +#if (_MSC_VER >= 1400) && defined(_WIN64) && !defined(_DEBUG) && !(_MSC_VER >= 1900 && defined(_MT))
     1.9  #include <intrin.h>
    1.10  
    1.11  #pragma function(memcpy)