]> git.street.me.uk Git - andy/viking.git/blobdiff - src/vik_compat.h
vikcoord does not depend on GTK
[andy/viking.git] / src / vik_compat.h
index c8ccd8df45a86b1587c18db5cc0b96aac867fd59..46ed7ba3fc6c4cfde83bc830b7a4d0d29473c71e 100644 (file)
 #define __VIKING_COMPAT_H
 
 #include <glib.h>
+#include <gtk/gtk.h>
 
 G_BEGIN_DECLS
 
+#if !GLIB_CHECK_VERSION(2,26,0)
+typedef struct stat GStatBuf;
+#endif
+
 // Hide ifdef complexities of function variants here
 
 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