dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0025-Use-_W64-to-detect-MinGW-W64-32-instead-of-_FILE_OFF.patch

f725e3
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
f725e3
From: Andrey Borzenkov <arvidjaar@gmail.com>
f725e3
Date: Sat, 18 Jan 2014 20:04:11 +0400
f725e3
Subject: [PATCH] Use _W64 to detect MinGW W64-32 instead of _FILE_OFFSET_BITS
f725e3
f725e3
In 94cee4a4c201bb506377b2c26e072eee8cb19d6f I overlooked that config.h
f725e3
unconditionally sets _FILE_OFFSET_BITS, so it cannot be used to detect
f725e3
MinGW W64 environment. It looks like Emacs folks already found
f725e3
solution; instead of _FILE_OFFSET_BITS use _W64 as suggested in
f725e3
http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00723.html
f725e3
---
f725e3
 include/grub/osdep/hostfile_windows.h | 4 ++--
f725e3
 ChangeLog                             | 5 +++++
f725e3
 2 files changed, 7 insertions(+), 2 deletions(-)
f725e3
f725e3
diff --git a/include/grub/osdep/hostfile_windows.h b/include/grub/osdep/hostfile_windows.h
f725e3
index 79efcfa5084..bf6451b6db4 100644
f725e3
--- a/include/grub/osdep/hostfile_windows.h
f725e3
+++ b/include/grub/osdep/hostfile_windows.h
f725e3
@@ -69,8 +69,8 @@ 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
+/* 32 bit on Mingw-w64 already redefines them if _FILE_OFFSET_BITS=64 */
f725e3
+#ifndef _W64
f725e3
 #define fseeko fseeko64
f725e3
 #define ftello ftello64
f725e3
 #endif
f725e3
diff --git a/ChangeLog b/ChangeLog
f725e3
index fcbf2207b32..5aac7c1d854 100644
f725e3
--- a/ChangeLog
f725e3
+++ b/ChangeLog
f725e3
@@ -1,3 +1,8 @@
f725e3
+2014-01-18  Andrey Borzenkov <arvidjaar@gmail.com>
f725e3
+
f725e3
+	* include/grub/osdep/hostfile_windows.h: Use _W64 instead of
f725e3
+	FILE_OFFSET_BITS to differentiate between native MinGW and Mingw W64.
f725e3
+
f725e3
 2014-01-18  Vladimir Serbinenko  <phcoder@gmail.com>
f725e3
 
f725e3
 	* grub-core/term/terminfo.c: Recognize keys F1-F12.