gtk: Define _WIN32_WINNT and friends as cflags

Instead of scattering them around, define _WIN32_WINNT, WINVER and
NTDDIVER in gtk/meson.build, like what we do in GDK-Win32.

Also, since we are requiring Windows 7 or later in GDK-Win32, do
likewise in GTK, since GDK nowadays is in the same DLL/library as GTK,
so we should make things more uniform.
This commit is contained in:
Chun-wei Fan 2022-03-26 11:12:18 +08:00
parent 23e972fa27
commit 50c5b97df0
4 changed files with 6 additions and 25 deletions

View File

@ -19,10 +19,6 @@
#include "config.h"
/* Vista or newer */
#define _WIN32_WINNT 0x0600
#include <sdkddkver.h>
#define COBJMACROS
#include "gtkfilechoosernativeprivate.h"

View File

@ -1031,7 +1031,12 @@ if broadway_enabled
endif
if win32_enabled
gtk_cargs += ['-DGTK_PRINT_BACKENDS="file,lpr"']
gtk_cargs += [
'-DGTK_PRINT_BACKENDS="file,lpr"',
'-D_WIN32_WINNT=0x0601', # Windows 7 or later
'-DWINVER=0x0601',
'-DNTDDI_VERSION=NTDDI_WIN7',
]
gtk_deps += [ giowin32_dep, pangowin32_dep ]
gtk_deps += [

View File

@ -16,16 +16,6 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _MSC_VER
#ifndef _WIN32_WINNT
/* Vista or newer */
#define _WIN32_WINNT 0x0600
#endif
#ifndef WINVER
#define WINVER _WIN32_WINNT
#endif
#endif
#include "config.h"
#include "gtkprint-win32.h"

View File

@ -16,16 +16,6 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _MSC_VER
#ifndef _WIN32_WINNT
/* Vista or newer */
#define _WIN32_WINNT 0x0600
#endif
#ifndef WINVER
#define WINVER _WIN32_WINNT
#endif
#endif
#define COBJMACROS
#include "config.h"
#include <math.h>