From b89e699b7456b943a0f2a0ba24e1dff8b46bec9f Mon Sep 17 00:00:00 2001 From: Francois Pichet Date: Fri, 29 Apr 2011 08:56:07 +0000 Subject: Unbreak the MSVC build: - unistd.h doesn't exist with MSVC - inline must be __inline in Microsoft C - atexit cannot take a function declared as void f(), must be void f(void). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130490 91177308-0d34-0410-b5e6-96231b3b80d8 --- runtime/libprofile/CommonProfiling.c | 4 ++++ runtime/libprofile/PathProfiling.c | 14 +++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'runtime/libprofile') diff --git a/runtime/libprofile/CommonProfiling.c b/runtime/libprofile/CommonProfiling.c index 1c1771c306..210a5e5ab7 100644 --- a/runtime/libprofile/CommonProfiling.c +++ b/runtime/libprofile/CommonProfiling.c @@ -19,7 +19,11 @@ #include #include #include +#if !defined(_MSC_VER) && !defined(__MINGW32__) #include +#else +#include +#endif #include static char *SavedArgs = 0; diff --git a/runtime/libprofile/PathProfiling.c b/runtime/libprofile/PathProfiling.c index 3008db9c4a..161dfa0b24 100644 --- a/runtime/libprofile/PathProfiling.c +++ b/runtime/libprofile/PathProfiling.c @@ -16,13 +16,21 @@ #include "Profiling.h" #include "llvm/Analysis/ProfileInfoTypes.h" #include -#include +#if !defined(_MSC_VER) && !defined(__MINGW32__) +#include +#else +#include +#endif #include #include -#include #include #include +// Must use __inline in Microsoft C +#if defined(_MSC_VER) +#define inline __inline +#endif + /* note that this is used for functions with large path counts, but it is unlikely those paths will ALL be executed */ #define ARBITRARY_HASH_BIN_COUNT 100 @@ -215,7 +223,7 @@ void llvm_decrement_path_count (uint32_t functionNumber, uint32_t pathNumber) { * +-----------------+-----------------+ * */ -static void pathProfAtExitHandler() { +static void pathProfAtExitHandler(void) { int outFile = getOutFile(); uint32_t i; uint32_t header[2] = { PathInfo, 0 }; -- cgit v1.2.3