r174475 - [Headers] Use standard builtin defines instead of typeof trickery.

Daniel Dunbar daniel at zuster.org
Tue Feb 5 16:38:14 PST 2013


Author: ddunbar
Date: Tue Feb  5 18:38:13 2013
New Revision: 174475

URL: http://llvm.org/viewvc/llvm-project?rev=174475&view=rev
Log:
[Headers] Use standard builtin defines instead of typeof trickery.

 - The trickery can confuse more basic source processors, in particular the
   Unix conformance tool that wants to scan headers.

Modified:
    cfe/trunk/lib/Headers/stddef.h

Modified: cfe/trunk/lib/Headers/stddef.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/stddef.h?rev=174475&r1=174474&r2=174475&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/stddef.h (original)
+++ cfe/trunk/lib/Headers/stddef.h Tue Feb  5 18:38:13 2013
@@ -28,11 +28,11 @@
 
 #ifndef _PTRDIFF_T
 #define _PTRDIFF_T
-typedef __typeof__(((int*)0)-((int*)0)) ptrdiff_t;
+typedef __PTRDIFF_TYPE__ ptrdiff_t;
 #endif
 #ifndef _SIZE_T
 #define _SIZE_T
-typedef __typeof__(sizeof(int)) size_t;
+typedef __SIZE_TYPE__ size_t;
 #endif
 #ifndef __cplusplus
 #ifndef _WCHAR_T





More information about the cfe-commits mailing list