From 178ac7432d750904a5f824622bd762f5ed6aa4fd Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 24 Feb 2015 12:47:54 +0100 Subject: [PATCH] Remove redundant windows.h includes in NLMISC --- code/nel/include/nel/misc/dummy_window.h | 12 ++++++++++++ .../nel/include/nel/misc/inter_window_msg_queue.h | 12 ++++++++++++ code/nel/include/nel/misc/win_displayer.h | 12 ++++++++++-- code/nel/src/misc/co_task.cpp | 15 +-------------- code/nel/src/misc/common.cpp | 4 ---- code/nel/src/misc/log.cpp | 4 ---- code/nel/src/misc/mem_displayer.cpp | 4 ---- code/nel/src/misc/path.cpp | 4 ---- code/nel/src/misc/report.cpp | 4 ---- code/nel/src/misc/shared_memory.cpp | 7 +------ code/nel/src/misc/stdmisc.h | 1 + code/nel/src/misc/system_info.cpp | 4 ---- code/nel/src/misc/system_utils.cpp | 5 ----- code/nel/src/misc/time_nl.cpp | 7 +------ code/nel/src/misc/win32_util.cpp | 2 -- code/nel/src/misc/win_displayer.cpp | 4 ---- code/nel/src/misc/win_event_emitter.cpp | 4 ---- 17 files changed, 38 insertions(+), 67 deletions(-) diff --git a/code/nel/include/nel/misc/dummy_window.h b/code/nel/include/nel/misc/dummy_window.h index bd205f0a0..66d9345ba 100644 --- a/code/nel/include/nel/misc/dummy_window.h +++ b/code/nel/include/nel/misc/dummy_window.h @@ -22,6 +22,18 @@ #ifdef NL_OS_WINDOWS // for win32 os only +#ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif +#ifndef _WIN32_WINDOWS +# define _WIN32_WINDOWS 0x0410 +#endif +#ifndef WINVER +# define WINVER 0x0400 +#endif +#ifndef NOMINMAX +# define NOMINMAX +#endif #include diff --git a/code/nel/include/nel/misc/inter_window_msg_queue.h b/code/nel/include/nel/misc/inter_window_msg_queue.h index 02867f8b4..4ab5bef4e 100644 --- a/code/nel/include/nel/misc/inter_window_msg_queue.h +++ b/code/nel/include/nel/misc/inter_window_msg_queue.h @@ -27,6 +27,18 @@ #include "nel/misc/mem_stream.h" #include "nel/misc/dummy_window.h" +#ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif +#ifndef _WIN32_WINDOWS +# define _WIN32_WINDOWS 0x0410 +#endif +#ifndef WINVER +# define WINVER 0x0400 +#endif +#ifndef NOMINMAX +# define NOMINMAX +#endif #include namespace NLMISC diff --git a/code/nel/include/nel/misc/win_displayer.h b/code/nel/include/nel/misc/win_displayer.h index 934a6e990..f7a5e55e1 100644 --- a/code/nel/include/nel/misc/win_displayer.h +++ b/code/nel/include/nel/misc/win_displayer.h @@ -21,8 +21,16 @@ #ifdef NL_OS_WINDOWS -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#ifndef NL_COMP_MINGW +#ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif +#ifndef _WIN32_WINDOWS +# define _WIN32_WINDOWS 0x0410 +#endif +#ifndef WINVER +# define WINVER 0x0400 +#endif +#ifndef NOMINMAX # define NOMINMAX #endif #include diff --git a/code/nel/src/misc/co_task.cpp b/code/nel/src/misc/co_task.cpp index d238b4853..97a9e1e23 100644 --- a/code/nel/src/misc/co_task.cpp +++ b/code/nel/src/misc/co_task.cpp @@ -43,20 +43,7 @@ #else //NL_USE_THREAD_COTASK // some platform specifics #if defined (NL_OS_WINDOWS) -//# define _WIN32_WINNT 0x0500 -# define NL_WIN_CALLBACK CALLBACK -// Visual .NET won't allow Fibers for a Windows version older than 2000. However the basic features are sufficient for us, we want to compile them for all Windows >= 95 -# if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0400) -# ifdef _WIN32_WINNT -# undef _WIN32_WINNT -# endif -# define _WIN32_WINNT 0x0400 -# endif - -# ifndef NL_COMP_MINGW -# define NOMINMAX -# endif -# include +# define NL_WIN_CALLBACK CALLBACK #elif defined (NL_OS_UNIX) # define NL_WIN_CALLBACK # include diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index 31ad7edb0..e8bec1e92 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -20,10 +20,6 @@ #include "nel/misc/common.h" #ifdef NL_OS_WINDOWS -# ifndef NL_COMP_MINGW -# define NOMINMAX -# endif -# include # include # include #elif defined NL_OS_UNIX diff --git a/code/nel/src/misc/log.cpp b/code/nel/src/misc/log.cpp index 478a5e338..f0e3e36f8 100644 --- a/code/nel/src/misc/log.cpp +++ b/code/nel/src/misc/log.cpp @@ -19,11 +19,7 @@ #include "nel/misc/log.h" #ifdef NL_OS_WINDOWS -# ifndef NL_COMP_MINGW -# define NOMINMAX -# endif # include -# include #else # include #endif diff --git a/code/nel/src/misc/mem_displayer.cpp b/code/nel/src/misc/mem_displayer.cpp index fc5681657..0aaac26cc 100644 --- a/code/nel/src/misc/mem_displayer.cpp +++ b/code/nel/src/misc/mem_displayer.cpp @@ -24,10 +24,6 @@ #include "nel/misc/debug.h" #ifdef NL_OS_WINDOWS -# ifndef NL_COMP_MINGW -# define NOMINMAX -# endif -# include # include # pragma comment(lib, "imagehlp.lib") # ifdef NL_OS_WIN64 diff --git a/code/nel/src/misc/path.cpp b/code/nel/src/misc/path.cpp index f593f695d..71d57104a 100644 --- a/code/nel/src/misc/path.cpp +++ b/code/nel/src/misc/path.cpp @@ -25,10 +25,6 @@ #include "nel/misc/xml_pack.h" #ifdef NL_OS_WINDOWS -# ifndef NL_COMP_MINGW -# define NOMINMAX -# endif -# include # include # include # include diff --git a/code/nel/src/misc/report.cpp b/code/nel/src/misc/report.cpp index 20b2b1c11..15d8a8287 100644 --- a/code/nel/src/misc/report.cpp +++ b/code/nel/src/misc/report.cpp @@ -23,10 +23,6 @@ #include "nel/misc/path.h" #ifdef NL_OS_WINDOWS -# ifndef NL_COMP_MINGW -# define NOMINMAX -# endif -# include # include # include #endif // NL_OS_WINDOWS diff --git a/code/nel/src/misc/shared_memory.cpp b/code/nel/src/misc/shared_memory.cpp index 7b11fea52..3afe795f1 100644 --- a/code/nel/src/misc/shared_memory.cpp +++ b/code/nel/src/misc/shared_memory.cpp @@ -19,12 +19,7 @@ #include "nel/misc/shared_memory.h" #include "nel/misc/debug.h" -#ifdef NL_OS_WINDOWS -# ifndef NL_COMP_MINGW -# define NOMINMAX -# endif -# include -#else +#ifndef NL_OS_WINDOWS # include # include # include diff --git a/code/nel/src/misc/stdmisc.h b/code/nel/src/misc/stdmisc.h index 37284511c..186a0fccd 100644 --- a/code/nel/src/misc/stdmisc.h +++ b/code/nel/src/misc/stdmisc.h @@ -43,6 +43,7 @@ #include #ifdef _WIN32 +# define WIN32_LEAN_AND_MEAN # define _WIN32_WINDOWS 0x0410 # ifndef NL_COMP_MINGW # define WINVER 0x0400 diff --git a/code/nel/src/misc/system_info.cpp b/code/nel/src/misc/system_info.cpp index 31cde5283..8524939c8 100644 --- a/code/nel/src/misc/system_info.cpp +++ b/code/nel/src/misc/system_info.cpp @@ -19,10 +19,6 @@ #include "nel/misc/system_info.h" #ifdef NL_OS_WINDOWS -# ifndef NL_COMP_MINGW -# define NOMINMAX -# endif -# include # include # include # include diff --git a/code/nel/src/misc/system_utils.cpp b/code/nel/src/misc/system_utils.cpp index a66eed02f..f53f6822e 100644 --- a/code/nel/src/misc/system_utils.cpp +++ b/code/nel/src/misc/system_utils.cpp @@ -18,11 +18,6 @@ #include "nel/misc/system_utils.h" #ifdef NL_OS_WINDOWS - #ifndef NL_COMP_MINGW - #define NOMINMAX - #endif - #include - #ifdef _WIN32_WINNT_WIN7 // only supported by Windows 7 Platform SDK #include diff --git a/code/nel/src/misc/time_nl.cpp b/code/nel/src/misc/time_nl.cpp index 8aacbd002..821e4b397 100644 --- a/code/nel/src/misc/time_nl.cpp +++ b/code/nel/src/misc/time_nl.cpp @@ -20,12 +20,7 @@ #include "nel/misc/sstring.h" #include "nel/misc/thread.h" -#ifdef NL_OS_WINDOWS -# ifndef NL_COMP_MINGW -# define NOMINMAX -# endif -# include -#elif defined (NL_OS_UNIX) +#if defined (NL_OS_UNIX) # include # include #endif diff --git a/code/nel/src/misc/win32_util.cpp b/code/nel/src/misc/win32_util.cpp index 63315e1b2..6085e98e5 100644 --- a/code/nel/src/misc/win32_util.cpp +++ b/code/nel/src/misc/win32_util.cpp @@ -20,8 +20,6 @@ #ifdef NL_OS_WINDOWS -#include - #ifdef DEBUG_NEW #define new DEBUG_NEW #endif diff --git a/code/nel/src/misc/win_displayer.cpp b/code/nel/src/misc/win_displayer.cpp index 95b6b34cf..a91f64b4d 100644 --- a/code/nel/src/misc/win_displayer.cpp +++ b/code/nel/src/misc/win_displayer.cpp @@ -18,10 +18,6 @@ #include "nel/misc/win_displayer.h" #ifdef NL_OS_WINDOWS -#ifndef NL_COMP_MINGW -# define NOMINMAX -#endif -#include #include #include #include diff --git a/code/nel/src/misc/win_event_emitter.cpp b/code/nel/src/misc/win_event_emitter.cpp index 01da89564..67e426f1e 100644 --- a/code/nel/src/misc/win_event_emitter.cpp +++ b/code/nel/src/misc/win_event_emitter.cpp @@ -22,10 +22,6 @@ #include "nel/misc/event_server.h" #ifdef NL_OS_WINDOWS -#ifndef NL_COMP_MINGW -#define NOMINMAX -#endif -#include #include /**