AIX system headers need stdint.h and inttypes.h to be re-enterable when macro _STD_TYPES_T is defined so that limit macro definitions such as UINT32_MAX can be found.
Details
- Reviewers
hubert.reinterpretcast jasonliu mclow.lists EricWF - Commits
- rCXX363939: AIX system headers need stdint.h and inttypes.h to be re-enterable
rGab4bcd844ab9: AIX system headers need stdint.h and inttypes.h to be re-enterable
rL363939: AIX system headers need stdint.h and inttypes.h to be re-enterable
rC363939: AIX system headers need stdint.h and inttypes.h to be re-enterable
Diff Detail
- Repository
- rL LLVM
Event Timeline
libcxx/include/stdint.h | ||
---|---|---|
16 ↗ | (On Diff #200967) | I don't think that this will do what you want it to. #include <stdint.h> #define _STD_TYPES_T #include <stdint.h> |
libcxx/include/stdint.h | ||
---|---|---|
16 ↗ | (On Diff #200967) | The comment is perhaps not clear. We need <stdint.h> to be re-enterable only as long as all previous inclusions have occurred while _STD_TYPES_T is defined. The effect of including <stdint.h> without defining _STD_TYPES_T is a strict superset of the effects of including <stdint.h> in other circumstances. Should we adjust the comment? |
libcxx/include/stdint.h | ||
---|---|---|
16 ↗ | (On Diff #200967) | Updated comments as suggested. This patch helps scenarios such as the following on AIX. #include <sys/types.h> where <sys/types.h> included in the first line defines macro _STD_TYPES_T, includes <stdint.h>, and then undefines _STD_TYPES_T. <stdint.h> included in the second line can be entered to get to macros such as UINT32_MAX. Since _STD_TYPES_T is undefined with the second inclusion, the header guard macro is defined and <stdint.h> is no longer re-enterable. |
LGTM with minor comment.
libcxx/test/std/depr/depr.c.headers/stdint_h.sh.cpp | ||
---|---|---|
21 ↗ | (On Diff #201746) | Typo: |
libcxx/test/std/depr/depr.c.headers/stdint_h.sh.cpp | ||
---|---|---|
21 ↗ | (On Diff #201746) | Good catch! Fixed. |