Blame SOURCES/0012-fix-32-bit-compilation-on-MinGW-w64.patch

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