diff --git a/include/SDL_syswm.h b/include/SDL_syswm.h index b3ff754a9bfd1a5bbd17f67ee0e820f10abbe115..4d66a67e6ec413e3057bf521d86cbe5f984f34d0 100644 --- a/include/SDL_syswm.h +++ b/include/SDL_syswm.h @@ -116,7 +116,8 @@ typedef struct SDL_SysWMinfo { } SDL_SysWMinfo; #elif SDL_VIDEO_DRIVER_WINDIB || SDL_VIDEO_DRIVER_DDRAW -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> /* The windows custom event structure */ struct SDL_SysWMmsg { diff --git a/include/SDL_windows.h b/include/SDL_windows.h deleted file mode 100644 index 397539724f20c88668e26e9b6bcf295099c2abbd..0000000000000000000000000000000000000000 --- a/include/SDL_windows.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2006 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_windows_h -#define _SDL_windows_h - -#include "SDL_stdinc.h" - -/* This includes only the windows headers needed by SDL, with no C runtime */ -#define WIN32_LEAN_AND_MEAN -#ifndef HAVE_LIBC -#ifdef _MSC_VER -#ifndef __FLTUSED__ -#define __FLTUSED__ -#ifdef __cplusplus - extern "C" -#endif - __declspec(selectany) int _fltused=1; -#endif -#endif /* _MSC_VER */ -#endif/* !HAVE_LIBC */ -#include <windows.h> - -#endif /* _SDL_windows_h */ diff --git a/src/SDL.c b/src/SDL.c index 0c2f6bebf03469e5445d2e5029869c4e22dd8313..47368c1b82a46d269ef68904e698df610bdc20b0 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -327,7 +327,8 @@ unsigned _System LibMain(unsigned hmod, unsigned termination) #if !defined(HAVE_LIBC) || defined(_WIN32_WCE) || (defined(__WATCOMC__) && defined(BUILD_DLL)) /* Need to include DllMain() on Windows CE and Watcom C for some reason.. */ -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> BOOL APIENTRY _DllMainCRTStartup( HANDLE hModule, DWORD ul_reason_for_call, diff --git a/src/audio/windib/SDL_dibaudio.c b/src/audio/windib/SDL_dibaudio.c index 312438422f03924c07b8ce4eb4d4d34228065b30..37fc42498f073c62e1e22f813299665f56771612 100644 --- a/src/audio/windib/SDL_dibaudio.c +++ b/src/audio/windib/SDL_dibaudio.c @@ -23,7 +23,8 @@ /* Allow access to a raw mixing buffer */ -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #include <mmsystem.h> #include "SDL_timer.h" diff --git a/src/audio/windx5/directx.h b/src/audio/windx5/directx.h index dfd9ef9f0092041ae988990e1e30ee38505d8bea..d14d6c6377dc3698dd724d6d2f01b05b107af58d 100644 --- a/src/audio/windx5/directx.h +++ b/src/audio/windx5/directx.h @@ -4,7 +4,8 @@ /* Include all of the DirectX 5.0 headers and adds any necessary tweaks */ -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #include <mmsystem.h> #ifndef WIN32 #define WIN32 diff --git a/src/cdrom/win32/SDL_syscdrom.c b/src/cdrom/win32/SDL_syscdrom.c index 8cf1a8d51a56c71a4ebd93c6c991f8f0c73d9f3e..17d02ddc0746cfc37a9e9ebc9d243e95b02bcf4f 100644 --- a/src/cdrom/win32/SDL_syscdrom.c +++ b/src/cdrom/win32/SDL_syscdrom.c @@ -23,7 +23,8 @@ /* Functions for system-level CD-ROM audio control */ -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #include <mmsystem.h> #include "SDL_cdrom.h" diff --git a/src/joystick/win32/SDL_mmjoystick.c b/src/joystick/win32/SDL_mmjoystick.c index 2be33f917a9bf1b50f7e5a2c80a5ccf19dcf9619..38a8c7108bfd3004e36a039f8aa392311aea047c 100644 --- a/src/joystick/win32/SDL_mmjoystick.c +++ b/src/joystick/win32/SDL_mmjoystick.c @@ -23,7 +23,8 @@ /* Win32 MultiMedia Joystick driver, contributed by Andrei de A. Formiga */ -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #include <mmsystem.h> #include <regstr.h> diff --git a/src/loadso/win32/SDL_sysloadso.c b/src/loadso/win32/SDL_sysloadso.c index b1ac194dfa01ffaffbbfb5c3c44d578f6ec960fd..e7d8a81ee134efcd6002332e088d1d0ef0c1067d 100644 --- a/src/loadso/win32/SDL_sysloadso.c +++ b/src/loadso/win32/SDL_sysloadso.c @@ -24,7 +24,8 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent library loading routines */ -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #include "SDL_loadso.h" diff --git a/src/main/win32/SDL_win32_main.c b/src/main/win32/SDL_win32_main.c index 943df00adb7e46f1e3a4680e0b8c3d3059b4952a..fa4ef276140f686e55a66f2ad4b887438e8b19de 100644 --- a/src/main/win32/SDL_win32_main.c +++ b/src/main/win32/SDL_win32_main.c @@ -7,7 +7,8 @@ #include <stdio.h> #include <stdlib.h> -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #ifdef _WIN32_WCE # define DIR_SEPERATOR TEXT("\\") diff --git a/src/stdlib/SDL_getenv.c b/src/stdlib/SDL_getenv.c index ab996ca351f519ef86352ccecd05dba98e3894ca..01fd0ece59ca587d14cf786be71cf7679371a021 100644 --- a/src/stdlib/SDL_getenv.c +++ b/src/stdlib/SDL_getenv.c @@ -27,7 +27,8 @@ #if defined(__WIN32__) && !defined(_WIN32_WCE) -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> /* Note this isn't thread-safe! */ diff --git a/src/stdlib/SDL_malloc.c b/src/stdlib/SDL_malloc.c index 1bfb08baa1a0f6221f351e7740907a383652d062..37bfff31fcd0fcfe98c159ca7455007195d7dd10 100644 --- a/src/stdlib/SDL_malloc.c +++ b/src/stdlib/SDL_malloc.c @@ -485,7 +485,8 @@ DEFAULT_MMAP_THRESHOLD default: 256K #endif /* _WIN32 */ #endif /* WIN32 */ #ifdef WIN32 -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #define HAVE_MMAP 1 #define HAVE_MORECORE 0 #define LACKS_UNISTD_H diff --git a/src/stdlib/SDL_stdlib.c b/src/stdlib/SDL_stdlib.c index c8e2cf494c8f961f99504475b60879c8bc4c3c96..b9c3bacc6ae6dd119097673b7762189bb90ff329 100644 --- a/src/stdlib/SDL_stdlib.c +++ b/src/stdlib/SDL_stdlib.c @@ -30,6 +30,14 @@ #if defined(_MSC_VER) +#ifndef __FLTUSED__ +#define __FLTUSED__ +#ifdef __cplusplus + extern "C" +#endif + __declspec(selectany) int _fltused=1; +#endif + /* Float to long */ void __declspec(naked) _ftol() { diff --git a/src/thread/win32/SDL_sysmutex.c b/src/thread/win32/SDL_sysmutex.c index 878a8ef2d05cfb0033f6b93f5f701fee2a33e21e..da83829271db584491ca36a28eabcae4f80e2cfc 100644 --- a/src/thread/win32/SDL_sysmutex.c +++ b/src/thread/win32/SDL_sysmutex.c @@ -23,7 +23,8 @@ /* Mutex functions using the Win32 API */ -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #include "SDL_mutex.h" diff --git a/src/thread/win32/SDL_syssem.c b/src/thread/win32/SDL_syssem.c index 71bd17518ce6dfa966cfde3a1587fe2c0622015c..c7a1bfd53bc1286d7c06e6bf5b5148d1bfc24379 100644 --- a/src/thread/win32/SDL_syssem.c +++ b/src/thread/win32/SDL_syssem.c @@ -23,7 +23,8 @@ /* Semaphore functions using the Win32 API */ -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #include "SDL_thread.h" #if defined(_WIN32_WCE) && (_WIN32_WCE < 300) diff --git a/src/thread/win32/SDL_systhread.c b/src/thread/win32/SDL_systhread.c index 85770fe23e5af35a9f620ff9bd2659d16fbe73bf..968e6b4dfac1bb3984ef9e7314401a2d32d97c9f 100644 --- a/src/thread/win32/SDL_systhread.c +++ b/src/thread/win32/SDL_systhread.c @@ -23,7 +23,8 @@ /* Win32 thread management routines for SDL */ -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #include "SDL_thread.h" #include "../SDL_thread_c.h" diff --git a/src/thread/win32/SDL_systhread_c.h b/src/thread/win32/SDL_systhread_c.h index 2c7dcaa05afb41925eb0d0fa474f6d15de5a5e33..906a9586a6af5d3ff08eb77d32b6c70b4183702c 100644 --- a/src/thread/win32/SDL_systhread_c.h +++ b/src/thread/win32/SDL_systhread_c.h @@ -21,7 +21,8 @@ */ #include "SDL_config.h" -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> typedef HANDLE SYS_ThreadHandle; diff --git a/src/thread/win32/win_ce_semaphore.c b/src/thread/win32/win_ce_semaphore.c index 3399a04f04f5ab4fd7cafe0b0c67d7f861a45afd..9db45c4391e28761b25bda3976e4deb52a1d14f1 100644 --- a/src/thread/win32/win_ce_semaphore.c +++ b/src/thread/win32/win_ce_semaphore.c @@ -28,7 +28,9 @@ and it is not clear how to handle a mixture of WCE semaphores and normal events and mutexes. */ -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> + #include "win_ce_semaphore.h" static SYNCHHANDLE CleanUp (SYNCHHANDLE hSynch, DWORD Flags); diff --git a/src/timer/win32/SDL_systimer.c b/src/timer/win32/SDL_systimer.c index 995e6934bba2c8fbbdefdec8291bca8a620a6764..e78884a21f27fc7c3be61864146b23418757090d 100644 --- a/src/timer/win32/SDL_systimer.c +++ b/src/timer/win32/SDL_systimer.c @@ -21,7 +21,8 @@ */ #include "SDL_config.h" -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #include <mmsystem.h> #include "SDL_timer.h" diff --git a/src/timer/wince/SDL_systimer.c b/src/timer/wince/SDL_systimer.c index 86cf7a39390b8cc1e7045340c71c23ffdaee148e..da4297f987f7931d44a769238bff6cb3ade3760c 100644 --- a/src/timer/wince/SDL_systimer.c +++ b/src/timer/wince/SDL_systimer.c @@ -21,7 +21,8 @@ */ #include "SDL_config.h" -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #include <mmsystem.h> #include "SDL_timer.h" diff --git a/src/video/wincommon/SDL_lowvideo.h b/src/video/wincommon/SDL_lowvideo.h index dbe3ef00c807677466ab00ffc087d913c3b596f3..08e10bd5a4659a09477226d50917c83620a4888e 100644 --- a/src/video/wincommon/SDL_lowvideo.h +++ b/src/video/wincommon/SDL_lowvideo.h @@ -24,7 +24,8 @@ #ifndef _SDL_lowvideo_h #define _SDL_lowvideo_h -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #include "../SDL_sysvideo.h" diff --git a/src/video/wincommon/SDL_sysevents.c b/src/video/wincommon/SDL_sysevents.c index 6e3ca64775336186815ca9516af3f79b2194c155..1f7b32995ee8e178048a21d3550e3caa06be4573 100644 --- a/src/video/wincommon/SDL_sysevents.c +++ b/src/video/wincommon/SDL_sysevents.c @@ -21,7 +21,8 @@ */ #include "SDL_config.h" -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #include "SDL_events.h" #include "SDL_video.h" diff --git a/src/video/wincommon/SDL_sysmouse.c b/src/video/wincommon/SDL_sysmouse.c index 24ccb0107bbfaafc200bfabe9330511149736819..f7138eda06f4cd96aaecda026d72b04546659a0b 100644 --- a/src/video/wincommon/SDL_sysmouse.c +++ b/src/video/wincommon/SDL_sysmouse.c @@ -21,7 +21,8 @@ */ #include "SDL_config.h" -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #include "SDL_mouse.h" #include "../../events/SDL_events_c.h" diff --git a/src/video/wincommon/SDL_syswm.c b/src/video/wincommon/SDL_syswm.c index 4cc085c69c2ea71918d3cc828370063a1423d65f..85046b12ad54c060d570a2d3f4d3a133a5f0c889 100644 --- a/src/video/wincommon/SDL_syswm.c +++ b/src/video/wincommon/SDL_syswm.c @@ -21,7 +21,8 @@ */ #include "SDL_config.h" -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #include "SDL_version.h" #include "SDL_video.h" diff --git a/src/video/windib/SDL_dibevents.c b/src/video/windib/SDL_dibevents.c index 03f410b856725f08dd7a850167246ea54c649527..25986495caf4c066de5467ea651067cce59244c9 100644 --- a/src/video/windib/SDL_dibevents.c +++ b/src/video/windib/SDL_dibevents.c @@ -21,7 +21,8 @@ */ #include "SDL_config.h" -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #include "SDL_main.h" #include "SDL_events.h" diff --git a/src/video/windib/SDL_dibvideo.c b/src/video/windib/SDL_dibvideo.c index 672c46826d57162a6ac7d17ec386397211fc1b84..2b1358b0f6134072875335fc26f5f9ff1b05297f 100644 --- a/src/video/windib/SDL_dibvideo.c +++ b/src/video/windib/SDL_dibvideo.c @@ -21,7 +21,8 @@ */ #include "SDL_config.h" -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #if defined(_WIN32_WCE) diff --git a/src/video/windib/SDL_dibvideo.h b/src/video/windib/SDL_dibvideo.h index 7a02b861138598ff1a1878d342b0d7866c3462bd..99f9b9a6d6503502fd99d82c8b41080df654c5f3 100644 --- a/src/video/windib/SDL_dibvideo.h +++ b/src/video/windib/SDL_dibvideo.h @@ -24,7 +24,8 @@ #ifndef _SDL_dibvideo_h #define _SDL_dibvideo_h -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> /* for PDA */ typedef enum diff --git a/src/video/windx5/directx.h b/src/video/windx5/directx.h index dfd9ef9f0092041ae988990e1e30ee38505d8bea..d14d6c6377dc3698dd724d6d2f01b05b107af58d 100644 --- a/src/video/windx5/directx.h +++ b/src/video/windx5/directx.h @@ -4,7 +4,8 @@ /* Include all of the DirectX 5.0 headers and adds any necessary tweaks */ -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #include <mmsystem.h> #ifndef WIN32 #define WIN32