gl/clutter: safer check for cogl version
authorLuis de Bethencourt <luis@debethencourt.com>
Sun, 4 May 2014 01:38:42 +0000 (21:38 -0400)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:39 +0000 (19:31 +0000)
Use COGL_VERSION_ENCODE to check for the minimum required and maximum allowed
cogl version. In certain situations just using the COGL_VERSION_* macro name can
give you the following error:

error "COGL_VERSION_MAX_ALLOWED must be >= COGL_VERSION_MIN_REQUIRED"

tests/examples/gl/clutter/cluttershare.c

index d3f1b1e..de7cd66 100644 (file)
@@ -25,8 +25,8 @@
 
 #define CLUTTER_VERSION_MIN_REQUIRED CLUTTER_VERSION_1_8
 #define CLUTTER_VERSION_MAX_ALLOWED CLUTTER_VERSION_1_10
-#define COGL_VERSION_MIN_REQUIRED COGL_VERSION_1_16
-#define COGL_VERSION_MAX_ALLOWED COGL_VERSION_1_18
+#define COGL_VERSION_MIN_REQUIRED COGL_VERSION_ENCODE (1, 16, 0)
+#define COGL_VERSION_MAX_ALLOWED COGL_VERSION_ENCODE (1, 18, 0)
 #include <clutter/clutter.h>
 #ifndef WIN32
 #include <clutter/x11/clutter-x11.h>