gdk: Add workaround for Visual Studio
authorBenjamin Otte <otte@redhat.com>
Tue, 25 Apr 2023 21:18:36 +0000 (23:18 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 27 Apr 2023 00:13:33 +0000 (02:13 +0200)
apparently casting something to itself makes it not constant.

gdk/gdkglversionprivate.h

index 3b1f8352df9bd2f4b3b59fec88308c14aabee282..a144b5679c165200fbb019129ea9246cdacee3c6 100644 (file)
@@ -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)
 {