011fe8
From afda7f47601f36a98074d8d21ffb640256f02267 Mon Sep 17 00:00:00 2001
78a3d7
From: Andrey Borzenkov <arvidjaar@gmail.com>
78a3d7
Date: Tue, 7 Jan 2014 18:43:02 +0400
58fe9a
Subject: [PATCH 012/152] fix 32 bit compilation on MinGW-w64
78a3d7
78a3d7
Use _FILE_OFFSET_BITS macro to distinguish between native MinGW and
78a3d7
32 bit under MinGW-64. The latter does not require fseeko/ftello
78a3d7
redefinition which it already does in case of _FILE_OFFSET_BITS=64.
78a3d7
---
78a3d7
 ChangeLog                             | 5 +++++
78a3d7
 include/grub/osdep/hostfile_windows.h | 3 +++
78a3d7
 2 files changed, 8 insertions(+)
78a3d7
78a3d7
diff --git a/ChangeLog b/ChangeLog
011fe8
index 8c1ecec..e87f0a7 100644
78a3d7
--- a/ChangeLog
78a3d7
+++ b/ChangeLog
78a3d7
@@ -1,3 +1,8 @@
78a3d7
+2014-01-07  Andrey Borzenkov <arvidjaar@gmail.com>
78a3d7
+
78a3d7
+	* include/grub/osdep/hostfile_windows.h: Do not redefine fseeko/ftello
78a3d7
+	on MinGW-64 when compiling for 32 bits.
78a3d7
+
78a3d7
 2013-12-30  Andrey Borzenkov <arvidjaar@gmail.com>
78a3d7
 
78a3d7
 	* grub-core/Makefile.core.def: strip .eh_frame section for arm64-efi.
78a3d7
diff --git a/include/grub/osdep/hostfile_windows.h b/include/grub/osdep/hostfile_windows.h
78a3d7
index 36615b2..79efcfa 100644
78a3d7
--- a/include/grub/osdep/hostfile_windows.h
78a3d7
+++ b/include/grub/osdep/hostfile_windows.h
78a3d7
@@ -69,8 +69,11 @@ enum grub_util_fd_open_flags_t
78a3d7
 
78a3d7
 #if defined (__MINGW32__) && !defined (__MINGW64__)
78a3d7
 
78a3d7
+/* 32 bit on MinGW-64 already redefines them if _FILE_OFFSET_BITS=64 */
78a3d7
+#if !defined(_FILE_OFFSET_BITS)
78a3d7
 #define fseeko fseeko64
78a3d7
 #define ftello ftello64
78a3d7
+#endif
78a3d7
 
78a3d7
 #endif
78a3d7
 
78a3d7
-- 
37b39b
1.9.3
78a3d7