nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

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

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