meson/mesa/wide: define WIN32_LEAN_AND_MEAN with pre_args

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18425>
This commit is contained in:
Yonggang Luo 2022-09-06 17:32:29 +08:00 committed by Marge Bot
parent 2f140c564f
commit b6e4aa6f31
11 changed files with 5 additions and 24 deletions

View File

@ -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)

View File

@ -37,9 +37,6 @@
#include "threads_win32.h"
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#include <windows.h>
/*

View File

@ -34,9 +34,6 @@
#if defined(_WIN32) && !defined(__CYGWIN__)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#include <windows.h>
int

View File

@ -43,9 +43,6 @@
#endif
#if defined(PIPE_OS_WINDOWS)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#include <windows.h>
#endif

View File

@ -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

View File

@ -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 : [

View File

@ -24,6 +24,7 @@
#include <gtest/gtest.h>
#include <windows.h>
#include <unknwn.h>
#include <GL/gl.h>
#undef GetMessage

View File

@ -1,9 +1,5 @@
#include "dxil_validator.h"
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#include <windows.h>
#include <unknwn.h>

View File

@ -31,9 +31,6 @@
#include <stdbool.h>
#include <stdio.h>
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#include <windows.h>
#endif

View File

@ -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 <windows.h>
#include <stdio.h>
#include <stdlib.h>

View File

@ -50,9 +50,6 @@
#if DETECT_OS_LINUX && !defined(ANDROID)
#include <sched.h>
#elif defined(_WIN32) && !defined(__CYGWIN__) && _WIN32_WINNT >= 0x0600
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#include <windows.h>
#endif