fix for mingw32 builds
authorBdale Garbee <bdale@gag.com>
Tue, 6 Mar 2012 05:13:51 +0000 (22:13 -0700)
committerBdale Garbee <bdale@gag.com>
Tue, 6 Mar 2012 05:13:51 +0000 (22:13 -0700)
debian/changelog
debian/patches/series
debian/patches/sys_stat.in.h.diff [new file with mode: 0644]
lib/sys_stat.in.h

index 2caa203ab6cd729bd5927e45754412098321f758..7bc895a9b1d60095c4d093169b107404d76bf227 100644 (file)
@@ -1,3 +1,10 @@
+gzip (1.4-3) UNRELEASED; urgency=low
+
+  * patch from upstream for sys_stat.in.h to fix mingw32 builds, 
+    closes: #653960
+
+ -- Bdale Garbee <bdale@gag.com>  Mon, 05 Mar 2012 22:13:33 -0700
+
 gzip (1.4-2) unstable; urgency=low
 
   * patch to use DEB_HOST_ARCH in rules, closes: #644785
index 0c9a1ea4f180eed5d34d5fd9bc27d0f6ce6d41a4..345aeaad3653e0296e43cba940fa03381b81f161 100644 (file)
@@ -1,3 +1,4 @@
 getdtablesize-missing.diff
 rsyncable.diff
 zless-LESSOPEN.diff
+sys_stat.in.h.diff
diff --git a/debian/patches/sys_stat.in.h.diff b/debian/patches/sys_stat.in.h.diff
new file mode 100644 (file)
index 0000000..146566b
--- /dev/null
@@ -0,0 +1,42 @@
+diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
+index e83ab1a..c71d44e 100644
+--- a/lib/sys_stat.in.h
++++ b/lib/sys_stat.in.h
+@@ -500,14 +500,33 @@ extern int mknodat (int fd, char const *file, mode_t mode, dev_t dev)
+ /* We can't use the object-like #define stat rpl_stat, because of
+    struct stat.  This means that rpl_stat will not be used if the user
+    does (stat)(a,b).  Oh well.  */
+-#  undef stat
+-#  ifdef _LARGE_FILES
++#  if defined _AIX && defined stat && defined _LARGE_FILES
+     /* With _LARGE_FILES defined, AIX (only) defines stat to stat64,
+        so we have to replace stat64() instead of stat(). */
+-#   define stat stat64
+ #   undef stat64
+ #   define stat64(name, st) rpl_stat (name, st)
+-#  else /* !_LARGE_FILES */
++#  elif defined __MINGW32__ && defined stat
++#   ifdef _USE_32BIT_TIME_T
++     /* The system headers define stat to _stat32i64.  */
++#    undef _stat32i64
++#    define _stat32i64(name, st) rpl_stat (name, st)
++#   else
++     /* The system headers define stat to _stat64.  */
++#    undef _stat64
++#    define _stat64(name, st) rpl_stat (name, st)
++#   endif
++#  elif defined _MSC_VER && defined stat
++#   ifdef _USE_32BIT_TIME_T
++     /* The system headers define stat to _stat32.  */
++#    undef _stat32
++#    define _stat32(name, st) rpl_stat (name, st)
++#   else
++     /* The system headers define stat to _stat64i32.  */
++#    undef _stat64i32
++#    define _stat64i32(name, st) rpl_stat (name, st)
++#   endif
++#  else /* !(_AIX ||__MINGW32__ ||  _MSC_VER) */
++#   undef stat
+ #   define stat(name, st) rpl_stat (name, st)
+ #  endif /* !_LARGE_FILES */
+ extern int stat (const char *name, struct stat *buf) _GL_ARG_NONNULL ((1, 2));
index e83ab1a11eb7f398d35e14ec61968810e1ebfdda..c71d44ef1546c6ddfa7521a1a3706417c88b192c 100644 (file)
@@ -500,14 +500,33 @@ extern int mknodat (int fd, char const *file, mode_t mode, dev_t dev)
 /* We can't use the object-like #define stat rpl_stat, because of
    struct stat.  This means that rpl_stat will not be used if the user
    does (stat)(a,b).  Oh well.  */
-#  undef stat
-#  ifdef _LARGE_FILES
+#  if defined _AIX && defined stat && defined _LARGE_FILES
     /* With _LARGE_FILES defined, AIX (only) defines stat to stat64,
        so we have to replace stat64() instead of stat(). */
-#   define stat stat64
 #   undef stat64
 #   define stat64(name, st) rpl_stat (name, st)
-#  else /* !_LARGE_FILES */
+#  elif defined __MINGW32__ && defined stat
+#   ifdef _USE_32BIT_TIME_T
+     /* The system headers define stat to _stat32i64.  */
+#    undef _stat32i64
+#    define _stat32i64(name, st) rpl_stat (name, st)
+#   else
+     /* The system headers define stat to _stat64.  */
+#    undef _stat64
+#    define _stat64(name, st) rpl_stat (name, st)
+#   endif
+#  elif defined _MSC_VER && defined stat
+#   ifdef _USE_32BIT_TIME_T
+     /* The system headers define stat to _stat32.  */
+#    undef _stat32
+#    define _stat32(name, st) rpl_stat (name, st)
+#   else
+     /* The system headers define stat to _stat64i32.  */
+#    undef _stat64i32
+#    define _stat64i32(name, st) rpl_stat (name, st)
+#   endif
+#  else /* !(_AIX ||__MINGW32__ ||  _MSC_VER) */
+#   undef stat
 #   define stat(name, st) rpl_stat (name, st)
 #  endif /* !_LARGE_FILES */
 extern int stat (const char *name, struct stat *buf) _GL_ARG_NONNULL ((1, 2));