summaryrefslogtreecommitdiff
path: root/asl
diff options
context:
space:
mode:
authorSteven Le Rouzic <steven.lerouzic@gmail.com>2024-07-30 00:18:28 +0200
committerSteven Le Rouzic <steven.lerouzic@gmail.com>2024-07-30 00:18:28 +0200
commit4e3fd3eac50d3685a7771b570741f2922c4e3693 (patch)
tree4417153cd454a1f09a8fbf7c3329819b50734c40 /asl
Initial commit
Diffstat (limited to 'asl')
-rw-r--r--asl/base/BUILD.bazel18
-rw-r--r--asl/base/integers.hpp12
-rw-r--r--asl/base/integers_tests.cpp13
3 files changed, 43 insertions, 0 deletions
diff --git a/asl/base/BUILD.bazel b/asl/base/BUILD.bazel
new file mode 100644
index 0000000..4ce905b
--- /dev/null
+++ b/asl/base/BUILD.bazel
@@ -0,0 +1,18 @@
+cc_library(
+ name = "base",
+ hdrs = [
+ "integers.hpp",
+ ],
+ visibility = ["//visibility:public"],
+)
+
+cc_test(
+ name = "integers_tests",
+ srcs = [
+ "integers_tests.cpp",
+ ],
+ deps = [
+ ":base",
+ ],
+)
+
diff --git a/asl/base/integers.hpp b/asl/base/integers.hpp
new file mode 100644
index 0000000..07fa11e
--- /dev/null
+++ b/asl/base/integers.hpp
@@ -0,0 +1,12 @@
+#pragma once
+
+using int8_t = char;
+using int16_t = short;
+using int32_t = int;
+using int64_t = long long;
+
+using uint8_t = unsigned char;
+using uint16_t = unsigned short;
+using uint32_t = unsigned int;
+using uint64_t = unsigned long long;
+
diff --git a/asl/base/integers_tests.cpp b/asl/base/integers_tests.cpp
new file mode 100644
index 0000000..587556d
--- /dev/null
+++ b/asl/base/integers_tests.cpp
@@ -0,0 +1,13 @@
+#include "asl/base/integers.hpp"
+
+static_assert(sizeof(int8_t) == 1);
+static_assert(sizeof(int16_t) == 2);
+static_assert(sizeof(int32_t) == 4);
+static_assert(sizeof(int64_t) == 8);
+
+static_assert(sizeof(uint8_t) == 1);
+static_assert(sizeof(uint16_t) == 2);
+static_assert(sizeof(uint32_t) == 4);
+static_assert(sizeof(uint64_t) == 8);
+
+int main() { return 0; }