summaryrefslogtreecommitdiffstats
path: root/clang/lib/Headers/stdint.h
Commit message (Collapse)AuthorAgeFilesLines
* Clean up trailing whitespace in the builtin headersSean Silva2015-09-121-7/+7
| | | | llvm-svn: 247498
* Change __INTx_TYPE__ to be always signed. This changes the value forJoerg Sonnenberger2014-07-281-16/+16
| | | | | | | | | | char-based types from "char" to "signed char". Adjust stdint.h to use __INTx_TYPE__ directly without prefixing it with signed and to use __UINTx_TYPE__ for unsigned ones. The value of __INTx_TYPE__ now matches GCC. llvm-svn: 214119
* Remove a broken attempt to cope with someone #undef'ing __has_include_next.Richard Smith2014-02-191-2/+1
| | | | | | | This was broken because __has_include_next(...) would not be valid in a preprocessor condition if __has_include_next is not defined. llvm-svn: 201731
* Headers: Add support for ISO9899:2011 rsize_t.Daniel Dunbar2013-04-121-0/+6
| | | | llvm-svn: 179427
* tl;dr: Teach Clang to work around g++ changing its workaround to glibc'sRichard Smith2013-04-121-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | implementation of C99's attempt to control the C++ standard. *sigh* The C99 standard says that certain macros in <stdint.h>, such as SIZE_MAX, should not be defined when the header is included in C++ mode, unless __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS are defined. The C++11 standard says "Thanks, but no thanks" and C11 removed this rule, but various C library implementations (such as glibc) follow C99 anyway. g++ prior to 4.8 worked around the C99 / glibc behavior by defining __STDC_*_MACROS in <cstdint>, which was incorrect, because <stdint.h> is supposed to provide these macros too. g++ 4.8 works around it by defining __STDC_*_MACROS in its builtin <stdint.h> header. This change makes Clang act like g++ 4.8 in this regard: our <stdint.h> now countermands any attempt by the C library to implement the undesired C99 rules, by defining the __STDC_*_MACROS first. Unlike g++, we do this even in C++98 mode, since that was the intent of the C++ committee, matches the behavior required in C11, and matches our built-in implementation of <stdint.h>. llvm-svn: 179419
* Some small improvements to the builtin (-ffreestanding) stdint.h; inEli Friedman2011-04-301-12/+14
| | | | | | particular, make sure to handle WCHAR_MIN correctly. llvm-svn: 130618
* PR9772: Fix the definition of WINT_MIN and WINT_MAX on Linux -ffreestanding.Eli Friedman2011-04-211-2/+7
| | | | llvm-svn: 129907
* fix a bunch of comment typos found by codespell. Patch byChris Lattner2011-04-151-2/+2
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129559
* Headers: Change [u]intmax_t to be defined in terms of __[U]INTMAX_TYPE__, ↵Daniel Dunbar2010-06-301-2/+2
| | | | | | instead of intN_t. llvm-svn: 107254
* Headers: Hide intptr_t and uintptr_t definitions behind _INTPTR_T and _UINTPTR_TDaniel Dunbar2010-04-241-0/+7
| | | | | | | | defines, for increased compatibility with Darwin gcc. - This is a bit of a hack, since platform compatibility issues don't belong here, but I don't think this hurts anyone either. llvm-svn: 102264
* Define SIG_ATOMIC_MIN and SIG_ATOMIC_MAX in terms of __SIG_ATOMIC_WIDTH__.Ken Dyck2009-11-221-2/+2
| | | | llvm-svn: 89598
* Avoid unwanted expansion in macros that paste together INT<n>_C(v) and Ken Dyck2009-11-201-3/+5
| | | | | | UINT<n>_C(v) macros. llvm-svn: 89461
* Avoid unwanted expansion in macros that paste together INT<n>_MIN, INT<n>_MAX,Ken Dyck2009-11-201-13/+16
| | | | | | and UINT<n>_MAX defintions. llvm-svn: 89460
* Avoid unwanted macro expansion in macros that paste together int<n>_t andKen Dyck2009-11-201-4/+7
| | | | | | uint<n>_t definitions. llvm-svn: 89459
* Define WCHAR_MIN and WCHAR_MAX in terms of __WCHAR_WIDTH__ for consistency withKen Dyck2009-11-191-2/+2
| | | | | | other limit macros. llvm-svn: 89355
* Parameterize WINT_MIN and WINT_MAX with __WINT_WIDTH__ to support arbitrary Ken Dyck2009-11-191-2/+2
| | | | | | widths. This corrects the values of these definitions for MSP430 and PIC16. llvm-svn: 89350
* Construct definition of SIZE_MAX from __SIZE_WIDTH__ to support targets ofKen Dyck2009-11-191-16/+1
| | | | | | arbitrary widths. llvm-svn: 89347
* Construct the macro body of PTRDIFF_MAX and PTRDIFF_MIN from __PTRDIFF_WIDTH__.Ken Dyck2009-11-191-6/+2
| | | | llvm-svn: 89343
* Construct INTPTR_MIN, INTPTR_MAX, and UINTPTR_MAX from the exact-width limitKen Dyck2009-11-181-9/+4
| | | | | | macros corresponding to __INTPTR_WIDTH__. llvm-svn: 89239
* Define intptr_t and uintptr_t in terms of their equivalent exact-width types.Ken Dyck2009-11-181-4/+5
| | | | llvm-svn: 89237
* Define INTMAX_C and UINTMAX_C in terms of the corresponding exact-widthKen Dyck2009-11-181-2/+2
| | | | | | INTn_C and UINTn_C macros. llvm-svn: 89226
* Define INTMAX_MIN, INTMAX_MAX, and UINTMAX_MAX in terms of the limit macros forKen Dyck2009-11-181-3/+3
| | | | | | their corresponding exact-width type. llvm-svn: 89224
* Define intmax_t and uintmax_t as the [u]intN_t type corresponding toKen Dyck2009-11-181-2/+4
| | | | | | __INTMAX_WIDTH__. llvm-svn: 89221
* Replace (-INT8_C(128)), which uses an illegally out-of-range argument forKen Dyck2009-11-171-6/+3
| | | | | | | INT8_C, with (-INT8_C(127)-1) in the definition of INT8_MIN. Apply similar changes to the definitions of INT16_MIN and INT24_MIN. llvm-svn: 89120
* Use the INTn_C integer constant macros to generate limit constants with correctKen Dyck2009-11-171-24/+27
| | | | | | | suffixes. This corrects the suffixes for the limit constants of the 32-bit types on MSP430 and PIC16, and the 64-bit types on PPC64, SystemZ, X86_64. llvm-svn: 89101
* Remove unnecessary parens around the bodies of integer constant macros. C99Ken Dyck2009-11-171-20/+20
| | | | | | | requires that their arguments be decimal, hex, octal constants---no signs allowed---making the parens unnecessary. llvm-svn: 89095
* Parameterize the constant-generating macros in stdint.h with new built-inKen Dyck2009-11-161-8/+0
| | | | | | | __INTn_C_SUFFIX__ macros that are defined for types with corresponding constant suffixes (i.e. long and long long). llvm-svn: 88914
* Generalize stdint.h for non-8-bit-multiple types, patch by Chris Lattner2009-11-121-96/+523
| | | | | | | | | | Ken Dyck! "This adds definitions for types of 8-bit multiples from 8 to 64 to stdint.h and rationalizes the selection of types for the exact-width definitions in InitPreprocessor.cpp." llvm-svn: 86977
* A simple reordering of the definitions in stdint.h and Chris Lattner2009-11-041-75/+83
| | | | | | introduces no new function changes. Patch by Ken Dyck! llvm-svn: 86062
* Added __has_include and __has_include_next.John Thompson2009-11-021-1/+2
| | | | llvm-svn: 85834
* Fix for PR3841: follow gcc's example and fall back to the system Eli Friedman2009-05-031-3/+11
| | | | | | | | stdint.h unless we are freestanding. Any suggestions here are welcome. llvm-svn: 70806
* glibc plays some weird games with multiple different definitions ofChris Lattner2009-04-181-3/+12
| | | | | | | | 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
* Only intptr_t is protected by __intptr_t_defined.Daniel Dunbar2009-03-151-1/+1
| | | | llvm-svn: 67018
* fix inverted conditional, rdar://6633188Chris Lattner2009-02-281-1/+1
| | | | llvm-svn: 65704
* anders johnson points out that some software depends on theChris Lattner2009-02-131-0/+3
| | | | | | definition of __intptr_t_defined when stdint.h defines intptr_t. llvm-svn: 64497
* Give TargetInfo a new IntPtrType to hold the intptr_t type forChris Lattner2009-02-131-19/+2
| | | | | | | | | | 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
* Fix an #ifndef that should be an #ifdef instead.Anders Carlsson2009-02-101-2/+2
| | | | llvm-svn: 64206
* C++ really shouldn't check these #defines, thanks to HowardChris Lattner2009-02-071-10/+8
| | | | | | for pointing this out! llvm-svn: 64037
* remove two eroneous suffixes, these promote to int. Thanks to NeilChris Lattner2009-02-071-2/+2
| | | | | | for pointing this out. llvm-svn: 64011
* fix some missing parens, thanks for Eli's review!Chris Lattner2009-02-071-6/+6
| | | | | | Obviously I make a miserable header developer :) llvm-svn: 64009
* make sure that UINTMAX_MAX has an unsigned type. This assumes that Chris Lattner2009-02-071-1/+1
| | | | | | | uintmax_t is unsigned long long, which is not optimal, but is assumed elsewhere already. llvm-svn: 64007
* make various MAX/MIN constants be preprocessor constants, not C constants.Chris Lattner2009-02-071-12/+12
| | | | | | Thanks to Eli for pointing this out. llvm-svn: 64006
* Apparently it is important to define intptr_t and uintptr_t to Chris Lattner2009-02-071-1/+8
| | | | | | | | 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
* Fix some errors in the new stdint.h.Sebastian Redl2009-02-061-5/+5
| | | | llvm-svn: 63982
* add a stdint.h header.Chris Lattner2009-02-061-0/+224
llvm-svn: 63977
OpenPOWER on IntegriCloud