Skip to content

Commit

Permalink
[PGO]: Eliminate custom typedefs in the FreeBSD case
Browse files Browse the repository at this point in the history
Patch by: Sean Bruno 

Use o/s provided sys/types.h to bring in Profiling types.

Differential Revision: http://reviews.llvm.org/D15088

llvm-svn: 256647
  • Loading branch information
david-xl committed Dec 30, 2015
1 parent 26aa935 commit 3e0e6e7
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions compiler-rt/lib/profile/InstrProfilingPort.h
Expand Up @@ -47,26 +47,12 @@
if (GetEnvHook && GetEnvHook("LLVM_PROFILE_VERBOSE_ERRORS")) \
fprintf(stderr, Format, __VA_ARGS__);

#if defined(__FreeBSD__) && defined(__i386__)
#if defined(__FreeBSD__)

/* System headers define 'size_t' incorrectly on x64 FreeBSD (prior to
* FreeBSD 10, r232261) when compiled in 32-bit mode.
*/
#define PRIu64 "llu"
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
typedef uint32_t uintptr_t;
#elif defined(__FreeBSD__) && defined(__x86_64__)
#define PRIu64 "lu"
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
typedef unsigned long int uintptr_t;
#include <inttypes.h>
#include <sys/types.h>

#else /* defined(__FreeBSD__) && defined(__i386__) */
#else /* defined(__FreeBSD__) */

#include <inttypes.h>
#include <stdint.h>
Expand Down

0 comments on commit 3e0e6e7

Please sign in to comment.