mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 22:10:08 +00:00
Merge branch 'master.msvc' into 'master'
Fix building recent GTK master on Visual Studio See merge request GNOME/gtk!1369
This commit is contained in:
commit
ac7dd02f8f
@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
14
meson.build
14
meson.build
@ -223,9 +223,17 @@ endif
|
|||||||
if cc.get_id() == 'msvc'
|
if cc.get_id() == 'msvc'
|
||||||
# Compiler options taken from msvc_recommended_pragmas.h
|
# Compiler options taken from msvc_recommended_pragmas.h
|
||||||
# in GLib, based on _Win32_Programming_ by Rector and Newcomer
|
# in GLib, based on _Win32_Programming_ by Rector and Newcomer
|
||||||
test_cflags = []
|
test_cflags = [
|
||||||
add_project_arguments('-FImsvc_recommended_pragmas.h', language: 'c')
|
'-FImsvc_recommended_pragmas.h',
|
||||||
add_project_arguments('-D_USE_MATH_DEFINES', language: 'c')
|
'-D_USE_MATH_DEFINES',
|
||||||
|
'-utf-8',
|
||||||
|
]
|
||||||
|
add_project_arguments(cc.get_supported_arguments(test_cflags), language: 'c')
|
||||||
|
|
||||||
|
cxx = meson.get_compiler('cpp')
|
||||||
|
if cxx.get_id() == 'msvc'
|
||||||
|
add_project_arguments(cxx.get_supported_arguments(test_cflags), language: 'cpp')
|
||||||
|
endif
|
||||||
elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
|
elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
|
||||||
test_cflags = [
|
test_cflags = [
|
||||||
'-fno-strict-aliasing',
|
'-fno-strict-aliasing',
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
#include <unistd.h>
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
#include <unistd.h>
|
||||||
|
#elif defined (G_OS_WIN32)
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static GdkTexture *
|
static GdkTexture *
|
||||||
get_image_texture (GtkImage *image,
|
get_image_texture (GtkImage *image,
|
||||||
int *out_size)
|
int *out_size)
|
||||||
|
Loading…
Reference in New Issue
Block a user