diff options
author | Chris Lattner <sabre@nondot.org> | 2009-02-13 22:28:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-02-13 22:28:55 +0000 |
commit | 7e4c81c8c69f57cb1fa02d5cd3e1898a12fa333c (patch) | |
tree | 21080758dbaae7bbbc77adb4552fc9a96918a8c9 /clang/lib/Headers/stdint.h | |
parent | 02b63b42873620d9931f44d32ed2c95f776eef07 (diff) | |
download | bcm5719-llvm-7e4c81c8c69f57cb1fa02d5cd3e1898a12fa333c.tar.gz bcm5719-llvm-7e4c81c8c69f57cb1fa02d5cd3e1898a12fa333c.zip |
Give TargetInfo a new IntPtrType to hold the intptr_t type for
a target.
Make Preprocessor.cpp define a new __INTPTR_TYPE__ macro based on this.
On linux/32, set intptr_t to int, instead of long. This fixes PR3563.
llvm-svn: 64495
Diffstat (limited to 'clang/lib/Headers/stdint.h')
-rw-r--r-- | clang/lib/Headers/stdint.h | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/clang/lib/Headers/stdint.h b/clang/lib/Headers/stdint.h index 3eb72bb57b5..9e5bfd700f8 100644 --- a/clang/lib/Headers/stdint.h +++ b/clang/lib/Headers/stdint.h @@ -70,25 +70,8 @@ typedef uint64_t uint_fast64_t; /* C99 7.18.1.4 Integer types capable of holding object pointers. */ -#if (1LL << (__POINTER_WIDTH__-1))-1 == __LONG_MAX__ -/* If the pointer size is equal to long, use long. This is for compatibility - * with many systems which just use long and expect it to work in 32-bit and - * 64-bit mode. If long is not suitable, we use a fixed size type below. - */ -typedef long intptr_t; -typedef unsigned long uintptr_t; -#elif __POINTER_WIDTH__ == 64 -typedef int64_t intptr_t; -typedef uint64_t uintptr_t; -#elif __POINTER_WIDTH__ == 32 -typedef int32_t intptr_t; -typedef uint32_t uintptr_t; -#elif __POINTER_WIDTH__ == 16 -typedef int16_t intptr_t; -typedef uint16_t uintptr_t; -#else -#error "unknown or unset pointer width!" -#endif +typedef __INTPTR_TYPE__ intptr_t; +typedef unsigned __INTPTR_TYPE__ uintptr_t; /* C99 7.18.1.5 Greatest-width integer types. */ |