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