Fixed bug 1362 - SDL Fails to compile with Visual C++ Express 2008 with Feb 2007 DirectX SDK
authorSam Lantinga <slouken@libsdl.org>
Sat, 07 Jan 2012 00:57:24 -0500
changeset 616184e12f37b20c
parent 6160 79c33569d463
child 6162 4c43c108a414
Fixed bug 1362 - SDL Fails to compile with Visual C++ Express 2008 with Feb 2007 DirectX SDK

Pallav Nawani 2012-01-04 00:48:29 PST
Issue:
Attempted to compile SDL as a static library.

DirectX SDK: Feb 2007
OS: Win 7
Visual C++ Express 2008
Compliation Mode: Static (Changed project settings from dll to lib)

Error:
C1021: invalid preprocessor command 'warning'

It seems that the #warning directive does not exist in Vc++ Express 2008.
src/audio/xaudio2/SDL_xaudio2.c
     1.1 --- a/src/audio/xaudio2/SDL_xaudio2.c	Sat Jan 07 00:56:21 2012 -0500
     1.2 +++ b/src/audio/xaudio2/SDL_xaudio2.c	Sat Jan 07 00:57:24 2012 -0500
     1.3 @@ -30,7 +30,7 @@
     1.4  
     1.5  #include <dxsdkver.h> /* XAudio2 exists as of the March 2008 DirectX SDK */
     1.6  #if (!defined(_DXSDK_BUILD_MAJOR) || (_DXSDK_BUILD_MAJOR < 1284))
     1.7 -#  warning Your DirectX SDK is too old. Disabling XAudio2 support.
     1.8 +#  pragma message("Your DirectX SDK is too old. Disabling XAudio2 support.")
     1.9  #else
    1.10  #  define SDL_XAUDIO2_HAS_SDK 1
    1.11  #endif