diff options
author | Fedja Beader <fedja@protonmail.ch> | 2025-04-26 23:37:05 +0000 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2025-04-26 23:37:05 +0000 |
commit | 9b43b80806e79395a150dcdd1bec8ca214e28903 (patch) | |
tree | a2933c1d78d3066575fabe19a8ce5c13c4a553a7 /src/utils/stringutils.cpp | |
parent | ea4c3d19ddc1f17f2f2fd3cd9b0222e605bd77a9 (diff) | |
download | manaplus-9b43b80806e79395a150dcdd1bec8ca214e28903.tar.gz manaplus-9b43b80806e79395a150dcdd1bec8ca214e28903.tar.bz2 manaplus-9b43b80806e79395a150dcdd1bec8ca214e28903.tar.xz manaplus-9b43b80806e79395a150dcdd1bec8ca214e28903.zip |
Use stdint.h instead of ifdefing tr1/cstdint, cstdint and stdint.h
Rationale: By the standard, cstdint guarantees these basic types
in std::, but *may* put them into the global namespace.
By including stdint.h directly, we guarantee that these types are
in the global namespace. stdint.h is
also a C++ standard header guaranteed as part of the C compatibility
support, thus toolchains should support this.
The proper(tm) way of going about this would mean either prefixing
[u]int[0-9]*_t with std:: everywhere where they are used (a chore)
or having a proxy header that includes cstdint and around 50
using statements. The latter sounds to me like a good approach for
toolchains that do not provide stdint.h and do not pollute global
namespace. If such a toolchain exists in the wild.
See discussion at
https://stackoverflow.com/questions/13642827/cstdint-vs-stdint-h
In practice, my toolchain's (gcc 14 on GNU) cstdint includes stdint.h
then drags those types into std:: as well.
****
mana/plus!170
Diffstat (limited to 'src/utils/stringutils.cpp')
0 files changed, 0 insertions, 0 deletions