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.
Please take a look at how clang/lib/Headers/stdint.h handles forwarding this header, and use a solution similar to that.