diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-03 23:39:26 +0200 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-03 23:39:44 +0200 |
commit | fcc3c353fd250994dec73c4aa4bd66d976c910bb (patch) | |
tree | d009d175c4a8aec3d7b639fa7a37c635b072d037 /deimos/core/base.h | |
parent | 636b98e0ec8771c4377fd78e036da6acbec109db (diff) |
Separate gsl stuff, and use std-like int types
Diffstat (limited to 'deimos/core/base.h')
-rw-r--r-- | deimos/core/base.h | 45 |
1 files changed, 9 insertions, 36 deletions
diff --git a/deimos/core/base.h b/deimos/core/base.h index 5ff9090..2482e68 100644 --- a/deimos/core/base.h +++ b/deimos/core/base.h @@ -1,5 +1,8 @@ #pragma once
+#include "deimos/core/std.h"
+#include "deimos/core/gsl.h"
+
#define deimos_StaticAssert(...) static_assert(__VA_ARGS__, #__VA_ARGS__)
#define deimos_NO_COPY(TYPE) \
@@ -26,48 +29,25 @@ deimos_DEFAULT_COPY(TYPE); \
deimos_DEFAULT_MOVE(TYPE);
-namespace gsl
-{
-
-using zstring = char*;
-using czstring = const char*;
-
-} // namespace gsl
-
namespace deimos
{
-using uint8 = unsigned char;
-using uint16 = unsigned short;
-using uint32 = unsigned int;
-using uint64 = unsigned long long;
-
-using int8 = char;
-using int16 = short;
-using int32 = int;
-using int64 = long long;
-
-using float32 = float;
-using float64 = double;
-
-enum __attribute__((__may_alias__)) byte : uint8 {};
-
-struct uint128
+struct uint128_t
{
- uint64 high;
- uint64 low;
+ uint64_t high;
+ uint64_t low;
- constexpr bool operator==(const uint128& other) const = default;
+ constexpr bool operator==(const uint128_t& other) const = default;
};
struct SourceLocation
{
gsl::czstring file;
- int32 line;
+ int32_t line;
constexpr SourceLocation( // NOLINT
gsl::czstring file_ = __builtin_FILE(),
- int32 line_ = __builtin_LINE()) :
+ int32_t line_ = __builtin_LINE()) :
file{file_},
line{line_}
{}
@@ -75,10 +55,3 @@ struct SourceLocation } // namespace deimos
-constexpr void* operator new(deimos::uint64, void* ptr)
-{
- return ptr;
-}
-
-#include "deimos/core/std.h"
-
|