]> git.street.me.uk Git - andy/viking.git/blobdiff - src/vik_compat.h
[QA] Fix clang warning: format string is not a string literal
[andy/viking.git] / src / vik_compat.h
index c8ccd8df45a86b1587c18db5cc0b96aac867fd59..0a1b8996a918f02d379e5b3f82cc0215cb3f4fe6 100644 (file)
@@ -23,6 +23,7 @@
 #define __VIKING_COMPAT_H
 
 #include <glib.h>
 #define __VIKING_COMPAT_H
 
 #include <glib.h>
+#include <gtk/gtk.h>
 
 G_BEGIN_DECLS
 
 
 G_BEGIN_DECLS
 
@@ -31,6 +32,18 @@ G_BEGIN_DECLS
 GMutex * vik_mutex_new ();
 void vik_mutex_free (GMutex *mutex);
 
 GMutex * vik_mutex_new ();
 void vik_mutex_free (GMutex *mutex);
 
+/*
+ * Since combo boxes are used in various places
+ * keep the code reasonably tidy and only have one ifdef to cater for the naming variances
+ */
+#if GTK_CHECK_VERSION (2, 24, 0)
+#define vik_combo_box_text_new gtk_combo_box_text_new
+#define vik_combo_box_text_append(X,Y) gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(X),Y)
+#else
+#define vik_combo_box_text_new gtk_combo_box_new_text
+#define vik_combo_box_text_append(X,Y) gtk_combo_box_append_text(GTK_COMBO_BOX(X),Y)
+#endif
+
 G_END_DECLS
 
 #endif
 G_END_DECLS
 
 #endif