summaryrefslogtreecommitdiff
path: root/src/net/worldinfo.h
diff options
context:
space:
mode:
authorFedja Beader <fedja@protonmail.ch>2024-05-30 01:42:41 +0200
committerFedja Beader <fedja@protonmail.ch>2025-04-16 17:19:52 +0200
commit952944973145699ccae0516645118635bab03eb2 (patch)
treea09c92ed1bcf215821c460daf122b5db3d3b04cf /src/net/worldinfo.h
parentebb8e8dfc6c0b902227c78b82819db060268eb63 (diff)
downloadmanaplus-stdint.h.tar.gz
manaplus-stdint.h.tar.bz2
manaplus-stdint.h.tar.xz
manaplus-stdint.h.zip
Use stdint.h instead of ifdefing tr1/cstdint, cstdint and stdint.hstdint.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.
Diffstat (limited to 'src/net/worldinfo.h')
-rw-r--r--src/net/worldinfo.h11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/net/worldinfo.h b/src/net/worldinfo.h
index daeb97b21..a8bb57d12 100644
--- a/src/net/worldinfo.h
+++ b/src/net/worldinfo.h
@@ -26,16 +26,7 @@
#include "utils/vector.h"
-#if defined(__GXX_EXPERIMENTAL_CXX0X__)
-#if defined(__APPLE__)
-#include <tr1/cstdint>
-#else // defined(__APPLE__)
-#include <cstdint>
-#endif // defined(__APPLE__)
-#else // defined(__GXX_EXPERIMENTAL_CXX0X__)
-#include <stdint.h>
-#endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
-
+#include <stdint.h> // see commit's discussion
#include <string>
#include "localconsts.h"