]> granicus.if.org Git - clang/commitdiff
Use -ffreestanding in ms-intrin.cpp and define size_t manually.
authorReid Kleckner <reid@kleckner.net>
Thu, 19 Sep 2013 01:54:40 +0000 (01:54 +0000)
committerReid Kleckner <reid@kleckner.net>
Thu, 19 Sep 2013 01:54:40 +0000 (01:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190985 91177308-0d34-0410-b5e6-96231b3b80d8

test/Headers/ms-intrin.cpp

index ef490bac4095c098e590a45f4f90437cd4b5a261..263c09047ae668932d9a25ba2d52de0453de2688 100644 (file)
@@ -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) {}