[gjs/master.msvc: 3/8] build: Define WIN32_LEAN_AND_MEAN on Windows builds




commit ad52fd19d1b662a5f0bf8a79ecae5b7351b2aa21
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Jul 7 17:45:37 2021 +0800

    build: Define WIN32_LEAN_AND_MEAN on Windows builds
    
    This will fix the build by avoiding collisions with the Windows headers
    when we use 'interface' in mem-private.h, as that is typically used in
    COM programming on Windows.
    
    Clean up the sources a bit by removing the #define WIN32_LEAN_AND_MEAN
    as they are no longer needed in the sources as a result.

 gjs/context.cpp    | 1 -
 gjs/engine.cpp     | 1 -
 gjs/importer.cpp   | 1 -
 gjs/jsapi-util.cpp | 1 -
 meson.build        | 2 +-
 5 files changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/gjs/context.cpp b/gjs/context.cpp
index 894e39df..30abf900 100644
--- a/gjs/context.cpp
+++ b/gjs/context.cpp
@@ -29,7 +29,6 @@
 #include <glib.h>
 
 #ifdef G_OS_WIN32
-#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #endif
 
diff --git a/gjs/engine.cpp b/gjs/engine.cpp
index ec8ca26a..0977bca8 100644
--- a/gjs/engine.cpp
+++ b/gjs/engine.cpp
@@ -7,7 +7,6 @@
 #include <stdint.h>
 
 #ifdef _WIN32
-#    define WIN32_LEAN_AND_MEAN
 #    include <windows.h>
 #endif
 
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
index 5076ce9a..1d41a7e2 100644
--- a/gjs/importer.cpp
+++ b/gjs/importer.cpp
@@ -7,7 +7,6 @@
 #include <string.h>  // for size_t, strcmp, strlen
 
 #ifdef _WIN32
-#    define WIN32_LEAN_AND_MEAN
 #    include <windows.h>
 #endif
 
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index 4024d086..cb4f24f2 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -9,7 +9,6 @@
 #include <string.h>  // for strlen
 
 #ifdef _WIN32
-#    define WIN32_LEAN_AND_MEAN
 #    include <windows.h>
 #endif
 
diff --git a/meson.build b/meson.build
index 8db5a9c1..b97ad9e3 100644
--- a/meson.build
+++ b/meson.build
@@ -491,7 +491,7 @@ libgjs_cpp_args += ['-DG_LOG_DOMAIN="Gjs"']
 
 if host_machine.system() == 'windows'
     # We need these defines to build properly for all Windows builds
-    libgjs_cpp_args += ['-DWIN32', '-DXP_WIN']
+    libgjs_cpp_args += ['-DWIN32', '-DXP_WIN', '-DWIN32_LEAN_AND_MEAN']
 endif
 
 pch_headers = ['gjs/gjs_pch.hh']


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]