[cairo-commit] 2 commits - boilerplate/cairo-boilerplate-win32-printing.c meson.build perf/cairo-perf.c perf/dirent-win32.h src/cairo-misc.c src/cairo-mutex-impl-private.h src/cairo-time.c src/cairo-wgl-context.c src/win32 util/cairo-missing

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jan 12 21:33:21 UTC 2023


 boilerplate/cairo-boilerplate-win32-printing.c |    8 --------
 meson.build                                    |    6 ++++++
 perf/cairo-perf.c                              |    1 -
 perf/dirent-win32.h                            |    1 -
 src/cairo-misc.c                               |    9 ---------
 src/cairo-mutex-impl-private.h                 |    9 ---------
 src/cairo-time.c                               |    1 -
 src/cairo-wgl-context.c                        |    1 -
 src/win32/cairo-win32-debug.c                  |    9 ---------
 src/win32/cairo-win32-device.c                 |    9 ---------
 src/win32/cairo-win32-display-surface.c        |    9 ---------
 src/win32/cairo-win32-font.c                   |    9 ---------
 src/win32/cairo-win32-printing-surface.c       |    9 ---------
 src/win32/cairo-win32-surface.c                |    9 ---------
 src/win32/cairo-win32-system.c                 |    9 ---------
 util/cairo-missing/cairo-missing.h             |    1 -
 16 files changed, 6 insertions(+), 94 deletions(-)

New commits:
commit c80cd3a0c6ba4f16fcf37701c1c527cf47ddca67
Merge: 7698cf546 8520ef522
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Thu Jan 12 21:33:19 2023 +0000

    Merge branch 'defining-windows-version-macros-in-meson-build' into 'master'
    
    Defining Windows version macros in meson.build
    
    See merge request cairo/cairo!404

commit 8520ef522168882b602efa6c322592e0fe56689f
Author: Fujii Hironori <Hironori.Fujii at sony.com>
Date:   Thu Jan 12 06:57:51 2023 +0900

    Defining Windows version macros in meson.build
    
    WINVER and _WIN32_WINNT macros were defined in each source files and
    headers that were including <windows.h>. However, because DirectWrite
    requires new Windows API, some files included <windows.h> without the
    version macros. This inconsistency sometimes caused troubles.
    
    Define the version macros in meson.build.

diff --git a/boilerplate/cairo-boilerplate-win32-printing.c b/boilerplate/cairo-boilerplate-win32-printing.c
index 3d815167f..e8fcdcef5 100644
--- a/boilerplate/cairo-boilerplate-win32-printing.c
+++ b/boilerplate/cairo-boilerplate-win32-printing.c
@@ -26,14 +26,6 @@
  *	    Adrian Johnson <ajohnson at redneon.com>
  */
 
-/* We require Windows 2000 features such as GetDefaultPrinter() */
-#if !defined(WINVER) || (WINVER < 0x0500)
-# define WINVER 0x0500
-#endif
-#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
-# define _WIN32_WINNT 0x0500
-#endif
-
 #include "cairo-boilerplate-private.h"
 #include "cairo-malloc-private.h"
 
diff --git a/meson.build b/meson.build
index 4dedeadee..fb5fd3a49 100644
--- a/meson.build
+++ b/meson.build
@@ -495,6 +495,8 @@ if host_machine.system() == 'darwin' and not get_option('quartz').disabled()
 endif
 
 if host_machine.system() == 'windows'
