summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-09-17 14:36:06 +0200
committerRobin Gareus <robin@gareus.org>2015-09-17 14:36:47 +0200
commitc90bab4d4ee6af378f66bc1f35092029c5bfb639 (patch)
tree77b39068c46b573d004da3afd50687559e2b947f /libs
parent5d38d1c75185f56519b4ae879dd33f3e81131979 (diff)
add glib/stdio compat wrapper for mingw64-w32
Diffstat (limited to 'libs')
-rw-r--r--libs/pbd/pbd/gstdio_compat.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/libs/pbd/pbd/gstdio_compat.h b/libs/pbd/pbd/gstdio_compat.h
new file mode 100644
index 0000000000..1104ef0a29
--- /dev/null
+++ b/libs/pbd/pbd/gstdio_compat.h
@@ -0,0 +1,27 @@
+/* glib mingw64/win32 compatibility
+ *
+ * see http://pidgin.im/pipermail/devel/2014-April/023475.html
+ * and https://pidgin.im/pipermail/commits/2014-April/025031.html
+ * http://tracker.ardour.org/view.php?id=6575
+ */
+
+#ifndef __pbd_gstdio_compat_h__
+#define __pbd_gstdio_compat_h__
+
+#include <glib/gstdio.h>
+
+/* glib's definition of g_stat+GStatBuf is broken for mingw64-w32
+ * (and possibly other 32-bit windows)
+ */
+#if defined(_WIN32) && !defined(_MSC_VER) && !defined(_WIN64)
+typedef struct _stat GStatBufW32;
+static inline int
+pbd_g_stat(const gchar *filename, GStatBufW32 *buf)
+{
+ return g_stat(filename, (GStatBuf*)buf);
+}
+# define GStatBuf GStatBufW32
+# define g_stat pbd_g_stat
+#endif
+
+#endif /* __pbd_gstdio_compat_h__ */