summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2023-04-25 23:18:36 +0200
committerBenjamin Otte <otte@redhat.com>2023-04-27 02:13:33 +0200
commit4333d754b87d1a99112363f4e157bb2682eda88f (patch)
tree3007167e132eb51e83d3126951713849f01a516c /gdk
parent9f82d537b04d3b20084565cc132cc6360d32c5bf (diff)
downloadgtk+-4333d754b87d1a99112363f4e157bb2682eda88f.tar.gz
gdk: Add workaround for Visual Studio
apparently casting something to itself makes it not constant.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/gdkglversionprivate.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/gdk/gdkglversionprivate.h b/gdk/gdkglversionprivate.h
index 3b1f8352df..a144b5679c 100644
--- a/gdk/gdkglversionprivate.h
+++ b/gdk/gdkglversionprivate.h
@@ -49,8 +49,7 @@ struct _GdkGLVersion
int minor;
};
-#define GDK_GL_VERSION_INIT(maj,min) (GdkGLVersion) { maj, min }
-#define GDK_GL_VERSION_STRING(str) GDK_GL_VERSION_INIT(str[0] - '0', str[2] - '0')
+#define GDK_GL_VERSION_INIT(maj,min) { maj, min }
static const GdkGLVersion supported_gl_versions[] = {
GDK_GL_VERSION_INIT (4, 6),
@@ -77,6 +76,10 @@ static const GdkGLVersion supported_gles_versions[] = {
GDK_GL_VERSION_INIT (0, 0)
};
+#undef GDK_GL_VERSION_INIT
+#define GDK_GL_VERSION_INIT(maj,min) (GdkGLVersion) { maj, min }
+#define GDK_GL_VERSION_STRING(str) GDK_GL_VERSION_INIT(str[0] - '0', str[2] - '0')
+
static inline const GdkGLVersion *
gdk_gl_versions_get_for_api (GdkGLAPI api)
{