Commit Graph

15 Commits

Author SHA1 Message Date
Eli Friedman 7df3447c10 Fix for PR3841: follow gcc's example and fall back to the system
stdint.h unless we are freestanding.

Any suggestions here are welcome.

llvm-svn: 70806
2009-05-03 23:00:48 +00:00
Chris Lattner 61639745b6 glibc plays some weird games with multiple different definitions of
int8_t and games it with strange *_defined macros.  Emulate its weirdness
for better compatibility with linux etc.  Problem pointed out by anders 
johnson.

llvm-svn: 69458
2009-04-18 19:11:11 +00:00
Daniel Dunbar 2e8536cfaa Only intptr_t is protected by __intptr_t_defined.
llvm-svn: 67018
2009-03-15 03:16:47 +00:00
Chris Lattner 5a5194fec3 fix inverted conditional, rdar://6633188
llvm-svn: 65704
2009-02-28 18:53:33 +00:00
Chris Lattner 39bb0182bd anders johnson points out that some software depends on the
definition of __intptr_t_defined when stdint.h defines intptr_t.

llvm-svn: 64497
2009-02-13 22:43:13 +00:00
Chris Lattner 7e4c81c8c6 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
2009-02-13 22:28:55 +00:00
Anders Carlsson 7325b61e74 Fix an #ifndef that should be an #ifdef instead.
llvm-svn: 64206
2009-02-10 06:18:19 +00:00
Chris Lattner 4293c8935a C++ really shouldn't check these #defines, thanks to Howard
for pointing this out!

llvm-svn: 64037
2009-02-07 22:21:31 +00:00
Chris Lattner 6726d42059 remove two eroneous suffixes, these promote to int. Thanks to Neil
for pointing this out.

llvm-svn: 64011
2009-02-07 08:49:37 +00:00
Chris Lattner a7cc1267cf fix some missing parens, thanks for Eli's review!
Obviously I make a miserable header developer :)

llvm-svn: 64009
2009-02-07 06:42:04 +00:00
Chris Lattner 5455db4273 make sure that UINTMAX_MAX has an unsigned type. This assumes that
uintmax_t is unsigned long long, which is not optimal, but is assumed 
elsewhere already.

llvm-svn: 64007
2009-02-07 06:38:06 +00:00
Chris Lattner 6bda45cec0 make various MAX/MIN constants be preprocessor constants, not C constants.
Thanks to Eli for pointing this out.

llvm-svn: 64006
2009-02-07 06:33:44 +00:00
Chris Lattner 01af63beb4 Apparently it is important to define intptr_t and uintptr_t to
long instead of int.  This is because system heaers like to redefine
typedefs and that is an error if they don't exactly match.  Use long
for intptr_t on all systems where long is the right size.

llvm-svn: 63984
2009-02-07 00:23:17 +00:00
Sebastian Redl ad41b83816 Fix some errors in the new stdint.h.
llvm-svn: 63982
2009-02-06 23:57:52 +00:00
Chris Lattner 404c2fb9cc add a stdint.h header.
llvm-svn: 63977
2009-02-06 22:59:47 +00:00