|
|
f731ee |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
f731ee |
From: Andrey Borzenkov <arvidjaar@gmail.com>
|
|
|
f731ee |
Date: Sat, 18 Jan 2014 21:22:57 +0400
|
|
|
f731ee |
Subject: [PATCH] fix include loop on MinGW due to libintl.h pulling stdio.h
|
|
|
f731ee |
|
|
|
f731ee |
In file included from ./include/grub/dl.h:23:0,
|
|
|
f731ee |
from grub-core/lib/libgcrypt-grub/cipher/rfc2268.c:3:
|
|
|
f731ee |
./include/grub/list.h:34:18: warning: conflicting types for 'grub_list_push' [en
|
|
|
f731ee |
abled by default]
|
|
|
f731ee |
void EXPORT_FUNC(grub_list_push) (grub_list_t *head, grub_list_t item);
|
|
|
f731ee |
^
|
|
|
f731ee |
./include/grub/symbol.h:68:25: note: in definition of macro 'EXPORT_FUNC'
|
|
|
f731ee |
# define EXPORT_FUNC(x) x
|
|
|
f731ee |
^
|
|
|
f731ee |
In file included from ./include/grub/fs.h:30:0,
|
|
|
f731ee |
from ./include/grub/file.h:25,
|
|
|
f731ee |
from ./grub-core/lib/posix_wrap/stdio.h:23,
|
|
|
f731ee |
from c:\mingw\include\libintl.h:314,
|
|
|
f731ee |
from ./include/grub/i18n.h:33,
|
|
|
f731ee |
from ./include/grub/misc.h:27,
|
|
|
f731ee |
from ./include/grub/list.h:25,
|
|
|
f731ee |
from ./include/grub/dl.h:28,
|
|
|
f731ee |
from grub-core/lib/libgcrypt-grub/cipher/rfc2268.c:3:
|
|
|
f731ee |
./include/grub/partition.h:106:3: note: previous implicit declaration of 'grub_l
|
|
|
f731ee |
ist_push' was here
|
|
|
f731ee |
grub_list_push (GRUB_AS_LIST_P (&grub_partition_map_list),
|
|
|
f731ee |
^
|
|
|
f731ee |
list.h needs just ATTRIBUTE_ERROR from misc.h; split compiler features
|
|
|
f731ee |
into separate file grub/compiler.h and include it instead.
|
|
|
f731ee |
---
|
|
|
f731ee |
grub-core/commands/fileXX.c | 1 +
|
|
|
f731ee |
grub-core/efiemu/prepare.c | 1 +
|
|
|
f731ee |
grub-core/loader/i386/xen_file.c | 1 +
|
|
|
f731ee |
grub-core/loader/i386/xen_fileXX.c | 1 +
|
|
|
f731ee |
grub-core/video/capture.c | 1 +
|
|
|
f731ee |
include/grub/command.h | 1 +
|
|
|
f731ee |
include/grub/compiler.h | 51 ++++++++++++++++++++++++++++++++++++++
|
|
|
f731ee |
include/grub/dl.h | 1 +
|
|
|
f731ee |
include/grub/list.h | 4 +--
|
|
|
f731ee |
include/grub/misc.h | 29 +---------------------
|
|
|
f731ee |
include/grub/procfs.h | 1 +
|
|
|
f731ee |
ChangeLog | 14 +++++++++++
|
|
|
f731ee |
12 files changed, 76 insertions(+), 30 deletions(-)
|
|
|
f731ee |
create mode 100644 include/grub/compiler.h
|
|
|
f731ee |
|
|
|
f731ee |
diff --git a/grub-core/commands/fileXX.c b/grub-core/commands/fileXX.c
|
|
|
f731ee |
index c9857ff67b1..58e1094c68b 100644
|
|
|
f731ee |
--- a/grub-core/commands/fileXX.c
|
|
|
f731ee |
+++ b/grub-core/commands/fileXX.c
|
|
|
f731ee |
@@ -18,6 +18,7 @@
|
|
|
f731ee |
|
|
|
f731ee |
#include <grub/fileid.h>
|
|
|
f731ee |
#include <grub/elfload.h>
|
|
|
f731ee |
+#include <grub/misc.h>
|
|
|
f731ee |
|
|
|
f731ee |
#pragma GCC diagnostic ignored "-Wcast-align"
|
|
|
f731ee |
|
|
|
f731ee |
diff --git a/grub-core/efiemu/prepare.c b/grub-core/efiemu/prepare.c
|
|
|
f731ee |
index fb1b25d17f2..84c3368a82c 100644
|
|
|
f731ee |
--- a/grub-core/efiemu/prepare.c
|
|
|
f731ee |
+++ b/grub-core/efiemu/prepare.c
|
|
|
f731ee |
@@ -21,6 +21,7 @@
|
|
|
f731ee |
#include <grub/err.h>
|
|
|
f731ee |
#include <grub/mm.h>
|
|
|
f731ee |
#include <grub/types.h>
|
|
|
f731ee |
+#include <grub/misc.h>
|
|
|
f731ee |
#include <grub/efiemu/efiemu.h>
|
|
|
f731ee |
#include <grub/crypto.h>
|
|
|
f731ee |
|
|
|
f731ee |
diff --git a/grub-core/loader/i386/xen_file.c b/grub-core/loader/i386/xen_file.c
|
|
|
f731ee |
index ebbf6aa11ba..ff23235f064 100644
|
|
|
f731ee |
--- a/grub-core/loader/i386/xen_file.c
|
|
|
f731ee |
+++ b/grub-core/loader/i386/xen_file.c
|
|
|
f731ee |
@@ -18,6 +18,7 @@
|
|
|
f731ee |
|
|
|
f731ee |
#include <grub/xen_file.h>
|
|
|
f731ee |
#include <grub/i386/linux.h>
|
|
|
f731ee |
+#include <grub/misc.h>
|
|
|
f731ee |
|
|
|
f731ee |
grub_elf_t
|
|
|
f731ee |
grub_xen_file (grub_file_t file)
|
|
|
f731ee |
diff --git a/grub-core/loader/i386/xen_fileXX.c b/grub-core/loader/i386/xen_fileXX.c
|
|
|
f731ee |
index 6df00157629..73a5f90fdb9 100644
|
|
|
f731ee |
--- a/grub-core/loader/i386/xen_fileXX.c
|
|
|
f731ee |
+++ b/grub-core/loader/i386/xen_fileXX.c
|
|
|
f731ee |
@@ -17,6 +17,7 @@
|
|
|
f731ee |
*/
|
|
|
f731ee |
|
|
|
f731ee |
#include <grub/xen_file.h>
|
|
|
f731ee |
+#include <grub/misc.h>
|
|
|
f731ee |
|
|
|
f731ee |
static grub_err_t
|
|
|
f731ee |
parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi,
|
|
|
f731ee |
diff --git a/grub-core/video/capture.c b/grub-core/video/capture.c
|
|
|
f731ee |
index 67c8edde824..4f83c744116 100644
|
|
|
f731ee |
--- a/grub-core/video/capture.c
|
|
|
f731ee |
+++ b/grub-core/video/capture.c
|
|
|
f731ee |
@@ -4,6 +4,7 @@
|
|
|
f731ee |
#include <grub/video.h>
|
|
|
f731ee |
#include <grub/video_fb.h>
|
|
|
f731ee |
#include <grub/mm.h>
|
|
|
f731ee |
+#include <grub/misc.h>
|
|
|
f731ee |
|
|
|
f731ee |
static struct
|
|
|
f731ee |
{
|
|
|
f731ee |
diff --git a/include/grub/command.h b/include/grub/command.h
|
|
|
f731ee |
index 8705a635519..eee4e847ee4 100644
|
|
|
f731ee |
--- a/include/grub/command.h
|
|
|
f731ee |
+++ b/include/grub/command.h
|
|
|
f731ee |
@@ -22,6 +22,7 @@
|
|
|
f731ee |
#include <grub/symbol.h>
|
|
|
f731ee |
#include <grub/err.h>
|
|
|
f731ee |
#include <grub/list.h>
|
|
|
f731ee |
+#include <grub/misc.h>
|
|
|
f731ee |
|
|
|
f731ee |
typedef enum grub_command_flags
|
|
|
f731ee |
{
|
|
|
f731ee |
diff --git a/include/grub/compiler.h b/include/grub/compiler.h
|
|
|
f731ee |
new file mode 100644
|
|
|
f731ee |
index 00000000000..c9e1d7a73dc
|
|
|
f731ee |
--- /dev/null
|
|
|
f731ee |
+++ b/include/grub/compiler.h
|
|
|
f731ee |
@@ -0,0 +1,51 @@
|
|
|
f731ee |
+/* compiler.h - macros for various compiler features */
|
|
|
f731ee |
+/*
|
|
|
f731ee |
+ * GRUB -- GRand Unified Bootloader
|
|
|
f731ee |
+ * Copyright (C) 2002,2003,2005,2006,2007,2008,2009,2010,2014 Free Software Foundation, Inc.
|
|
|
f731ee |
+ *
|
|
|
f731ee |
+ * GRUB is free software: you can redistribute it and/or modify
|
|
|
f731ee |
+ * it under the terms of the GNU General Public License as published by
|
|
|
f731ee |
+ * the Free Software Foundation, either version 3 of the License, or
|
|
|
f731ee |
+ * (at your option) any later version.
|
|
|
f731ee |
+ *
|
|
|
f731ee |
+ * GRUB is distributed in the hope that it will be useful,
|
|
|
f731ee |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
f731ee |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
f731ee |
+ * GNU General Public License for more details.
|
|
|
f731ee |
+ *
|
|
|
f731ee |
+ * You should have received a copy of the GNU General Public License
|
|
|
f731ee |
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
|
|
f731ee |
+ */
|
|
|
f731ee |
+
|
|
|
f731ee |
+#ifndef GRUB_COMPILER_HEADER
|
|
|
f731ee |
+#define GRUB_COMPILER_HEADER 1
|
|
|
f731ee |
+
|
|
|
f731ee |
+/* GCC version checking borrowed from glibc. */
|
|
|
f731ee |
+#if defined(__GNUC__) && defined(__GNUC_MINOR__)
|
|
|
f731ee |
+# define GNUC_PREREQ(maj,min) \
|
|
|
f731ee |
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
|
|
|
f731ee |
+#else
|
|
|
f731ee |
+# define GNUC_PREREQ(maj,min) 0
|
|
|
f731ee |
+#endif
|
|
|
f731ee |
+
|
|
|
f731ee |
+/* Does this compiler support compile-time error attributes? */
|
|
|
f731ee |
+#if GNUC_PREREQ(4,3)
|
|
|
f731ee |
+# define ATTRIBUTE_ERROR(msg) \
|
|
|
f731ee |
+ __attribute__ ((__error__ (msg)))
|
|
|
f731ee |
+#else
|
|
|
f731ee |
+# define ATTRIBUTE_ERROR(msg) __attribute__ ((noreturn))
|
|
|
f731ee |
+#endif
|
|
|
f731ee |
+
|
|
|
f731ee |
+#if GNUC_PREREQ(4,4)
|
|
|
f731ee |
+# define GNU_PRINTF gnu_printf
|
|
|
f731ee |
+#else
|
|
|
f731ee |
+# define GNU_PRINTF printf
|
|
|
f731ee |
+#endif
|
|
|
f731ee |
+
|
|
|
f731ee |
+#if GNUC_PREREQ(3,4)
|
|
|
f731ee |
+# define WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))
|
|
|
f731ee |
+#else
|
|
|
f731ee |
+# define WARN_UNUSED_RESULT
|
|
|
f731ee |
+#endif
|
|
|
f731ee |
+
|
|
|
f731ee |
+#endif /* ! GRUB_COMPILER_HEADER */
|
|
|
f731ee |
diff --git a/include/grub/dl.h b/include/grub/dl.h
|
|
|
f731ee |
index d29a899f52c..9562fa6634c 100644
|
|
|
f731ee |
--- a/include/grub/dl.h
|
|
|
f731ee |
+++ b/include/grub/dl.h
|
|
|
f731ee |
@@ -26,6 +26,7 @@
|
|
|
f731ee |
#include <grub/types.h>
|
|
|
f731ee |
#include <grub/elf.h>
|
|
|
f731ee |
#include <grub/list.h>
|
|
|
f731ee |
+#include <grub/misc.h>
|
|
|
f731ee |
#endif
|
|
|
f731ee |
|
|
|
f731ee |
/*
|
|
|
f731ee |
diff --git a/include/grub/list.h b/include/grub/list.h
|
|
|
f731ee |
index edd20adfdb2..d170ff6da02 100644
|
|
|
f731ee |
--- a/include/grub/list.h
|
|
|
f731ee |
+++ b/include/grub/list.h
|
|
|
f731ee |
@@ -21,8 +21,8 @@
|
|
|
f731ee |
#define GRUB_LIST_HEADER 1
|
|
|
f731ee |
|
|
|
f731ee |
#include <grub/symbol.h>
|
|
|
f731ee |
-#include <grub/types.h>
|
|
|
f731ee |
-#include <grub/misc.h>
|
|
|
f731ee |
+#include <grub/err.h>
|
|
|
f731ee |
+#include <grub/compiler.h>
|
|
|
f731ee |
|
|
|
f731ee |
struct grub_list
|
|
|
f731ee |
{
|
|
|
f731ee |
diff --git a/include/grub/misc.h b/include/grub/misc.h
|
|
|
f731ee |
index 2cf74b55006..c6cd4564d86 100644
|
|
|
f731ee |
--- a/include/grub/misc.h
|
|
|
f731ee |
+++ b/include/grub/misc.h
|
|
|
f731ee |
@@ -25,34 +25,7 @@
|
|
|
f731ee |
#include <grub/symbol.h>
|
|
|
f731ee |
#include <grub/err.h>
|
|
|
f731ee |
#include <grub/i18n.h>
|
|
|
f731ee |
-
|
|
|
f731ee |
-/* GCC version checking borrowed from glibc. */
|
|
|
f731ee |
-#if defined(__GNUC__) && defined(__GNUC_MINOR__)
|
|
|
f731ee |
-# define GNUC_PREREQ(maj,min) \
|
|
|
f731ee |
- ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
|
|
|
f731ee |
-#else
|
|
|
f731ee |
-# define GNUC_PREREQ(maj,min) 0
|
|
|
f731ee |
-#endif
|
|
|
f731ee |
-
|
|
|
f731ee |
-/* Does this compiler support compile-time error attributes? */
|
|
|
f731ee |
-#if GNUC_PREREQ(4,3)
|
|
|
f731ee |
-# define ATTRIBUTE_ERROR(msg) \
|
|
|
f731ee |
- __attribute__ ((__error__ (msg)))
|
|
|
f731ee |
-#else
|
|
|
f731ee |
-# define ATTRIBUTE_ERROR(msg) __attribute__ ((noreturn))
|
|
|
f731ee |
-#endif
|
|
|
f731ee |
-
|
|
|
f731ee |
-#if GNUC_PREREQ(4,4)
|
|
|
f731ee |
-# define GNU_PRINTF gnu_printf
|
|
|
f731ee |
-#else
|
|
|
f731ee |
-# define GNU_PRINTF printf
|
|
|
f731ee |
-#endif
|
|
|
f731ee |
-
|
|
|
f731ee |
-#if GNUC_PREREQ(3,4)
|
|
|
f731ee |
-# define WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))
|
|
|
f731ee |
-#else
|
|
|
f731ee |
-# define WARN_UNUSED_RESULT
|
|
|
f731ee |
-#endif
|
|
|
f731ee |
+#include <grub/compiler.h>
|
|
|
f731ee |
|
|
|
f731ee |
#define ALIGN_UP(addr, align) \
|
|
|
f731ee |
((addr + (typeof (addr)) align - 1) & ~((typeof (addr)) align - 1))
|
|
|
f731ee |
diff --git a/include/grub/procfs.h b/include/grub/procfs.h
|
|
|
f731ee |
index d393da77f91..8cc331d946f 100644
|
|
|
f731ee |
--- a/include/grub/procfs.h
|
|
|
f731ee |
+++ b/include/grub/procfs.h
|
|
|
f731ee |
@@ -20,6 +20,7 @@
|
|
|
f731ee |
#define GRUB_PROCFS_HEADER 1
|
|
|
f731ee |
|
|
|
f731ee |
#include <grub/list.h>
|
|
|
f731ee |
+#include <grub/types.h>
|
|
|
f731ee |
|
|
|
f731ee |
struct grub_procfs_entry
|
|
|
f731ee |
{
|
|
|
f731ee |
diff --git a/ChangeLog b/ChangeLog
|
|
|
f731ee |
index dad2da2faef..dad469b43b1 100644
|
|
|
f731ee |
--- a/ChangeLog
|
|
|
f731ee |
+++ b/ChangeLog
|
|
|
f731ee |
@@ -1,3 +1,17 @@
|
|
|
f731ee |
+2014-01-18 Andrey Borzenkov <arvidjaar@gmail.com>
|
|
|
f731ee |
+
|
|
|
f731ee |
+ * include/grub/misc.h: Move macros for compiler features to ...
|
|
|
f731ee |
+ * include/grub/compiler.h: ... new file.
|
|
|
f731ee |
+ * include/grub/list.h: Include <grub/compiler.h> instead of <grub/misc.h>.
|
|
|
f731ee |
+ * grub-core/commands/fileXX.c: Include <grub/misc.h>.
|
|
|
f731ee |
+ * grub-core/efiemu/prepare.c: Include <grub/misc.h>.
|
|
|
f731ee |
+ * grub-core/loader/i386/xen_file.c: Include <grub/misc.h>.
|
|
|
f731ee |
+ * grub-core/loader/i386/xen_fileXX.c: Include <grub/misc.h>.
|
|
|
f731ee |
+ * grub-core/video/capture.c: Include <grub/misc.h>.
|
|
|
f731ee |
+ * include/grub/command.h: Include <grub/misc.h>.
|
|
|
f731ee |
+ * include/grub/dl.h: Include <grub/misc.h>.
|
|
|
f731ee |
+ * include/grub/procfs.h: Include <grub/misc.h>.
|
|
|
f731ee |
+
|
|
|
f731ee |
2014-01-18 Andrey Borzenkov <arvidjaar@gmail.com>
|
|
|
f731ee |
|
|
|
f731ee |
* configure.ac: Add support for BUILD_EXEEXT and use it ...
|