From 4a3185b782dabeb664fcf2fa4f6d17e36cf23d0e Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Mon, 28 Oct 2024 18:39:01 +0100 Subject: Start fixing some cross platform issues --- asl/assert.hpp | 3 ++- asl/integers.hpp | 13 ++++++++----- asl/memory.hpp | 2 +- asl/testing/testing.cpp | 2 +- asl/testing/testing.hpp | 2 +- asl/tests/option_tests.cpp | 2 +- 6 files changed, 14 insertions(+), 10 deletions(-) (limited to 'asl') diff --git a/asl/assert.hpp b/asl/assert.hpp index 0c80d9c..d419c24 100644 --- a/asl/assert.hpp +++ b/asl/assert.hpp @@ -1,5 +1,6 @@ #pragma once +// @Todo Make this portable-ish #define ASL_ASSERT(...) \ if (__VA_ARGS__) {} \ - else { __debugbreak(); } + else { __builtin_debugtrap(); } diff --git a/asl/integers.hpp b/asl/integers.hpp index b5d3e99..716b981 100644 --- a/asl/integers.hpp +++ b/asl/integers.hpp @@ -1,14 +1,17 @@ #pragma once -using int8_t = char; -using int16_t = short; -using int32_t = int; -using int64_t = long long; +using int8_t = signed char; +using int16_t = signed short; +using int32_t = signed int; +using int64_t = signed long; + +// @Todo Proper type definition for Windows/Linux using uint8_t = unsigned char; using uint16_t = unsigned short; using uint32_t = unsigned int; -using uint64_t = unsigned long long; +using uint64_t = unsigned long; +using size_t = uint64_t; using isize_t = int64_t; diff --git a/asl/memory.hpp b/asl/memory.hpp index 33fa819..c73a165 100644 --- a/asl/memory.hpp +++ b/asl/memory.hpp @@ -2,7 +2,7 @@ #include "asl/integers.hpp" -constexpr void* operator new(uint64_t, void* ptr) +constexpr void* operator new(size_t, void* ptr) { return ptr; } diff --git a/asl/testing/testing.cpp b/asl/testing/testing.cpp index e07cde8..f0c4fb5 100644 --- a/asl/testing/testing.cpp +++ b/asl/testing/testing.cpp @@ -1,6 +1,6 @@ #include "asl/testing/testing.hpp" -#include +#include "asl/print.hpp" static asl::testing::Test* g_head = nullptr; static asl::testing::Test* g_tail = nullptr; diff --git a/asl/testing/testing.hpp b/asl/testing/testing.hpp index db2a64a..4fe44df 100644 --- a/asl/testing/testing.hpp +++ b/asl/testing/testing.hpp @@ -1,6 +1,6 @@ #pragma once -#include +#include "asl/utility.hpp" namespace asl::testing { diff --git a/asl/tests/option_tests.cpp b/asl/tests/option_tests.cpp index a42592a..e423cc9 100644 --- a/asl/tests/option_tests.cpp +++ b/asl/tests/option_tests.cpp @@ -1,6 +1,6 @@ #include "asl/option.hpp" #include "asl/tests/test_types.hpp" -#include +#include "asl/testing/testing.hpp" static_assert(asl::trivially_destructible>); static_assert(!asl::trivially_destructible>); -- cgit