From 7a22aebbda22536b9cbac25a21e8a3e0a92284b7 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 18 Nov 2014 14:19:27 +0000 Subject: [PATCH] Don't include MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Including a standard or system header isn't allowed in OpenCL. The type "size_t" needs to be explicitely defined now. v2: Use __SIZE_TYPE__ instead of unsigned int. v3: Define ptrdiff_t and NULL. Patch-by: Jean-Sébastien Pédron Reviewed-by: Jeroen Ketema Reviewed-by: Jan Vesely llvm-svn: 222235 --- libclc/generic/include/clc/clctypes.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libclc/generic/include/clc/clctypes.h b/libclc/generic/include/clc/clctypes.h index ca1372d..2e3db60 100644 --- a/libclc/generic/include/clc/clctypes.h +++ b/libclc/generic/include/clc/clctypes.h @@ -1,12 +1,13 @@ /* 6.1.1 Built-in Scalar Data Types */ -#include - typedef unsigned char uchar; typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong; +typedef __SIZE_TYPE__ size_t; +typedef __PTRDIFF_TYPE__ ptrdiff_t; + #define __stdint_join3(a,b,c) a ## b ## c #define __intn_t(n) __stdint_join3(__INT, n, _TYPE__) @@ -84,3 +85,5 @@ typedef __attribute__((ext_vector_type(4))) double double4; typedef __attribute__((ext_vector_type(8))) double double8; typedef __attribute__((ext_vector_type(16))) double double16; #endif + +#define NULL ((void *)0) -- 2.7.4