diff --git a/meson.build b/meson.build index 9f7db50225f..ce2ec7a79c8 100644 --- a/meson.build +++ b/meson.build @@ -1617,6 +1617,10 @@ elif host_machine.system() != 'windows' else dep_expat = null_dep endif +# Predefined macros for windows +if host_machine.system() == 'windows' + pre_args += '-DWIN32_LEAN_AND_MEAN' # http://msdn2.microsoft.com/en-us/library/6dwk3a1z.aspx +endif # this only exists on linux so either this is linux and it will be found, or # it's not linux and wont dep_m = cc.find_library('m', required : false) diff --git a/src/c11/impl/threads_win32.c b/src/c11/impl/threads_win32.c index e8f79b4e12c..eb818d96967 100644 --- a/src/c11/impl/threads_win32.c +++ b/src/c11/impl/threads_win32.c @@ -37,9 +37,6 @@ #include "threads_win32.h" -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif #include /* diff --git a/src/c11/impl/time.c b/src/c11/impl/time.c index ae82940d8f0..ebbb5ceac2d 100644 --- a/src/c11/impl/time.c +++ b/src/c11/impl/time.c @@ -34,9 +34,6 @@ #if defined(_WIN32) && !defined(__CYGWIN__) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif #include int diff --git a/src/gallium/auxiliary/rtasm/rtasm_execmem.c b/src/gallium/auxiliary/rtasm/rtasm_execmem.c index 58b1db32379..7fd834eb708 100644 --- a/src/gallium/auxiliary/rtasm/rtasm_execmem.c +++ b/src/gallium/auxiliary/rtasm/rtasm_execmem.c @@ -43,9 +43,6 @@ #endif #if defined(PIPE_OS_WINDOWS) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif #include #endif diff --git a/src/gallium/frontends/osmesa/meson.build b/src/gallium/frontends/osmesa/meson.build index fe78a4daa31..8abf55c02e4 100644 --- a/src/gallium/frontends/osmesa/meson.build +++ b/src/gallium/frontends/osmesa/meson.build @@ -20,7 +20,6 @@ osmesa_st_c_args = [] if with_platform_windows - osmesa_st_c_args += ['-DWIN32_LEAN_AND_MEAN'] if not with_shared_glapi osmesa_st_c_args += ['-D_GLAPI_NO_EXPORTS'] endif diff --git a/src/gallium/frontends/wgl/meson.build b/src/gallium/frontends/wgl/meson.build index 340e9cf0dd9..40a93ad363a 100644 --- a/src/gallium/frontends/wgl/meson.build +++ b/src/gallium/frontends/wgl/meson.build @@ -47,7 +47,6 @@ libwgl = static_library( ), c_args : [ '-D_GDI32_', # prevent wgl* being declared __declspec(dllimport) - '-DWIN32_LEAN_AND_MEAN', # http://msdn2.microsoft.com/en-us/library/6dwk3a1z.aspx _c_args_wgl ], include_directories : [ diff --git a/src/gallium/targets/libgl-gdi/tests/wgl_tests.cpp b/src/gallium/targets/libgl-gdi/tests/wgl_tests.cpp index f6d56ba3fe7..514507d13f4 100644 --- a/src/gallium/targets/libgl-gdi/tests/wgl_tests.cpp +++ b/src/gallium/targets/libgl-gdi/tests/wgl_tests.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #undef GetMessage diff --git a/src/microsoft/compiler/dxil_validator.cpp b/src/microsoft/compiler/dxil_validator.cpp index 85a0621dcc8..cda43ca7939 100644 --- a/src/microsoft/compiler/dxil_validator.cpp +++ b/src/microsoft/compiler/dxil_validator.cpp @@ -1,9 +1,5 @@ #include "dxil_validator.h" -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif - #include #include diff --git a/src/util/memstream.h b/src/util/memstream.h index 0bed1132559..2d4be8257c1 100644 --- a/src/util/memstream.h +++ b/src/util/memstream.h @@ -31,9 +31,6 @@ #include #include #ifdef _WIN32 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif #include #endif diff --git a/src/util/os_misc.c b/src/util/os_misc.c index 90c51408fe6..61e9746c8ff 100644 --- a/src/util/os_misc.c +++ b/src/util/os_misc.c @@ -35,9 +35,6 @@ #if DETECT_OS_WINDOWS -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#endif #include #include #include diff --git a/src/util/u_thread.h b/src/util/u_thread.h index ec30eb4f478..38f6808f3a0 100644 --- a/src/util/u_thread.h +++ b/src/util/u_thread.h @@ -50,9 +50,6 @@ #if DETECT_OS_LINUX && !defined(ANDROID) #include #elif defined(_WIN32) && !defined(__CYGWIN__) && _WIN32_WINNT >= 0x0600 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif #include #endif