|
|
0dc71c |
From 90efd351fa4f81df97473e1bb8c8234a801f8ebe Mon Sep 17 00:00:00 2001
|
|
|
0dc71c |
From: Andrey Borzenkov <arvidjaar@gmail.com>
|
|
|
0dc71c |
Date: Sat, 25 Jan 2014 21:49:41 +0400
|
|
|
0dc71c |
Subject: [PATCH 045/143] fix Mingw W64-32 cross compile failure due to printf
|
|
|
0dc71c |
redefinition in libintl.h
|
|
|
0dc71c |
|
|
|
0dc71c |
In file included from util/misc.c:36:0:
|
|
|
0dc71c |
./include/grub/emu/misc.h:56:1: error: 'libintl_printf' is an unrecognized format function type [-Werror=format=]
|
|
|
0dc71c |
char * EXPORT_FUNC(xasprintf) (const char *fmt, ...) __attribute__ ((format (printf, 1, 2))) WARN_UNUSED_RESULT;
|
|
|
0dc71c |
^
|
|
|
0dc71c |
./include/grub/emu/misc.h:58:1: error: 'libintl_printf' is an unrecognized format function type [-Werror=format=]
|
|
|
0dc71c |
|
|
|
0dc71c |
The reason is libintl.h which redefines printf as libintl_printf. The problem
|
|
|
0dc71c |
is not present in native MinGW build which avoids redefinition. Use
|
|
|
0dc71c |
(format (__printf__) instead which is valid replacement in GCC.
|
|
|
0dc71c |
|
|
|
0dc71c |
v2: add grub-core/lib/libgcrypt/src/g10lib.h
|
|
|
0dc71c |
v3: modify g10lib.h during import
|
|
|
0dc71c |
---
|
|
|
0dc71c |
ChangeLog | 9 +++++++++
|
|
|
0dc71c |
include/grub/crypto.h | 2 +-
|
|
|
0dc71c |
include/grub/emu/misc.h | 8 ++++----
|
|
|
0dc71c |
include/grub/err.h | 2 +-
|
|
|
0dc71c |
util/import_gcry.py | 6 ++++++
|
|
|
0dc71c |
5 files changed, 21 insertions(+), 6 deletions(-)
|
|
|
0dc71c |
|
|
|
0dc71c |
diff --git a/ChangeLog b/ChangeLog
|
|
|
0dc71c |
index b405b7e..c93f11f 100644
|
|
|
0dc71c |
--- a/ChangeLog
|
|
|
0dc71c |
+++ b/ChangeLog
|
|
|
0dc71c |
@@ -1,3 +1,12 @@
|
|
|
0dc71c |
+
|
|
|
0dc71c |
+2014-01-25 Andrey Borzenkov <arvidjaar@gmail.com>
|
|
|
0dc71c |
+
|
|
|
0dc71c |
+ * include/grub/crypto.h: Replace __attribute__ ((format (printf)) with
|
|
|
0dc71c |
+ __attribute__ ((format (__printf__)) to fix compilation under MinGW-w64.
|
|
|
0dc71c |
+ * include/grub/emu/misc.h: ... and here.
|
|
|
0dc71c |
+ * include/grub/err.h: ... and here.
|
|
|
0dc71c |
+ * util/import_gcry.py: ... and here (in files g10lib.h).
|
|
|
0dc71c |
+
|
|
|
0dc71c |
2014-01-25 Andrey Borzenkov <arvidjaar@gmail.com>
|
|
|
0dc71c |
|
|
|
0dc71c |
* util/grub-mkimage.c: Make prefix argument mandatory.
|
|
|
0dc71c |
diff --git a/include/grub/crypto.h b/include/grub/crypto.h
|
|
|
0dc71c |
index ec1b980..a24e89d 100644
|
|
|
0dc71c |
--- a/include/grub/crypto.h
|
|
|
0dc71c |
+++ b/include/grub/crypto.h
|
|
|
0dc71c |
@@ -408,7 +408,7 @@ void _gcry_assert_failed (const char *expr, const char *file, int line,
|
|
|
0dc71c |
const char *func) __attribute__ ((noreturn));
|
|
|
0dc71c |
|
|
|
0dc71c |
void _gcry_burn_stack (int bytes);
|
|
|
0dc71c |
-void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2)));
|
|
|
0dc71c |
+void _gcry_log_error( const char *fmt, ... ) __attribute__ ((format (__printf__, 1, 2)));
|
|
|
0dc71c |
|
|
|
0dc71c |
|
|
|
0dc71c |
#ifdef GRUB_UTIL
|
|
|
0dc71c |
diff --git a/include/grub/emu/misc.h b/include/grub/emu/misc.h
|
|
|
0dc71c |
index dde48c1..a588ba2 100644
|
|
|
0dc71c |
--- a/include/grub/emu/misc.h
|
|
|
0dc71c |
+++ b/include/grub/emu/misc.h
|
|
|
0dc71c |
@@ -53,11 +53,11 @@ grub_util_device_is_mapped (const char *dev);
|
|
|
0dc71c |
void * EXPORT_FUNC(xmalloc) (grub_size_t size) WARN_UNUSED_RESULT;
|
|
|
0dc71c |
void * EXPORT_FUNC(xrealloc) (void *ptr, grub_size_t size) WARN_UNUSED_RESULT;
|
|
|
0dc71c |
char * EXPORT_FUNC(xstrdup) (const char *str) WARN_UNUSED_RESULT;
|
|
|
0dc71c |
-char * EXPORT_FUNC(xasprintf) (const char *fmt, ...) __attribute__ ((format (printf, 1, 2))) WARN_UNUSED_RESULT;
|
|
|
0dc71c |
+char * EXPORT_FUNC(xasprintf) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2))) WARN_UNUSED_RESULT;
|
|
|
0dc71c |
|
|
|
0dc71c |
-void EXPORT_FUNC(grub_util_warn) (const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
|
|
|
0dc71c |
-void EXPORT_FUNC(grub_util_info) (const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
|
|
|
0dc71c |
-void EXPORT_FUNC(grub_util_error) (const char *fmt, ...) __attribute__ ((format (printf, 1, 2), noreturn));
|
|
|
0dc71c |
+void EXPORT_FUNC(grub_util_warn) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2)));
|
|
|
0dc71c |
+void EXPORT_FUNC(grub_util_info) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2)));
|
|
|
0dc71c |
+void EXPORT_FUNC(grub_util_error) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2), noreturn));
|
|
|
0dc71c |
|
|
|
0dc71c |
grub_uint64_t EXPORT_FUNC (grub_util_get_cpu_time_ms) (void);
|
|
|
0dc71c |
|
|
|
0dc71c |
diff --git a/include/grub/err.h b/include/grub/err.h
|
|
|
0dc71c |
index 9896fcc..1590c68 100644
|
|
|
0dc71c |
--- a/include/grub/err.h
|
|
|
0dc71c |
+++ b/include/grub/err.h
|
|
|
0dc71c |
@@ -91,6 +91,6 @@ int EXPORT_FUNC(grub_error_pop) (void);
|
|
|
0dc71c |
void EXPORT_FUNC(grub_print_error) (void);
|
|
|
0dc71c |
extern int EXPORT_VAR(grub_err_printed_errors);
|
|
|
0dc71c |
int grub_err_printf (const char *fmt, ...)
|
|
|
0dc71c |
- __attribute__ ((format (printf, 1, 2)));
|
|
|
0dc71c |
+ __attribute__ ((format (__printf__, 1, 2)));
|
|
|
0dc71c |
|
|
|
0dc71c |
#endif /* ! GRUB_ERR_HEADER */
|
|
|
0dc71c |
diff --git a/util/import_gcry.py b/util/import_gcry.py
|
|
|
0dc71c |
index 63ebb90..2b3322d 100644
|
|
|
0dc71c |
--- a/util/import_gcry.py
|
|
|
0dc71c |
+++ b/util/import_gcry.py
|
|
|
0dc71c |
@@ -534,6 +534,12 @@ for src in sorted (os.listdir (os.path.join (indir, "src"))):
|
|
|
0dc71c |
fw.close ()
|
|
|
0dc71c |
continue
|
|
|
0dc71c |
|
|
|
0dc71c |
+ if src == "g10lib.h":
|
|
|
0dc71c |
+ fw.write (f.read ().replace ("(printf,f,a)", "(__printf__,f,a)"))
|
|
|
0dc71c |
+ f.close ()
|
|
|
0dc71c |
+ fw.close ()
|
|
|
0dc71c |
+ continue
|
|
|
0dc71c |
+
|
|
|
0dc71c |
fw.write (f.read ())
|
|
|
0dc71c |
f.close ()
|
|
|
0dc71c |
fw.close ()
|
|
|
0dc71c |
--
|
|
|
0dc71c |
1.9.3
|
|
|
0dc71c |
|