aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/include/cstdint
diff options
context:
space:
mode:
authorspicyjpeg <thatspicyjpeg@gmail.com>2023-05-11 23:42:43 +0200
committerGitHub <noreply@github.com>2023-05-11 23:42:43 +0200
commit04d7728350cbd04dd86cd894e906c98673e3f9a7 (patch)
tree08e8c7dd495d1c4c6fcf5f7ba6b4b10693dc42f6 /libpsn00b/include/cstdint
parenteaec942f56ceec9c14de5c4185a02602abadd50a (diff)
parent58a8306d24fe29d965aa8b40ddc37c3163c0a2f9 (diff)
downloadpsn00bsdk-04d7728350cbd04dd86cd894e906c98673e3f9a7.tar.gz
Merge pull request #70 from Lameguy64/v0.23-wip
Header cleanups, PCDRV, more safety checks, libc and mkpsxiso fixes (v0.23)
Diffstat (limited to 'libpsn00b/include/cstdint')
-rw-r--r--libpsn00b/include/cstdint34
1 files changed, 34 insertions, 0 deletions
diff --git a/libpsn00b/include/cstdint b/libpsn00b/include/cstdint
new file mode 100644
index 0000000..3b1bc4a
--- /dev/null
+++ b/libpsn00b/include/cstdint
@@ -0,0 +1,34 @@
+/*
+ * PSn00bSDK standard library
+ * (C) 2019-2023 Lameguy64, spicyjpeg - MPL licensed
+ *
+ * This is a replacement for the <cstdint> header included with GCC, which seems
+ * to be broken (at least in GCC 12.2.0) as it requires some macros to be set.
+ */
+
+#pragma once
+
+#include <stdint.h>
+
+namespace std {
+
+#define _DEF_TYPE(bits, prefix) \
+ using ::prefix##bits##_t; \
+ using ::prefix##_fast##bits##_t; \
+ using ::prefix##_least##bits##_t;
+
+_DEF_TYPE( 8, int)
+_DEF_TYPE( 8, uint)
+_DEF_TYPE(16, int)
+_DEF_TYPE(16, uint)
+_DEF_TYPE(32, int)
+_DEF_TYPE(32, uint)
+
+#undef _DEF_TYPE
+
+using ::intmax_t;
+using ::uintmax_t;
+using ::intptr_t;
+using ::uintptr_t;
+
+}