summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/glib-compat.h39
2 files changed, 44 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 7270f60..46ef0d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2005-11-21 Christophe Fergeau <teuf@gnome.org>
+ * src/glib-compat.h: added a missing helper file for glib 2.4
+ compilation
+
+2005-11-21 Christophe Fergeau <teuf@gnome.org>
+
* src/hal-common.c:
* src/ipod-device.c: marked some functions as static
diff --git a/src/glib-compat.h b/src/glib-compat.h
new file mode 100644
index 0000000..632c385
--- /dev/null
+++ b/src/glib-compat.h
@@ -0,0 +1,39 @@
+#ifndef GLIB_COMPAT_H
+#define GLIB_COMPAT_H
+
+#include <glib.h>
+
+#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION <= 4))
+/*** glib <= 2.4 ***/
+
+/* G_GNUC_INTERNAL */
+#ifndef G_GNUC_INTERNAL
+#define G_GNUC_INTERNAL
+#endif
+
+/* g_stat */
+#include<sys/types.h>
+#include<sys/stat.h>
+#include<unistd.h>
+#define g_stat stat
+#define g_mkdir mkdir
+#define g_rename rename
+#define g_printf printf
+
+/* G_IS_DIR_SEPARATOR */
+#ifdef G_OS_WIN32
+#define G_IS_DIR_SEPARATOR(c) ((c) == G_DIR_SEPARATOR || (c) == '/')
+#else
+#define G_IS_DIR_SEPARATOR(c) ((c) == G_DIR_SEPARATOR)
+#endif
+
+#else
+/*** glib > 2.4 ***/
+
+/* g_stat */
+#include <glib/gstdio.h>
+#endif
+
+
+
+#endif /* GLIB_COMPAT_H */