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

a85e8e
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
a85e8e
Subject: [PATCH 012/260] 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
---
a85e8e
 ChangeLog                             | 5 +++++
a85e8e
 include/grub/osdep/hostfile_windows.h | 3 +++
a85e8e
 2 files changed, 8 insertions(+)
a85e8e
a85e8e
diff --git a/ChangeLog b/ChangeLog
a85e8e
index 8c1ececa1..e87f0a7a4 100644
a85e8e
--- a/ChangeLog
a85e8e
+++ b/ChangeLog
a85e8e
@@ -1,3 +1,8 @@
a85e8e
+2014-01-07  Andrey Borzenkov <arvidjaar@gmail.com>
a85e8e
+
a85e8e
+	* include/grub/osdep/hostfile_windows.h: Do not redefine fseeko/ftello
a85e8e
+	on MinGW-64 when compiling for 32 bits.
a85e8e
+
a85e8e
 2013-12-30  Andrey Borzenkov <arvidjaar@gmail.com>
a85e8e
 
a85e8e
 	* 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
a85e8e
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
 
a85e8e
-- 
a85e8e
2.13.0
a85e8e