summaryrefslogtreecommitdiff
path: root/include/stdc-predef.h
AgeCommit message (Collapse)AuthorLines
2024-02-26switch __STDC_UTF_{16,32}__ macro definitions from #undef to #ifndefRich Felker-2/+4
originally, compilers did not provide these macros and we had to provide them ourselves. this meant we were redefining them, which was technically invalid unless the token sequence of the original definition matched exactly. the original patch proposed by Jules Maselbas to fix this made the definitions conditional on them not already being defined; however I suggested using #undef to avoid any possibly-wrong definitions already in place and ensure that the definitions are 1. the version adopted as commit 8b7048680731707d135ea231f81eb3eaf52378ee made this change. unfortunately, gcc is loud about not liking #undef of any __STDC_* macro name, and while warnings are suppressed in the system include path, there is apparently no way to suppress this warning if the system include dir has also been provided via -I. while normally we don't go out of our way to satisfy warnings over style in the public headers, in this case, it seems to be a matter of disagreement over contract of which part of "the implementation" is entitled to define or undefine macros belonging to the implementation, and it's quite reasonable to conclude that the compiler may reject attempts to undefine them. this commit reverts to the originally-submitted version of the patch making the definitions conditional.
2024-02-03stdc-predef.h: prevent redefining __STDC_UTF_{16,32}__ macrosJules Maselbas-0/+3
Undefine any previous __STDC_UTF_{16,32}__ macros before defining them to prenvent any warnings of redefining macros. This happens as a result of some compiler versions defining the macros themselves.
2021-04-19define __STDC_UTF_{16,32}__ macrosÉrico Nogueira-0/+3
these macros are used to indicate that the implementation uses, respectively, utf-16 and utf-32 encoding for char16_t and char32_t.
2016-07-03add stdc-predef.h for library-level predefined macrosRich Felker-0/+10
modern compilers (for gcc, versions 4.8 and later) automatically pre-include <stdc-predef.h> to obtain the values of certain predefined macros specified by ISO C but which reflect properties of the library implementation, not just the compiler. provide values indicating that wchar_t is Unicode-encoded and that Annex F (IEEE floating point) is supported unless the compiler indicates otherwise. based on patch by Masanori Ogino.