summaryrefslogtreecommitdiffstats
path: root/gtk/src/ghbcompat.h
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/src/ghbcompat.h')
-rw-r--r--gtk/src/ghbcompat.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/gtk/src/ghbcompat.h b/gtk/src/ghbcompat.h
index cb27f307b..17cb125e2 100644
--- a/gtk/src/ghbcompat.h
+++ b/gtk/src/ghbcompat.h
@@ -26,6 +26,7 @@
#include <gtk/gtk.h>
#include <gdk/gdk.h>
+#include <string.h>
static inline PangoFontDescription* ghb_widget_get_font(GtkWidget *widget)
{
@@ -83,6 +84,28 @@ static inline void ghb_monitor_get_size(GdkWindow *window, gint *w, gint *h)
#endif
}
+static inline gboolean ghb_strv_contains(const char ** strv, const char * str)
+{
+#if GLIB_CHECK_VERSION(2, 44, 0)
+ return g_strv_contains(strv, str);
+#else
+ int ii;
+
+ if (strv == NULL)
+ {
+ return FALSE;
+ }
+ for (ii = 0; strv[ii] != NULL; ii++)
+ {
+ if (!strcmp(strv[ii], str))
+ {
+ return TRUE;
+ }
+ }
+ return FALSE;
+#endif
+}
+
#if !GTK_CHECK_VERSION(3, 10, 0)
#define gtk_image_set_from_icon_name gtk_image_set_from_stock
#define GHB_PLAY_ICON "gtk-media-play"