[gtk/matthiasc/win-pointer-doc-fix: 1/12] Raise _WIN32_WINNT macro to target Windows 8 API




commit 9d18913fa8d5edb57033da636ef47658b6d947ab
Author: Luca Bacci <luca bacci982 gmail com>
Date:   Tue Jun 29 14:27:13 2021 +0200

    Raise _WIN32_WINNT macro to target Windows 8 API

 gdk/win32/gdkdisplay-win32.c |  1 -
 gdk/win32/gdkmonitor-win32.c | 16 ----------------
 gdk/win32/gdkprivate-win32.h |  9 ---------
 gdk/win32/gdkscreen-win32.c  |  2 --
 gdk/win32/meson.build        | 21 ++++++++++++++-------
 5 files changed, 14 insertions(+), 35 deletions(-)
---
diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c
index 5c8078b696..89d4dcd615 100644
--- a/gdk/win32/gdkdisplay-win32.c
+++ b/gdk/win32/gdkdisplay-win32.c
@@ -18,7 +18,6 @@
 
 #include "config.h"
 
-#define _WIN32_WINNT 0x0600
 #define VK_USE_PLATFORM_WIN32_KHR
 
 #include "gdk.h"
diff --git a/gdk/win32/gdkmonitor-win32.c b/gdk/win32/gdkmonitor-win32.c
index 19289fb6a0..bbd661a527 100644
--- a/gdk/win32/gdkmonitor-win32.c
+++ b/gdk/win32/gdkmonitor-win32.c
@@ -15,22 +15,6 @@
  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#if defined (_WIN32_WINNT) && WIN32_WINNT < 0x0601
-#  undef _WIN32_WINNT
-
-#  define _WIN32_WINNT 0x0601
-#  ifdef WINVER
-#    undef WINVER
-#  endif
-#  define WINVER _WIN32_WINNT
-#elif !defined (_WIN32_WINNT)
-#  define _WIN32_WINNT 0x0601
-#  ifdef WINVER
-#    undef WINVER
-#  endif
-#  define WINVER _WIN32_WINNT
-#endif
-
 #include "config.h"
 
 #include "gdkprivate-win32.h"
diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h
index d37866bcf3..c178228028 100644
--- a/gdk/win32/gdkprivate-win32.h
+++ b/gdk/win32/gdkprivate-win32.h
@@ -25,15 +25,6 @@
 #ifndef __GDK_PRIVATE_WIN32_H__
 #define __GDK_PRIVATE_WIN32_H__
 
-#ifndef WINVER
-/* Vista or newer */
-#define WINVER 0x0600
-#endif
-
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT WINVER
-#endif
-
 #include <gdk/gdkcursorprivate.h>
 #include <gdk/win32/gdksurface-win32.h>
 #include <gdk/win32/gdkwin32display.h>
diff --git a/gdk/win32/gdkscreen-win32.c b/gdk/win32/gdkscreen-win32.c
index 4eb87eabfd..5f09b472b5 100644
--- a/gdk/win32/gdkscreen-win32.c
+++ b/gdk/win32/gdkscreen-win32.c
@@ -17,8 +17,6 @@
 
 #include "config.h"
 
-#define _WIN32_WINNT 0x0600
-
 #include "gdk.h"
 #include "gdkprivate-win32.h"
 #include "gdkwin32screen.h"
diff --git a/gdk/win32/meson.build b/gdk/win32/meson.build
index 6f57d5a4cd..a29d222665 100644
--- a/gdk/win32/meson.build
+++ b/gdk/win32/meson.build
@@ -43,10 +43,21 @@ gdk_win32_public_headers = files([
 
 install_headers(gdk_win32_public_headers, 'gdkwin32.h', subdir: 'gtk-4.0/gdk/win32/')
 
-GDK_WIN32_EGL_CFLAGS = []
+gdk_win32_cflags = [
+  '-DGTK_COMPILATION',
+  '-DG_LOG_DOMAIN="Gdk"',
+  '-DINSIDE_GDK_WIN32',
+]
+
+gdk_win32_cflags += [
+  '-D_WIN32_WINNT=0x0602', # Windows 8
+  '-Isdkddkver.h',
+]
 
 if win32_has_egl
-  GDK_WIN32_EGL_CFLAGS = ['-DGDK_WIN32_ENABLE_EGL']
+  gdk_win32_cflags += [
+    '-DGDK_WIN32_ENABLE_EGL'
+  ]
 endif
 
 gdk_win32_deps = [ # FIXME
@@ -56,10 +67,6 @@ gdk_win32_deps = [ # FIXME
 libgdk_win32 = static_library('gdk-win32',
   gdk_win32_sources, gdkconfig, gdkenum_h,
   include_directories: [ confinc, gdkinc ],
-  c_args: [
-    '-DGTK_COMPILATION',
-    '-DG_LOG_DOMAIN="Gdk"',
-    '-DINSIDE_GDK_WIN32',
-  ] + GDK_WIN32_EGL_CFLAGS,
+  c_args: gdk_win32_cflags,
   dependencies: [ gdk_deps, gdk_win32_deps ],
 )


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