+  add_project_arguments('-DWIN32_LEAN_AND_MEAN', '-DNOMINMAX', language: ['c', 'cpp'])
+
   win32_extra_deps = [
     cc.find_library('gdi32'),
     cc.find_library('msimg32'),
@@ -545,6 +547,10 @@ if host_machine.system() == 'windows'
     if cpp_compiler.has_header('dwrite_3.h') and cpp_compiler.get_define('__MINGW32__') == ''
       conf.set('HAVE_DWRITE_3_H', 1)
     endif
+
+    add_project_arguments('-DWINVER=_WIN32_WINNT_WIN10', '-D_WIN32_WINNT=_WIN32_WINNT_WIN10', '-DNTDDI_VERSION=NTDDI_WIN10_RS3', language: ['c', 'cpp'])
+  else
+    add_project_arguments('-DWINVER=_WIN32_WINNT_WIN2K', '-D_WIN32_WINNT=_WIN32_WINNT_WIN2K', language: ['c', 'cpp'])
   endif
 endif
 
diff --git a/perf/cairo-perf.c b/perf/cairo-perf.c
index ebef8eb59..244d6cb74 100644
--- a/perf/cairo-perf.c
+++ b/perf/cairo-perf.c
@@ -37,7 +37,6 @@
 #endif
 
 #if defined(_WIN32)
-#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #elif defined(_POSIX_PRIORITY_SCHEDULING)
 #include <sched.h>
diff --git a/perf/dirent-win32.h b/perf/dirent-win32.h
index 0f2ed05e5..435a6cfa2 100644
--- a/perf/dirent-win32.h
+++ b/perf/dirent-win32.h
@@ -26,7 +26,6 @@
 
 #include "cairo-compiler-private.h"
 
-#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
 #define stat _stat
diff --git a/src/cairo-misc.c b/src/cairo-misc.c
index edbd98003..7ac0e8d05 100644
--- a/src/cairo-misc.c
+++ b/src/cairo-misc.c
@@ -976,15 +976,6 @@ _cairo_fopen (const char *filename, const char *mode, FILE **file_out)
 
 #ifdef _WIN32
 
-#define WIN32_LEAN_AND_MEAN
-/* We require Windows 2000 features such as ETO_PDY */
-#if !defined(WINVER) || (WINVER < 0x0500)
-# define WINVER 0x0500
-#endif
-#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
-# define _WIN32_WINNT 0x0500
-#endif
-
 #include <windows.h>
 #include <io.h>
 
diff --git a/src/cairo-mutex-impl-private.h b/src/cairo-mutex-impl-private.h
index de0c9b21b..b9430beef 100644
--- a/src/cairo-mutex-impl-private.h
+++ b/src/cairo-mutex-impl-private.h
@@ -179,15 +179,6 @@
 
 #elif defined(_WIN32) /******************************************************/
 
-#define WIN32_LEAN_AND_MEAN
-/* We require Windows 2000 features such as ETO_PDY */
-#if !defined(WINVER) || (WINVER < 0x0500)
-# define WINVER 0x0500
-#endif
-#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
-# define _WIN32_WINNT 0x0500
-#endif
-
 # include <windows.h>
 
   typedef CRITICAL_SECTION cairo_mutex_impl_t;
diff --git a/src/cairo-time.c b/src/cairo-time.c
index c93205908..05b64e157 100644
--- a/src/cairo-time.c
+++ b/src/cairo-time.c
@@ -62,7 +62,6 @@ _cairo_time_get (void)
 }
 
 #elif _WIN32
-#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
 static cairo_always_inline double
diff --git a/src/cairo-wgl-context.c b/src/cairo-wgl-context.c
index 487237446..b6cd803a0 100644
--- a/src/cairo-wgl-context.c
+++ b/src/cairo-wgl-context.c
@@ -43,7 +43,6 @@
 
 #include "cairo-error-private.h"
 
