changeset 16917:d7028e1986c1

stat, fstat: Avoid warnings on mingw64. * lib/stat.c (stat) [_GL_WINDOWS_64_BIT_ST_SIZE]: Undefine before redefining. * lib/fstat.c (stat, fstat) [_GL_WINDOWS_64_BIT_ST_SIZE]: Likewise. Reported by Daniel P. Berrange <berrange@redhat.com>.
author Bruno Haible <bruno@clisp.org>
date Wed, 20 Jun 2012 02:01:14 +0200
parents 3d02d25fa13d
children 7d79512ede07
files ChangeLog lib/fstat.c lib/stat.c
diffstat 3 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-06-19  Bruno Haible  <bruno@clisp.org>
+
+	stat, fstat: Avoid warnings on mingw64.
+	* lib/stat.c (stat) [_GL_WINDOWS_64_BIT_ST_SIZE]: Undefine before
+	redefining.
+	* lib/fstat.c (stat, fstat) [_GL_WINDOWS_64_BIT_ST_SIZE]: Likewise.
+	Reported by Daniel P. Berrange <berrange@redhat.com>.
+
 2012-06-19  Bruno Haible  <bruno@clisp.org>
 
 	stdioext: Add support for musl libc.
--- a/lib/fstat.c
+++ b/lib/fstat.c
@@ -24,7 +24,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #if _GL_WINDOWS_64_BIT_ST_SIZE
+# undef stat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
 # define stat _stati64
+# undef fstat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
 # define fstat _fstati64
 #endif
 #undef __need_system_sys_stat_h
--- a/lib/stat.c
+++ b/lib/stat.c
@@ -29,6 +29,7 @@
 
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 # if _GL_WINDOWS_64_BIT_ST_SIZE
+#  undef stat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
 #  define stat _stati64
 #  define REPLACE_FUNC_STAT_DIR 1
 #  undef REPLACE_FUNC_STAT_FILE