summaryrefslogtreecommitdiff
path: root/include/inttypes.h
AgeCommit message (Collapse)Author
2016-09-26[include] Declare __STDC_*_MACROS for C++11 compat in old libcMichal Gorny
Declare __STDC_FORMAT_MACROS, __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS before including real inttypes.h/stdint.h when the wrapper-header is included in C++11, in order to enable the necessary macros in C99-compliant libc. The C99 standard defined that the format macros in inttypes.h should be defined by the C++ implementations only when __STDC_FORMAT_MACROS is defined, and the limit and constant macros in stdint.h should be defined only when __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS are defined appropriately. Following this specification, multiple old versions of glibc up to 2.17 do not define those macros by default for C++, rendering the libc++ headers non-compliant to the C++11 standard. In order to achieve the necessary compliance, __STDC_FORMAT_MACROS is defined in wrapped inttypes.h just before including the system inttypes.h, when C++11 or newer is used. Both __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS are defined in newly-wrapped stdint.h. This fixes the C++11 compliance while preserving the current behavior for C++03. Differential Revision: https://reviews.llvm.org/D24903 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@282435 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06Cleanup foo.h headers and __config to work in CEric Fiselier
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@252274 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-09PR25118: move system_header pragma before uses of include_next to avoid ↵Richard Smith
extension warnings for people finding libc++ headers via -I paths. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@249788 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-08Split <inttypes.h> out of <cinttypes>.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@249741 91177308-0d34-0410-b5e6-96231b3b80d8