-#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
 typedef struct _cairo_wgl_context {
diff --git a/src/win32/cairo-win32-debug.c b/src/win32/cairo-win32-debug.c
index 5a971bd61..01410c896 100644
--- a/src/win32/cairo-win32-debug.c
+++ b/src/win32/cairo-win32-debug.c
@@ -37,15 +37,6 @@
  *	Vladimir Vukicevic <vladimir at pobox.com>
  */
 
-#define WIN32_LEAN_AND_MEAN
-/* We require Windows 2000 features such as ETO_PDY */
-#if !defined(WINVER) || (WINVER < 0x0500)
-# define WINVER 0x0500
-#endif
-#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
-# define _WIN32_WINNT 0x0500
-#endif
-
 #include "cairoint.h"
 #include "cairo-win32-private.h"
 
diff --git a/src/win32/cairo-win32-device.c b/src/win32/cairo-win32-device.c
index 6fce722ec..781ee0cde 100644
--- a/src/win32/cairo-win32-device.c
+++ b/src/win32/cairo-win32-device.c
@@ -37,15 +37,6 @@
  *	Vladimir Vukicevic <vladimir at pobox.com>
  */
 
-#define WIN32_LEAN_AND_MEAN
-/* We require Windows 2000 features such as ETO_PDY */
-#if !defined(WINVER) || (WINVER < 0x0500)
-# define WINVER 0x0500
-#endif
-#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
-# define _WIN32_WINNT 0x0500
-#endif
-
 #include "cairoint.h"
 
 #include "cairo-atomic-private.h"
diff --git a/src/win32/cairo-win32-display-surface.c b/src/win32/cairo-win32-display-surface.c
index 841725474..e3b3eec2f 100644
--- a/src/win32/cairo-win32-display-surface.c
+++ b/src/win32/cairo-win32-display-surface.c
@@ -37,15 +37,6 @@
  *	Vladimir Vukicevic <vladimir at pobox.com>
  */
 
-#define WIN32_LEAN_AND_MEAN
-/* We require Windows 2000 features such as ETO_PDY */
-#if !defined(WINVER) || (WINVER < 0x0500)
-# define WINVER 0x0500
-#endif
-#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
-# define _WIN32_WINNT 0x0500
-#endif
-
 #include "cairoint.h"
 
 #include "cairo-clip-private.h"
diff --git a/src/win32/cairo-win32-font.c b/src/win32/cairo-win32-font.c
index 2003a2782..9f81adff0 100644
--- a/src/win32/cairo-win32-font.c
+++ b/src/win32/cairo-win32-font.c
@@ -33,15 +33,6 @@
  * Contributor(s):
  */
 
-#define WIN32_LEAN_AND_MEAN
-/* We require Windows 2000 features such as GetGlyphIndices */
-#if !defined(WINVER) || (WINVER < 0x0500)
-# define WINVER 0x0500
-#endif
-#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
-# define _WIN32_WINNT 0x0500
-#endif
-
 #include "cairoint.h"
 
 #include "cairo-win32-private.h"
diff --git a/src/win32/cairo-win32-printing-surface.c b/src/win32/cairo-win32-printing-surface.c
index 602a4f3f0..352137a27 100644
--- a/src/win32/cairo-win32-printing-surface.c
+++ b/src/win32/cairo-win32-printing-surface.c
@@ -35,15 +35,6 @@
  *      Vladimir Vukicevic <vladimir at pobox.com>
  */
 
-#define WIN32_LEAN_AND_MEAN
-/* We require Windows 2000 features such as ETO_PDY */
-#if !defined(WINVER) || (WINVER < 0x0500)
-# define WINVER 0x0500
-#endif
-#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
-# define _WIN32_WINNT 0x0500
-#endif
-
 #include "cairoint.h"
 
 #include "cairo-default-context-private.h"
diff --git a/src/win32/cairo-win32-surface.c b/src/win32/cairo-win32-surface.c
index e53c16540..ca5c9d823 100644
--- a/src/win32/cairo-win32-surface.c
+++ b/src/win32/cairo-win32-surface.c
@@ -37,15 +37,6 @@
  *	Vladimir Vukicevic <vladimir at pobox.com>
  */
 
-#define WIN32_LEAN_AND_MEAN
-/* We require Windows 2000 features such as ETO_PDY */
-#if !defined(WINVER) || (WINVER < 0x0500)
-# define WINVER 0x0500
-#endif
-#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
-# define _WIN32_WINNT 0x0500
-#endif
-
 #include "cairoint.h"
 
 #include "cairo-backend-private.h"
diff --git a/src/win32/cairo-win32-system.c b/src/win32/cairo-win32-system.c
index 878553009..01bbe89df 100644
--- a/src/win32/cairo-win32-system.c
+++ b/src/win32/cairo-win32-system.c
@@ -50,15 +50,6 @@
 #if CAIRO_MUTEX_IMPL_WIN32
 #if !CAIRO_WIN32_STATIC_BUILD
 
-#define WIN32_LEAN_AND_MEAN
-/* We require Windows 2000 features such as ETO_PDY */
-#if !defined(WINVER) || (WINVER < 0x0500)
-# define WINVER 0x0500
-#endif
-#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500)
-# define _WIN32_WINNT 0x0500
-#endif
-
 #include <windows.h>
 
 /* declare to avoid "no previous prototype for 'DllMain'" warning */
diff --git a/util/cairo-missing/cairo-missing.h b/util/cairo-missing/cairo-missing.h
index 741b498a8..5d947163f 100644
--- a/util/cairo-missing/cairo-missing.h
+++ b/util/cairo-missing/cairo-missing.h
@@ -38,7 +38,6 @@
 #include <sys/types.h>
 
 #ifdef _WIN32
-#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
 #if !defined(_SSIZE_T_DEFINED) && !defined(_SSIZE_T_)


More information about the cairo-commit mailing list