/pidgin/main: 4cd48601e1d1: cross-win32: better fix for g_stat bug

Tomasz Wasilczyk twasilczyk at pidgin.im
Thu Apr 17 11:27:25 EDT 2014


Changeset: 4cd48601e1d13cc0a72b1bd391946b965e78f56c
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-04-17 17:27 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/4cd48601e1d1

Description:

cross-win32: better fix for g_stat bug

diffstat:

 libpurple/glibcompat.h |  17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diffs (30 lines):

diff --git a/libpurple/glibcompat.h b/libpurple/glibcompat.h
--- a/libpurple/glibcompat.h
+++ b/libpurple/glibcompat.h
@@ -148,15 +148,20 @@ static inline void g_object_class_instal
 #endif /* < 2.36.0 */
 
 
-/* glib's definition of g_stat+GStatBuf seems to be broken on 32-bit windows,
- * so instead of relying on it, we'll define our own macros.
+/* glib's definition of g_stat+GStatBuf seems to be broken on mingw64-w32 (and
+ * possibly other 32-bit windows), so instead of relying on it,
+ * we'll define our own.
  */
 #if defined(_WIN32) && !defined(_MSC_VER) && !defined(_WIN64)
 #  include <glib/gstdio.h>
-typedef struct _stat64 GStatBuf64;
-#  define GStatBuf GStatBuf64
-#  undef g_stat
-#  define g_stat _stat64
+typedef struct _stat GStatBufW32;
+static inline int
+purple_g_stat(const gchar *filename, GStatBufW32 *buf)
+{
+	return g_stat(filename, (GStatBuf*)buf);
+}
+#  define GStatBuf GStatBufW32
+#  define g_stat purple_g_stat
 #endif
 
 



More information about the Commits mailing list