r190985 - Use -ffreestanding in ms-intrin.cpp and define size_t manually.

Reid Kleckner reid at kleckner.net
Wed Sep 18 18:54:40 PDT 2013

Author: rnk
Date: Wed Sep 18 20:54:40 2013
New Revision: 190985

URL: http://llvm.org/viewvc/llvm-project?rev=190985&view=rev
Use -ffreestanding in ms-intrin.cpp and define size_t manually.


Modified: cfe/trunk/test/Headers/ms-intrin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/ms-intrin.cpp?rev=190985&r1=190984&r2=190985&view=diff
--- cfe/trunk/test/Headers/ms-intrin.cpp (original)
+++ cfe/trunk/test/Headers/ms-intrin.cpp Wed Sep 18 20:54:40 2013
@@ -1,11 +1,11 @@
-// RUN: %clang -target i386-pc-win32 -fms-extensions -fsyntax-only %s
+// RUN: %clang -target i386-pc-win32 -fms-extensions -ffreestanding -fsyntax-only %s
-// Get size_t, but avoid including mm_malloc.h which includes stdlib.h which may
-// not exist.
-#include <stdint.h>
-#undef __STDC_HOSTED__
+// Intrin.h needs size_t, but -ffreestanding prevents us from getting it from
+// stddef.h.  Work around it with this typedef.
+typedef __SIZE_TYPE__ size_t;
 #include <Intrin.h>
+// Use some C++ to make sure we closed the extern "C" brackets.
 template <typename T>
 void foo(T V) {}

More information about the cfe-commits mailing list