Do not require STDC_LIMIT_MACROS and STDC_CONSTANT_MACROS macros to be defined globally. They are not needed for C++11 compliant standard headers.
Not requiring the defines is good; removing the defines in the build files is not. We still want to be able to build out of the box on systems with this known brokenness.
|555–557 ↗||(On Diff #61357)|
|111 ↗||(On Diff #61357)|
Probably leave this too.
Can we identify such broken systems in the first place?
I do care about exported cmake variables, especially LLVM_DEFINITIONS and it currently looks like:
set(LLVM_DEFINITIONS "-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS")
I guess nobody knows any more why and where they are needed.
Looking around briefly at the libcs I have handy...
glibc stopped checking them in 2013, newlib dropped them in 2015, musl in 2013, bionic in 2014. (dunno release dates, those are commit dates). So things look pretty good there.
On the other hand, you have platforms like freebsd and netbsd, which apparently *still* haven't removed these #ifdefs from their stdint.h. So...yeah, seems like there's still a need for the defines, for now. Anyone over in BSD land paying attention?... /me pokes joerg. :)