diff --git a/source/audiolib/src/driver_directsound.cpp b/source/audiolib/src/driver_directsound.cpp index 0770265b0..b1a5fc56c 100644 --- a/source/audiolib/src/driver_directsound.cpp +++ b/source/audiolib/src/driver_directsound.cpp @@ -22,13 +22,10 @@ * DirectSound output driver for MultiVoc */ -#define WIN32_LEAN_AND_MEAN -#define DIRECTSOUND_VERSION 0x0800 -#define CINTERFACE +#define NEED_MMSYSTEM_H +#define NEED_DSOUND_H +#include "windows_inc.h" -#include -#include -#include "dx/dsound.h" #include #include diff --git a/source/build/include/cache1d.h b/source/build/include/cache1d.h index 9321ee4ec..b361eb31a 100644 --- a/source/build/include/cache1d.h +++ b/source/build/include/cache1d.h @@ -4,7 +4,6 @@ #define cache1d_h_ #include "compat.h" -#include "mutex.h" #ifdef __cplusplus extern "C" { diff --git a/source/build/include/compat.h b/source/build/include/compat.h index 56b26986b..cb9c05f76 100644 --- a/source/build/include/compat.h +++ b/source/build/include/compat.h @@ -28,6 +28,7 @@ # define __has_extension __has_feature // Compatibility with pre-3.0 compilers. #endif +// XXX: only to avoid warning C4005: macro redefinition in winnt.h #if !defined(_MSC_VER) || _MSC_FULL_VER < 180031101 #ifdef UNREFERENCED_PARAMETER #undef UNREFERENCED_PARAMETER @@ -87,9 +88,9 @@ # include #endif -#ifdef _WIN32 -# define WIN32_LEAN_AND_MEAN -# include +// XXX: see UNREFERENCED_PARAMETER +#if defined _MSC_VER && _MSC_FULL_VER >= 180031101 +# include "windows_inc.h" #endif #ifdef __APPLE__ diff --git a/source/build/include/glbuild.h b/source/build/include/glbuild.h index b933666b8..e68f4aeda 100644 --- a/source/build/include/glbuild.h +++ b/source/build/include/glbuild.h @@ -11,9 +11,9 @@ # define USE_GLEXT #endif +// include this before glext does #ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN -#include +# include "windows_inc.h" #endif // Tell gl.h to not include glext.h, we'll include our own copy in a minute diff --git a/source/build/include/mutex.h b/source/build/include/mutex.h index 2dbb05e35..ba9c51d32 100644 --- a/source/build/include/mutex.h +++ b/source/build/include/mutex.h @@ -4,8 +4,7 @@ /* Mutual exclusion mechanism wrappers for the different platforms */ #ifdef RENDERTYPEWIN -# include -# include +# include "windows_inc.h" #else # define SDL_MAIN_HANDLED # include "sdl_inc.h" diff --git a/source/build/include/sdl_inc.h b/source/build/include/sdl_inc.h index ff783892f..e77e64b69 100644 --- a/source/build/include/sdl_inc.h +++ b/source/build/include/sdl_inc.h @@ -1,6 +1,11 @@ #ifndef SDL_INC_H_ #define SDL_INC_H_ +// include this before SDL does +#ifdef _WIN32 +# include "windows_inc.h" +#endif + // Workaround for i686-MinGW-w64. #if defined __MINGW64_VERSION_MAJOR && !defined __MINGW64__ # define __MINGW64_VERSION_MAJOR_BACKUP __MINGW64_VERSION_MAJOR diff --git a/source/build/include/windows_inc.h b/source/build/include/windows_inc.h new file mode 100644 index 000000000..0bcca5d82 --- /dev/null +++ b/source/build/include/windows_inc.h @@ -0,0 +1,122 @@ +// Wrapper for all Windows headers. +// No include guard for this file. + +#ifndef _WIN32_IE +# define _WIN32_IE 0x0501 +#endif + +#ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0501 +#endif + +#ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif + +#ifdef NEED_WINSOCK2_H +# include +# undef NEED_WINSOCK2_H +#endif + +#include + +#ifdef NEED_WINDOWSX_H +# include +# undef NEED_WINDOWSX_H +#endif + +#ifdef NEED_PROCESS_H +# include +# undef NEED_PROCESS_H +#endif + +#ifdef NEED_SHELLAPI_H +# include +# undef NEED_SHELLAPI_H +#endif + +#ifdef NEED_WS2TCPIP_H +# include +# undef NEED_WS2TCPIP_H +#endif + +#ifdef NEED_COMMCTRL_H +# include +# undef NEED_COMMCTRL_H +#endif + +#ifdef NEED_MMSYSTEM_H +# include +# undef NEED_MMSYSTEM_H +#endif + +#ifdef NEED_DDRAW_H +# define DIRECTDRAW_VERSION 0x0600 +# ifndef CINTERFACE +# define CINTERFACE +# endif +# include "dx/ddraw.h" +# undef NEED_DDRAW_H +#endif + +#ifdef NEED_DINPUT_H +# define INITGUID +# define DIRECTINPUT_VERSION 0x0700 +# ifndef CINTERFACE +# define CINTERFACE +# endif +# include "dx/dinput.h" +# undef NEED_DINPUT_H + +# if defined (_MSC_VER) || !defined(__cplusplus) +# define bDIPROP_BUFFERSIZE MAKEDIPROP(1) +# define bDIPROP_DEADZONE MAKEDIPROP(5) +# define bDIPROP_SATURATION MAKEDIPROP(6) +# else +# define bMAKEDIPROP(prop) ((REFGUID)(prop)) +# define bDIPROP_BUFFERSIZE bMAKEDIPROP(1) +# define bDIPROP_DEADZONE bMAKEDIPROP(5) +# define bDIPROP_SATURATION bMAKEDIPROP(6) +# endif + +# if defined (_MSC_VER) && defined(__cplusplus) +# define bREFGUID (REFGUID) +# define bREFIID (REFIID) +# else +# define bREFGUID & +# define bREFIID & +# endif + +# ifndef DIK_PAUSE +# define DIK_PAUSE 0xC5 +# endif + +#endif + +#ifdef NEED_DSOUND_H +# define DIRECTSOUND_VERSION 0x0800 +# ifndef CINTERFACE +# define CINTERFACE +# endif +# include "dx/dsound.h" +# undef NEED_DSOUND_H +#endif + +#ifdef NEED_CRTDBG_H +# include +# undef NEED_CRTDBG_H +#endif + +#ifdef NEED_DBGHELP_H +# if defined _MSC_VER && _MSC_VER < 1300 +# define DECLSPEC_DEPRECATED +// VC6: change this path to your Platform SDK headers. +// must be XP version of file +// # include "M:\\dev7\\vs\\devtools\\common\\win32sdk\\include\\dbghelp.h" +# error "VC6 needs an updated dbghelp.h; see source" +# else +// VC7: ships with updated headers +# include +# endif +# undef NEED_DBGHELP_H +#endif diff --git a/source/build/include/winlayer.h b/source/build/include/winlayer.h index 1abc30250..d8e7305a9 100644 --- a/source/build/include/winlayer.h +++ b/source/build/include/winlayer.h @@ -4,8 +4,7 @@ #ifndef build_interface_layer_ #define build_interface_layer_ WIN -#define WIN32_LEAN_AND_MEAN -#include +#include "windows_inc.h" extern uint32_t maxrefreshfreq; diff --git a/source/build/src/baselayer.cpp b/source/build/src/baselayer.cpp index 1b91e7892..cc27fb312 100644 --- a/source/build/src/baselayer.cpp +++ b/source/build/src/baselayer.cpp @@ -153,10 +153,7 @@ void readjoybstatus(int32_t *b) *b = joyb; } -#if defined _WIN32 -# define WIN32_LEAN_AND_MEAN -# include -#elif defined __linux || defined EDUKE32_BSD || defined __APPLE__ +#if defined __linux || defined EDUKE32_BSD || defined __APPLE__ # include #endif diff --git a/source/build/src/cache1d.cpp b/source/build/src/cache1d.cpp index e0bf247e5..98b8b4aa2 100644 --- a/source/build/src/cache1d.cpp +++ b/source/build/src/cache1d.cpp @@ -30,7 +30,8 @@ #include "compat.h" #ifdef _WIN32 // for FILENAME_CASE_CHECK -# include +# define NEED_SHELLAPI_H +# include "windows_inc.h" #endif #include "cache1d.h" #include "pragmas.h" diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 1545f1b7f..5e9450070 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -29,10 +29,6 @@ # endif # include "hightile.h" # include "polymost.h" -# ifdef _WIN32 -# define WIN32_LEAN_AND_MEAN -# include -# endif #endif #include // pow diff --git a/source/build/src/kplib.cpp b/source/build/src/kplib.cpp index aba2fa864..35b01e850 100644 --- a/source/build/src/kplib.cpp +++ b/source/build/src/kplib.cpp @@ -63,11 +63,6 @@ static __inline int32_t _lrotl(int32_t i, int sh) { return (i >> (-sh)) | (i << #endif #endif -#if defined(_WIN32) -#define WIN32_LEAN_AND_MEAN -#include -#endif - #ifndef O_BINARY #define O_BINARY 0 #endif diff --git a/source/build/src/mutex.cpp b/source/build/src/mutex.cpp index 9d6e4ed6f..5e22cad25 100644 --- a/source/build/src/mutex.cpp +++ b/source/build/src/mutex.cpp @@ -1,4 +1,10 @@ #include "compat.h" + +#ifdef _WIN32 +# define NEED_PROCESS_H +# include "windows_inc.h" +#endif + #include "mutex.h" int32_t mutex_init(mutex_t *mutex) diff --git a/source/build/src/rawinput.cpp b/source/build/src/rawinput.cpp index eb5a42848..0be1aeb1c 100644 --- a/source/build/src/rawinput.cpp +++ b/source/build/src/rawinput.cpp @@ -1,7 +1,7 @@ -#define WIN32_LEAN_AND_MEAN -#define _WIN32_WINNT 0x0501 + +#include "windows_inc.h" + #include -#include #include "rawinput.h" #include "winlayer.h" #include "scancodes.h" diff --git a/source/build/src/sdlayer.cpp b/source/build/src/sdlayer.cpp index c8159a200..b8ad36e8c 100644 --- a/source/build/src/sdlayer.cpp +++ b/source/build/src/sdlayer.cpp @@ -27,8 +27,6 @@ #endif #if defined _WIN32 -# define WIN32_LEAN_AND_MEAN -# include # include "winbits.h" #endif #if defined __APPLE__ diff --git a/source/build/src/startwin.editor.cpp b/source/build/src/startwin.editor.cpp index 2b8812e48..6b089b79a 100644 --- a/source/build/src/startwin.editor.cpp +++ b/source/build/src/startwin.editor.cpp @@ -3,6 +3,11 @@ #endif #include "compat.h" + +#define NEED_WINDOWSX_H +#define NEED_COMMCTRL_H +#include "windows_inc.h" + #include "renderlayer.h" #ifdef STARTUP_SETUP_WINDOW @@ -11,15 +16,6 @@ #include "editor.h" #include "winlayer.h" -#define WIN32_LEAN_AND_MEAN -#include -#include -#ifndef _WIN32_IE -#define _WIN32_IE 0x0300 -#endif -#include -#include - #include "startwin.editor.h" #define TAB_CONFIG 0 diff --git a/source/build/src/winlayer.cpp b/source/build/src/winlayer.cpp index 153631559..adb8424fd 100644 --- a/source/build/src/winlayer.cpp +++ b/source/build/src/winlayer.cpp @@ -1,17 +1,18 @@ // Windows DIB/DirectDraw interface layer for the Build Engine // Originally by Jonathon Fowler (jf@jonof.id.au) -#define DIRECTINPUT_VERSION 0x0700 -#define DIRECTDRAW_VERSION 0x0600 -#define _WIN32_WINNT 0x0501 -#define WIN32_LEAN_AND_MEAN -#define CINTERFACE - -#include #include #include #include "build.h" + +#define NEED_DINPUT_H +#define NEED_DDRAW_H +#ifdef _MSC_VER +# define NEED_CRTDBG_H +#endif +#include "windows_inc.h" + #include "winlayer.h" #include "rawinput.h" #include "mutex.h" @@ -19,38 +20,6 @@ #include "winbits.h" #include "engine_priv.h" -#include "dx/ddraw.h" -#include "dx/dinput.h" - -#ifdef _MSC_VER -#include -#endif - -// bug in the dx headers -#if defined (_MSC_VER) || !defined(__cplusplus) -#define bDIPROP_BUFFERSIZE MAKEDIPROP(1) -#define bDIPROP_DEADZONE MAKEDIPROP(5) -#define bDIPROP_SATURATION MAKEDIPROP(6) -#else -#define bMAKEDIPROP(prop) ((REFGUID)(prop)) -#define bDIPROP_BUFFERSIZE bMAKEDIPROP(1) -#define bDIPROP_DEADZONE bMAKEDIPROP(5) -#define bDIPROP_SATURATION bMAKEDIPROP(6) -#endif - -// wtf, Microsoft? -#if defined (_MSC_VER) && defined(__cplusplus) -# define bREFGUID (REFGUID) -# define bREFIID (REFIID) -#else -# define bREFGUID & -# define bREFIID & -#endif - -#ifndef DIK_PAUSE -# define DIK_PAUSE 0xC5 -#endif - #include "dxdidf.h" // comment this out if c_dfDI* is being reported as multiply defined #define __STDC_FORMAT_MACROS diff --git a/source/duke3d/rsrc/buildres.rc b/source/duke3d/rsrc/buildres.rc index c5f877a7f..4e0ef839b 100644 --- a/source/duke3d/rsrc/buildres.rc +++ b/source/duke3d/rsrc/buildres.rc @@ -1,5 +1,5 @@ -#include -#include +#define NEED_COMMCTRL_H +#include "windows_inc.h" #include "startwin.editor.h" RSRC_ICON ICON "build_icon.ico" diff --git a/source/duke3d/rsrc/gameres.rc b/source/duke3d/rsrc/gameres.rc index 15bee1406..962225021 100644 --- a/source/duke3d/rsrc/gameres.rc +++ b/source/duke3d/rsrc/gameres.rc @@ -1,5 +1,5 @@ -#include -#include +#define NEED_COMMCTRL_H +#include "windows_inc.h" #include "startwin.game.h" RSRC_ICON ICON "game_icon.ico" diff --git a/source/duke3d/src/astub.cpp b/source/duke3d/src/astub.cpp index c7986b272..256f4d8b4 100644 --- a/source/duke3d/src/astub.cpp +++ b/source/duke3d/src/astub.cpp @@ -64,12 +64,6 @@ extern const char *s_buildRev; extern const char *s_buildTimestamp; extern const char *s_buildInfo; -#ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN -#include -#include -#endif - #include // Workaround for namespace pollution in introduced in MinGW 4.8. diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index e34fe1504..2b84c0a0d 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -30,12 +30,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "osd.h" -#ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN -#include -#include -#endif - #define NUMKEYWORDS (int32_t)ARRAY_SIZE(keyw) #define NUMALTKEYWORDS (int32_t)ARRAY_SIZE(altkeyw) diff --git a/source/duke3d/src/mdump.cpp b/source/duke3d/src/mdump.cpp index b2092690f..745f8ba66 100644 --- a/source/duke3d/src/mdump.cpp +++ b/source/duke3d/src/mdump.cpp @@ -1,5 +1,12 @@ -#include + #include "mdump.h" + +#include + +#include +#include +#include + #include LPCSTR MiniDumper::m_szAppName; diff --git a/source/duke3d/src/mdump.h b/source/duke3d/src/mdump.h index be2f8eee7..c76db7c8e 100644 --- a/source/duke3d/src/mdump.h +++ b/source/duke3d/src/mdump.h @@ -1,15 +1,7 @@ -#define _WIN32_WINNT 0x0500 -#include -#include -#include -#if _MSC_VER < 1300 -#define DECLSPEC_DEPRECATED -// VC6: change this path to your Platform SDK headers -#include "M:\\dev7\\vs\\devtools\\common\\win32sdk\\include\\dbghelp.h" // must be XP version of file -#else -// VC7: ships with updated headers -#include "dbghelp.h" -#endif + +#define NEED_DBGHELP_H +#define NEED_MMSYSTEM_H +#include "windows_inc.h" // based on dbghelp.h typedef BOOL (WINAPI *MINIDUMPWRITEDUMP)(HANDLE hProcess, DWORD dwPid, HANDLE hFile, MINIDUMP_TYPE DumpType, diff --git a/source/duke3d/src/midi.cpp b/source/duke3d/src/midi.cpp index c72c247c8..723d78c6c 100644 --- a/source/duke3d/src/midi.cpp +++ b/source/duke3d/src/midi.cpp @@ -41,8 +41,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "pragmas.h" -#define WIN32_LEAN_AND_MEAN -#include +#include "windows_inc.h" extern int32_t MUSIC_SoundDevice; diff --git a/source/duke3d/src/mpu401.cpp b/source/duke3d/src/mpu401.cpp index a7b677449..a94a5b64d 100644 --- a/source/duke3d/src/mpu401.cpp +++ b/source/duke3d/src/mpu401.cpp @@ -36,9 +36,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "pragmas.h" -#define WIN32_LEAN_AND_MEAN -#include -#include +#define NEED_MMSYSTEM_H +#include "windows_inc.h" static HMIDISTRM hmido = (HMIDISTRM)-1; static MIDIOUTCAPS midicaps; diff --git a/source/duke3d/src/net.h b/source/duke3d/src/net.h index fe28e887d..98f05b1c8 100644 --- a/source/duke3d/src/net.h +++ b/source/duke3d/src/net.h @@ -23,6 +23,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef netplay_h_ #define netplay_h_ +#ifdef _WIN32 +// include this before enet does +# define NEED_WINSOCK2_H +# include "windows_inc.h" +#endif + #include "enet/enet.h" // net packet specification/compatibility version diff --git a/source/duke3d/src/startwin.game.cpp b/source/duke3d/src/startwin.game.cpp index a84eacc12..9b3c29cdd 100644 --- a/source/duke3d/src/startwin.game.cpp +++ b/source/duke3d/src/startwin.game.cpp @@ -25,6 +25,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #endif #include "compat.h" + +#define NEED_WINDOWSX_H +#define NEED_COMMCTRL_H +#include "windows_inc.h" + #include "renderlayer.h" #ifdef STARTUP_SETUP_WINDOW @@ -34,15 +39,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "grpscan.h" -#define WIN32_LEAN_AND_MEAN -#include -#include -#ifndef _WIN32_IE -#define _WIN32_IE 0x0300 -#endif -#include -#include - #include "startwin.game.h" // for ud diff --git a/source/duke3d/src/winbits.cpp b/source/duke3d/src/winbits.cpp index 8e04f29f0..871498e55 100644 --- a/source/duke3d/src/winbits.cpp +++ b/source/duke3d/src/winbits.cpp @@ -22,15 +22,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN #include "compat.h" -#include -#include -#include -#include -#include -#include -#include + +#define NEED_SHELLAPI_H +#define NEED_WINSOCK2_H +#define NEED_WS2TCPIP_H +#include "windows_inc.h" #include "renderlayer.h" diff --git a/source/kenbuild/rsrc/buildres.rc b/source/kenbuild/rsrc/buildres.rc index 21b60f1a2..8caade098 100644 --- a/source/kenbuild/rsrc/buildres.rc +++ b/source/kenbuild/rsrc/buildres.rc @@ -1,5 +1,5 @@ -#include -#include +#define NEED_COMMCTRL_H +#include "windows_inc.h" #include "startwin.editor.h" RSRC_ICON ICON "build_icon.ico" diff --git a/source/kenbuild/rsrc/gameres.rc b/source/kenbuild/rsrc/gameres.rc index eaac20f35..4fe0e87d2 100644 --- a/source/kenbuild/rsrc/gameres.rc +++ b/source/kenbuild/rsrc/gameres.rc @@ -1,5 +1,5 @@ -#include -#include +#define NEED_COMMCTRL_H +#include "windows_inc.h" #include "startwin.game.h" RSRC_ICON ICON "game_icon.ico" diff --git a/source/kenbuild/src/startwin.game.cpp b/source/kenbuild/src/startwin.game.cpp index a234aafb1..128dd4452 100644 --- a/source/kenbuild/src/startwin.game.cpp +++ b/source/kenbuild/src/startwin.game.cpp @@ -4,16 +4,12 @@ #include "compat.h" #include "build.h" -#include "winlayer.h" -#define WIN32_LEAN_AND_MEAN -#include -#include -#ifndef _WIN32_IE -#define _WIN32_IE 0x0600 -#endif -#include -#include +#define NEED_WINDOWSX_H +#define NEED_COMMCTRL_H +#include "windows_inc.h" + +#include "winlayer.h" #include "startwin.game.h" diff --git a/source/sw/rsrc/buildres.rc b/source/sw/rsrc/buildres.rc index 36268d384..58a9b21e9 100644 --- a/source/sw/rsrc/buildres.rc +++ b/source/sw/rsrc/buildres.rc @@ -1,5 +1,5 @@ -#include -#include +#define NEED_COMMCTRL_H +#include "windows_inc.h" #include "startwin.editor.h" RSRC_ICON ICON "game_icon.ico" diff --git a/source/sw/rsrc/gameres.rc b/source/sw/rsrc/gameres.rc index 60db46ce1..8340dea15 100644 --- a/source/sw/rsrc/gameres.rc +++ b/source/sw/rsrc/gameres.rc @@ -1,5 +1,5 @@ -#include -#include +#define NEED_COMMCTRL_H +#include "windows_inc.h" #include "startwin.game.h" RSRC_ICON ICON "game_icon.ico" diff --git a/source/sw/src/startwin.game.cpp b/source/sw/src/startwin.game.cpp index e80d5b4a2..f98de928b 100644 --- a/source/sw/src/startwin.game.cpp +++ b/source/sw/src/startwin.game.cpp @@ -3,6 +3,11 @@ #endif #include "build.h" + +#define NEED_WINDOWSX_H +#define NEED_COMMCTRL_H +#include "windows_inc.h" + #include "renderlayer.h" #include "common.h" @@ -13,15 +18,6 @@ #include "grpscan.h" -#define WIN32_LEAN_AND_MEAN -#include -#include -#ifndef _WIN32_IE -#define _WIN32_IE 0x0300 -#endif -#include -#include - #include "startwin.game.h" #define TAB_CONFIG 0 diff --git a/source/tools/src/enumdisplay.cpp b/source/tools/src/enumdisplay.cpp index e0e20d413..5a64ef36f 100644 --- a/source/tools/src/enumdisplay.cpp +++ b/source/tools/src/enumdisplay.cpp @@ -1,10 +1,9 @@ -#include -#define WIN32_LEAN_AND_MEAN -#include -#include "dx/ddraw.h" #include "compat.h" +#define NEED_DDRAW_H +#include "windows_inc.h" + #define DEFAULT_OUTPUT_FILE "enumdisplay.txt" HMODULE hDDrawDLL = NULL; diff --git a/source/tools/src/getdxdidf.cpp b/source/tools/src/getdxdidf.cpp index 9cf0acc87..4a4b59c8c 100644 --- a/source/tools/src/getdxdidf.cpp +++ b/source/tools/src/getdxdidf.cpp @@ -1,14 +1,11 @@ // compile with: // gcc -o getdxdidf.exe src\getdxdidf.c -Ic:\mingw32\dx6\include -Lc:\mingw32\dx6\lib -ldxguid -ldinput -mwindows -#define WIN32_LEAN_AND_MEAN -#define INITGUID -#define DIRECTINPUT_VERSION 0x0700 -#include -#include "dx/dinput.h" -#include #include "compat.h" +#define NEED_DINPUT_H +#include "windows_inc.h" + char const * WhatGUID(const GUID *guid) { if (guid == &GUID_XAxis) return "&GUID_XAxis";