summaryrefslogtreecommitdiff
path: root/flash.h
diff options
context:
space:
mode:
authorstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2013-07-13 23:21:05 +0000
committerstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2013-07-13 23:21:05 +0000
commit7a48c94a6ed1d770f5159428094102bbac5e67f7 (patch)
tree5c905e082327d5714b6a09d30ae38e210d610ca9 /flash.h
parent6f24982a4606038c413e588478ae5e94e41fc10a (diff)
downloadflashrom-7a48c94a6ed1d770f5159428094102bbac5e67f7.tar.gz
Various cross-platform fixes.
Improve compilation with libpayload (compiling flashrom.c and linking is still broken): - disable Ponyprog (which enforced serial.c compilation) - make errno available where it is needed Fix internal.c for non-x86 and enable cb parsing on ARM. Fix mingw builds by using its __USE_MINGW_ANSI_STDIO macro and gnu_printf definition for printf format style checking. See http://sourceforge.net/apps/trac/mingw-w64/wiki/gnu%20printf This requires inclusion of stdio.h in flash.h. Fix order of libraries in the Makefile: FEATURE_LIBS needs to come *after* PCILIBS in case ZLIB is needed by it. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1697 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'flash.h')
-rw-r--r--flash.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/flash.h b/flash.h
index 7e50ae5..ba93245 100644
--- a/flash.h
+++ b/flash.h
@@ -25,6 +25,7 @@
#define __FLASH_H__ 1
#include <inttypes.h>
+#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
@@ -286,7 +287,12 @@ enum msglevel {
MSG_SPEW = 5,
};
/* Let gcc and clang check for correct printf-style format strings. */
-int print(enum msglevel level, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
+int print(enum msglevel level, const char *fmt, ...)
+#ifdef __MINGW32__
+__attribute__((format(gnu_printf, 2, 3)));
+#else
+__attribute__((format(printf, 2, 3)));
+#endif
#define msg_gerr(...) print(MSG_ERROR, __VA_ARGS__) /* general errors */
#define msg_perr(...) print(MSG_ERROR, __VA_ARGS__) /* programmer errors */
#define msg_cerr(...) print(MSG_ERROR, __VA_ARGS__) /* chip errors */