[asan] minor ifdef cleanup

llvm-svn: 149274
This commit is contained in:
Kostya Serebryany 2012-01-30 20:55:02 +00:00
parent 6291f3a43c
commit 510850c345
2 changed files with 6 additions and 16 deletions

View File

@ -35,6 +35,10 @@
#include "asan_thread.h"
#include "asan_thread_registry.h"
#ifdef _WIN32
#include <intrin.h>
#endif
namespace __asan {
#define REDZONE FLAG_redzone
@ -59,10 +63,6 @@ static inline bool IsAligned(uintptr_t a, uintptr_t alignment) {
return (a & (alignment - 1)) == 0;
}
#ifdef _WIN32
#include <intrin.h>
#endif
static inline size_t Log2(size_t x) {
CHECK(IsPowerOfTwo(x));
#if defined(_WIN64)

View File

@ -20,9 +20,7 @@
#include <stdlib.h> // for size_t, uintptr_t, etc.
#if !defined(_WIN32)
#include <stdint.h> // for __WORDSIZE
#else
#if defined(_WIN32)
// There's no <stdint.h> in Visual Studio 9, so we have to define [u]int*_t.
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
@ -32,16 +30,8 @@ typedef __int8 int8_t;
typedef __int16 int16_t;
typedef __int32 int32_t;
typedef __int64 int64_t;
// Visual Studio does not define ssize_t.
#ifdef _WIN64
typedef int64_t ssize_t;
#define __WORDSIZE 64
#else
typedef int32_t ssize_t;
#define __WORDSIZE 32
#endif
# include <stdint.h> // for __WORDSIZE
#endif // _WIN32
// If __WORDSIZE was undefined by the platform, define it in terms of the