From 0fc18b04d57ca2337744909deb911e325ce9e169 Mon Sep 17 00:00:00 2001 From: h3llll Date: Wed, 12 Nov 2025 14:24:09 +0200 Subject: [PATCH] feat(core)!: move types.h to core/types.h and modify include paths accordingly --- core/arena.h | 2 +- core/linear.h | 2 +- core/types.h | 24 ++++++++++++++++++++++++ core/vector.h | 2 +- rendering/vk/physical_device.h | 2 +- rendering/vk/vk.h | 2 +- rgfw.h | 2 +- topaz.c | 2 +- 8 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 core/types.h diff --git a/core/arena.h b/core/arena.h index 03cae3d..c3653de 100644 --- a/core/arena.h +++ b/core/arena.h @@ -2,7 +2,7 @@ #ifndef ARENA_H #define ARENA_H -#include "../types.h" +#include "../core/types.h" /* * An arena is a fast allocator that just keeps everything in a contiguous diff --git a/core/linear.h b/core/linear.h index 9cf32e9..ad4120b 100644 --- a/core/linear.h +++ b/core/linear.h @@ -5,7 +5,7 @@ #include #include #include -#include "../types.h" +#include "../core/types.h" #define PI 3.14159265358979323846 #define RAD(deg) deg * (PI / 180.0f) diff --git a/core/types.h b/core/types.h new file mode 100644 index 0000000..9119a47 --- /dev/null +++ b/core/types.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier:BSD-3-Clause */ +#ifndef TYPES_H +#define TYPES_H + +#include +#include + +typedef uint8_t u8; +typedef uint16_t u16; +typedef uint32_t u32; +typedef uint64_t u64; + +typedef int8_t i8; +typedef int16_t i16; +typedef int32_t i32; +typedef int64_t i64; + +typedef size_t usize; + +typedef float f32; +typedef double f64; + + +#endif diff --git a/core/vector.h b/core/vector.h index ff7396a..4ab6a4f 100644 --- a/core/vector.h +++ b/core/vector.h @@ -3,7 +3,7 @@ #define VECTOR_H #include -#include "../types.h" +#include "../core/types.h" /* * The vector is a dynamically growing array that can be operated as a regular diff --git a/rendering/vk/physical_device.h b/rendering/vk/physical_device.h index 66a808c..3ad162f 100644 --- a/rendering/vk/physical_device.h +++ b/rendering/vk/physical_device.h @@ -3,7 +3,7 @@ #define PHYSICAL_DEVICE_H #include "vk.h" -#include "../../types.h" +#include "../../core/types.h" #include "../../core/vector.h" diff --git a/rendering/vk/vk.h b/rendering/vk/vk.h index bdadf46..9a4c2cb 100644 --- a/rendering/vk/vk.h +++ b/rendering/vk/vk.h @@ -3,7 +3,7 @@ #define VK_H #include -#include "../../types.h" +#include "../../core/types.h" #include "../../rgfw.h" struct queue_family_indices { diff --git a/rgfw.h b/rgfw.h index daef0ab..5e792c3 100644 --- a/rgfw.h +++ b/rgfw.h @@ -353,7 +353,7 @@ extern "C" { #define RGFW_HEADER -#include "types.h" +#include "core/types.h" typedef ptrdiff_t RGFW_ssize_t; diff --git a/topaz.c b/topaz.c index a3084fc..df11ecd 100644 --- a/topaz.c +++ b/topaz.c @@ -3,7 +3,7 @@ #include #include "platform.h" #include "core/arena.h" -#include "types.h" +#include "core/types.h" struct arena_allocator *global_arena = NULL;