[libclc] r222235 - Don't include <stddef.h>

Jeroen Ketema j.ketema at imperial.ac.uk
Tue Nov 18 06:19:27 PST 2014

Author: jketema
Date: Tue Nov 18 08:19:27 2014
New Revision: 222235

URL: http://llvm.org/viewvc/llvm-project?rev=222235&view=rev
Don't include <stddef.h>

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


Modified: libclc/trunk/generic/include/clc/clctypes.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/clctypes.h?rev=222235&r1=222234&r2=222235&view=diff
--- libclc/trunk/generic/include/clc/clctypes.h (original)
+++ libclc/trunk/generic/include/clc/clctypes.h Tue Nov 18 08:19:27 2014
@@ -1,12 +1,13 @@
 /* 6.1.1 Built-in Scalar Data Types */
-#include <stddef.h>
 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
 typedef __attribute__((ext_vector_type(8))) double double8;
 typedef __attribute__((ext_vector_type(16))) double double16;
+#define NULL ((void *)0)

More information about the cfe-commits mailing list