From fcc3c353fd250994dec73c4aa4bd66d976c910bb Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Wed, 3 Apr 2024 23:39:26 +0200 Subject: Separate gsl stuff, and use std-like int types --- deimos/core/base.h | 45 +++++++++------------------------------------ 1 file changed, 9 insertions(+), 36 deletions(-) (limited to 'deimos/core/base.h') 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" - -- cgit