From 0e740d3952c978babe7f6b7b8110113170b02c08 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Mon, 14 May 2012 13:21:08 -0700 Subject: Fix size_t for certain versions of GCC When compiling coreboot with the latest ChromeOS toolchain, GCC complains that some printk calls use %zu in connection with size_t types since it resolves the typedefs to long unsigned int. The problem is solved by using the GCC built-in __SIZE_TYPE__ if it exists and define __SIZE_TYPE__ to long unsigned int otherwise. Change-Id: I449c3d385b5633a05e57204704e981de6e017b86 Signed-off-by: Stefan Reinauer Reviewed-on: http://review.coreboot.org/1040 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/arch/x86/include/stddef.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/arch/x86/include/stddef.h b/src/arch/x86/include/stddef.h index e4fc019c87..a6c3fc6e15 100644 --- a/src/arch/x86/include/stddef.h +++ b/src/arch/x86/include/stddef.h @@ -2,7 +2,10 @@ #define I386_STDDEF_H typedef long ptrdiff_t; -typedef unsigned long size_t; +#ifndef __SIZE_TYPE__ +#define __SIZE_TYPE__ unsigned long +#endif +typedef __SIZE_TYPE__ size_t; typedef long ssize_t; typedef int wchar_t; -- cgit v1.2.3