summaryrefslogtreecommitdiff
path: root/asl
diff options
context:
space:
mode:
authorSteven Le Rouzic <steven.lerouzic@gmail.com>2024-10-28 18:39:01 +0100
committerSteven Le Rouzic <steven.lerouzic@gmail.com>2024-12-20 15:35:58 +0100
commit4a3185b782dabeb664fcf2fa4f6d17e36cf23d0e (patch)
tree2cc982f8972b7b809819032b41e618e8506abbd6 /asl
parente1f9d9ca1ef3c69da3b887b0af298be0aea4a5f9 (diff)
Start fixing some cross platform issues
Diffstat (limited to 'asl')
-rw-r--r--asl/assert.hpp3
-rw-r--r--asl/integers.hpp13
-rw-r--r--asl/memory.hpp2
-rw-r--r--asl/testing/testing.cpp2
-rw-r--r--asl/testing/testing.hpp2
-rw-r--r--asl/tests/option_tests.cpp2
6 files changed, 14 insertions, 10 deletions
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 <asl/print.hpp>
+#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 <asl/utility.hpp>
+#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 <asl/testing/testing.hpp>
+#include "asl/testing/testing.hpp"
static_assert(asl::trivially_destructible<asl::option<TriviallyDestructible>>);
static_assert(!asl::trivially_destructible<asl::option<HasDestructor>>);