]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Propagate GNU_PRINTF from gnulib vfprintf
authorVladimir Serbinenko <phcoder@gmail.com>
Fri, 22 Mar 2019 15:13:11 +0000 (16:13 +0100)
committerVladimir Serbinenko <phcoder@google.com>
Tue, 26 Mar 2019 14:08:00 +0000 (15:08 +0100)
gnulib now replaces vfprintf and hence its format becomes GNU_PRINTF format

This also fixes matching definitions to always use GNU format

Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Vladimir Serbinenko <phcoder@google.com>
include/grub/emu/misc.h
include/grub/err.h

index 59b8b35fcbfc97a68fa31d82d1f047d924ef6090..ce464cfd007784131032d242cc6ef8a8d57eaf6e 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <stdio.h>
 
+#include <grub/compiler.h>
 #include <grub/symbol.h>
 #include <grub/types.h>
 #include <grub/misc.h>
@@ -43,22 +44,17 @@ char *grub_make_system_path_relative_to_its_root (const char *path)
 int
 grub_util_device_is_mapped (const char *dev);
 
-#ifdef __MINGW32__
-#define GRUB_HOST_PRIuLONG_LONG "I64u"
-#define GRUB_HOST_PRIxLONG_LONG "I64x"
-#else
 #define GRUB_HOST_PRIuLONG_LONG "llu"
 #define GRUB_HOST_PRIxLONG_LONG "llx"
-#endif
 
 void * EXPORT_FUNC(xmalloc) (grub_size_t size) WARN_UNUSED_RESULT;
 void * EXPORT_FUNC(xrealloc) (void *ptr, grub_size_t size) WARN_UNUSED_RESULT;
 char * EXPORT_FUNC(xstrdup) (const char *str) WARN_UNUSED_RESULT;
-char * EXPORT_FUNC(xasprintf) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2))) WARN_UNUSED_RESULT;
+char * EXPORT_FUNC(xasprintf) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2))) WARN_UNUSED_RESULT;
 
-void EXPORT_FUNC(grub_util_warn) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2)));
-void EXPORT_FUNC(grub_util_info) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2)));
-void EXPORT_FUNC(grub_util_error) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2), noreturn));
+void EXPORT_FUNC(grub_util_warn) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2)));
+void EXPORT_FUNC(grub_util_info) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2)));
+void EXPORT_FUNC(grub_util_error) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2), noreturn));
 
 grub_uint64_t EXPORT_FUNC (grub_util_get_cpu_time_ms) (void);
 
index 1590c688e1d3cc6ae0cff285c39af25c2c608e04..24ba9f5f592f1885d542ac30ea1ec55633a5b795 100644 (file)
@@ -21,6 +21,7 @@
 #define GRUB_ERR_HEADER        1
 
 #include <grub/symbol.h>
+#include <grub/compiler.h>
 
 #define GRUB_MAX_ERRMSG                256
 
@@ -91,6 +92,6 @@ int EXPORT_FUNC(grub_error_pop) (void);
 void EXPORT_FUNC(grub_print_error) (void);
 extern int EXPORT_VAR(grub_err_printed_errors);
 int grub_err_printf (const char *fmt, ...)
-     __attribute__ ((format (__printf__, 1, 2)));
+     __attribute__ ((format (GNU_PRINTF, 1, 2)));
 
 #endif /* ! GRUB_ERR_HEADER */