summaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-24 09:59:45 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-24 09:59:45 +0200
commit34134e88f6c6b8b4d19fec53366d6e40a3303c6e (patch)
tree2e8cd4ee882ffbaca7a2caae2d1e6b0be49c93ef /compat
parentcecd124c0c043ef261256fb9e3f1108cde1265c1 (diff)
a
Diffstat (limited to 'compat')
-rw-r--r--compat/integer-types.hpp53
-rw-r--r--compat/prelude.hpp6
2 files changed, 56 insertions, 3 deletions
diff --git a/compat/integer-types.hpp b/compat/integer-types.hpp
new file mode 100644
index 00000000..791bea64
--- /dev/null
+++ b/compat/integer-types.hpp
@@ -0,0 +1,53 @@
+#pragma once
+
+#ifdef __MSC_VER
+#ifdef _WIN64
+typedef unsigned __int64 size_t;
+typedef __int64 ptrdiff_t;
+typedef __int64 intptr_t;
+typedef unsigned __int64 uintptr_t;
+#else
+typedef unsigned int size_t;
+typedef int ptrdiff_t;
+typedef int intptr_t;
+typedef unsigned int uintptr_t;
+#endif
+typedef signed char int8_t;
+typedef short int16_t;
+typedef int int32_t;
+typedef long long int64_t;
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
+typedef unsigned long long uint64_t;
+#else
+typedef __SIZE_TYPE__ size_t;
+typedef __PTRDIFF_TYPE__ ptrdiff_t;
+typedef __INTPTR_TYPE__ intptr_t;
+typedef __UINTPTR_TYPE__ uintptr_t;
+
+typedef __INT8_TYPE__ int8_t;
+typedef __INT16_TYPE__ int16_t;
+typedef __INT32_TYPE__ int32_t;
+typedef __INT64_TYPE__ int64_t;
+typedef __UINT8_TYPE__ uint8_t;
+typedef __UINT16_TYPE__ uint16_t;
+typedef __UINT32_TYPE__ uint32_t;
+typedef __UINT64_TYPE__ uint64_t;
+#endif
+
+namespace std {
+using ::size_t;
+using ::ptrdiff_t;
+using ::intptr_t;
+using ::uintptr_t;
+
+using ::int8_t;
+using ::int16_t;
+using ::int32_t;
+using ::int64_t;
+using ::uint8_t;
+using ::uint16_t;
+using ::uint32_t;
+using ::uint64_t;
+} // namespace std
diff --git a/compat/prelude.hpp b/compat/prelude.hpp
index 4e8aa7b3..c21f9d27 100644
--- a/compat/prelude.hpp
+++ b/compat/prelude.hpp
@@ -1,9 +1,9 @@
#pragma once
-#include <cstddef>
-#include <cstdint>
-#include <type_traits>
+#include "integer-types.hpp"
+namespace Corrade::Containers {}
namespace Magnum {}
namespace floormat {
using namespace ::Magnum;
+ using namespace ::Corrade::Containers;
} // namespace floormat