From b9122895731212b991e1ef7a2b6acb791db73d91 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Mon, 14 Feb 2011 19:26:22 +0000 Subject: Use fprintf(stderr, ...) in library Signed-off-by: Patrick Georgi Acked-by: Stefan Reinauer git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6359 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- payloads/libpayload/include/assert.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'payloads/libpayload/include/assert.h') diff --git a/payloads/libpayload/include/assert.h b/payloads/libpayload/include/assert.h index fda4bc063c..9968504a44 100644 --- a/payloads/libpayload/include/assert.h +++ b/payloads/libpayload/include/assert.h @@ -28,6 +28,7 @@ */ #include +#include // assert's existence depends on NDEBUG state on _last_ inclusion of assert.h, // so don't guard this against double-includes. @@ -35,5 +36,5 @@ // Heisenbugs appear if statement has side-effects. This could be worked around but does the standard allow for that? #define assert(statement) #else -#define assert(statement) if ((statement) == 0) { printf("assertion failed in file %s, function %s(), line %s\n", __FILE__, __FUNCTION__, __LINE__); abort(); } +#define assert(statement) if ((statement) == 0) { fprintf(stderr, "assertion failed in file %s, function %s(), line %s\n", __FILE__, __FUNCTION__, __LINE__); abort(); } #endif -- cgit v1.2.3