dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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