diff --git a/gst/glib-compat-private.h b/gst/glib-compat-private.h index 75e7108766..a60e5152e8 100644 --- a/gst/glib-compat-private.h +++ b/gst/glib-compat-private.h @@ -10,6 +10,10 @@ G_BEGIN_DECLS +#if !GLIB_CHECK_VERSION(2,25,0) +typedef struct stat GStatBuf; +#endif + /* copies */ /* adaptations */ diff --git a/gst/gstplugin.c b/gst/gstplugin.c index a9922b1c13..68e72ef676 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -670,11 +670,7 @@ gst_plugin_load_file (const gchar * filename, GError ** error) GModule *module; gboolean ret; gpointer ptr; -#if GLIB_CHECK_VERSION(2,25,0) GStatBuf file_status; -#else - struct stat file_status; -#endif GstRegistry *registry; gboolean new_plugin = TRUE; @@ -1470,13 +1466,7 @@ gst_plugin_ext_dep_extract_env_vars_paths (GstPlugin * plugin, } static guint -gst_plugin_ext_dep_get_hash_from_stat_entry ( -#if GLIB_CHECK_VERSION(2,25,0) - GStatBuf * s -#else - struct stat *s -#endif - ) +gst_plugin_ext_dep_get_hash_from_stat_entry (GStatBuf * s) { if (!(s->st_mode & (S_IFDIR | S_IFREG))) return (guint) - 1; @@ -1533,11 +1523,7 @@ gst_plugin_ext_dep_scan_dir_and_match_names (GstPlugin * plugin, * the same order, and not in a random order */ while ((entry = g_dir_read_name (dir))) { gboolean have_match; -#if GLIB_CHECK_VERSION(2,25,0) GStatBuf s; -#else - struct stat s; -#endif gchar *full_path; guint fhash; @@ -1594,12 +1580,7 @@ gst_plugin_ext_dep_scan_path_with_filenames (GstPlugin * plugin, * and going through each entry to see if it matches one of our filenames. */ if (!recurse_into_dirs && !partial_names) { for (i = 0; filenames[i] != NULL; ++i) { -#if GLIB_CHECK_VERSION(2,25,0) GStatBuf s; -#else - struct stat s; -#endif - gchar *full_path; guint fhash; diff --git a/gst/gstregistry.c b/gst/gstregistry.c index a8ed967a0d..0e33a9e13d 100644 --- a/gst/gstregistry.c +++ b/gst/gstregistry.c @@ -135,6 +135,7 @@ #include "gst-i18n-lib.h" #include "gst.h" +#include "glib-compat-private.h" #ifdef G_OS_WIN32 #include @@ -1106,11 +1107,7 @@ gst_registry_scan_path_level (GstRegistryScanContext * context, return FALSE; while ((dirent = g_dir_read_name (dir))) { -#if GLIB_CHECK_VERSION(2,25,0) GStatBuf file_status; -#else - struct stat file_status; -#endif filename = g_build_filename (path, dirent, NULL); if (g_stat (filename, &file_status) < 0) { diff --git a/gst/gstregistrybinary.c b/gst/gstregistrybinary.c index 5f3f21ff40..eb277c5cf7 100644 --- a/gst/gstregistrybinary.c +++ b/gst/gstregistrybinary.c @@ -363,11 +363,7 @@ gst_registry_binary_write_cache (GstRegistry * registry, const char *location) continue; if (plugin->flags & GST_PLUGIN_FLAG_CACHED) { -#if GLIB_CHECK_VERSION(2,25,0) GStatBuf statbuf; -#else - struct stat statbuf; -#endif if (g_stat (plugin->filename, &statbuf) < 0 || plugin->file_mtime != statbuf.st_mtime ||