From b024a0c4299c71ead8354bd4ae698725b65ddd8d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 25 Feb 2006 22:18:25 +0000 Subject: [PATCH] SDL_windows.h is no longer necessary --- include/SDL_syswm.h | 3 +- include/SDL_windows.h | 43 ----------------------------- src/SDL.c | 3 +- src/audio/windib/SDL_dibaudio.c | 3 +- src/audio/windx5/directx.h | 3 +- src/cdrom/win32/SDL_syscdrom.c | 3 +- src/joystick/win32/SDL_mmjoystick.c | 3 +- src/loadso/win32/SDL_sysloadso.c | 3 +- src/main/win32/SDL_win32_main.c | 3 +- src/stdlib/SDL_getenv.c | 3 +- src/stdlib/SDL_malloc.c | 3 +- src/stdlib/SDL_stdlib.c | 8 ++++++ src/thread/win32/SDL_sysmutex.c | 3 +- src/thread/win32/SDL_syssem.c | 3 +- src/thread/win32/SDL_systhread.c | 3 +- src/thread/win32/SDL_systhread_c.h | 3 +- src/thread/win32/win_ce_semaphore.c | 4 ++- src/timer/win32/SDL_systimer.c | 3 +- src/timer/wince/SDL_systimer.c | 3 +- src/video/wincommon/SDL_lowvideo.h | 3 +- src/video/wincommon/SDL_sysevents.c | 3 +- src/video/wincommon/SDL_sysmouse.c | 3 +- src/video/wincommon/SDL_syswm.c | 3 +- src/video/windib/SDL_dibevents.c | 3 +- src/video/windib/SDL_dibvideo.c | 3 +- src/video/windib/SDL_dibvideo.h | 3 +- src/video/windx5/directx.h | 3 +- 27 files changed, 59 insertions(+), 68 deletions(-) delete mode 100644 include/SDL_windows.h diff --git a/include/SDL_syswm.h b/include/SDL_syswm.h index b3ff754a9..4d66a67e6 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 /* 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 397539724..000000000 --- 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 - -#endif /* _SDL_windows_h */ diff --git a/src/SDL.c b/src/SDL.c index 0c2f6bebf..47368c1b8 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 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 312438422..37fc42498 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 #include #include "SDL_timer.h" diff --git a/src/audio/windx5/directx.h b/src/audio/windx5/directx.h index dfd9ef9f0..d14d6c637 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 #include #ifndef WIN32 #define WIN32 diff --git a/src/cdrom/win32/SDL_syscdrom.c b/src/cdrom/win32/SDL_syscdrom.c index 8cf1a8d51..17d02ddc0 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 #include #include "SDL_cdrom.h" diff --git a/src/joystick/win32/SDL_mmjoystick.c b/src/joystick/win32/SDL_mmjoystick.c index 2be33f917..38a8c7108 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 #include #include diff --git a/src/loadso/win32/SDL_sysloadso.c b/src/loadso/win32/SDL_sysloadso.c index b1ac194df..e7d8a81ee 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 #include "SDL_loadso.h" diff --git a/src/main/win32/SDL_win32_main.c b/src/main/win32/SDL_win32_main.c index 943df00ad..fa4ef2761 100644 --- a/src/main/win32/SDL_win32_main.c +++ b/src/main/win32/SDL_win32_main.c @@ -7,7 +7,8 @@ #include #include -#include "SDL_windows.h" +#define WIN32_LEAN_AND_MEAN +#include #ifdef _WIN32_WCE # define DIR_SEPERATOR TEXT("\\") diff --git a/src/stdlib/SDL_getenv.c b/src/stdlib/SDL_getenv.c index ab996ca35..01fd0ece5 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 /* Note this isn't thread-safe! */ diff --git a/src/stdlib/SDL_malloc.c b/src/stdlib/SDL_malloc.c index 1bfb08baa..37bfff31f 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 #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 c8e2cf494..b9c3bacc6 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 878a8ef2d..da8382927 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 #include "SDL_mutex.h" diff --git a/src/thread/win32/SDL_syssem.c b/src/thread/win32/SDL_syssem.c index 71bd17518..c7a1bfd53 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 #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 85770fe23..968e6b4df 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 #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 2c7dcaa05..906a9586a 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 typedef HANDLE SYS_ThreadHandle; diff --git a/src/thread/win32/win_ce_semaphore.c b/src/thread/win32/win_ce_semaphore.c index 3399a04f0..9db45c439 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 + #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 995e6934b..e78884a21 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 #include #include "SDL_timer.h" diff --git a/src/timer/wince/SDL_systimer.c b/src/timer/wince/SDL_systimer.c index 86cf7a393..da4297f98 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 #include #include "SDL_timer.h" diff --git a/src/video/wincommon/SDL_lowvideo.h b/src/video/wincommon/SDL_lowvideo.h index dbe3ef00c..08e10bd5a 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 #include "../SDL_sysvideo.h" diff --git a/src/video/wincommon/SDL_sysevents.c b/src/video/wincommon/SDL_sysevents.c index 6e3ca6477..1f7b32995 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 #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 24ccb0107..f7138eda0 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 #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 4cc085c69..85046b12a 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 #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 03f410b85..25986495c 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 #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 672c46826..2b1358b0f 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 #if defined(_WIN32_WCE) diff --git a/src/video/windib/SDL_dibvideo.h b/src/video/windib/SDL_dibvideo.h index 7a02b8611..99f9b9a6d 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 /* for PDA */ typedef enum diff --git a/src/video/windx5/directx.h b/src/video/windx5/directx.h index dfd9ef9f0..d14d6c637 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 #include #ifndef WIN32 #define WIN32