From bf0d06eeb43e818f3a102d30bcabd74ee0301634 Mon Sep 17 00:00:00 2001 From: flysand7 Date: Wed, 2 Aug 2023 20:05:26 +1100 Subject: [PATCH] stddef.h --- src/include/cia-def.h | 14 ++++++++------ src/include/stddef.h | 10 ++++++++++ src/include/stdio.h | 2 -- 3 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 src/include/stddef.h diff --git a/src/include/cia-def.h b/src/include/cia-def.h index 03ea4f3..8967626 100644 --- a/src/include/cia-def.h +++ b/src/include/cia-def.h @@ -4,14 +4,12 @@ // Include platform stuff #include -// Pre-C23 keyword macros and stddef +// Pre-C23 keyword macros #define static_assert _Static_assert -#define NULL ((void *)0) - -// Assert commonly-accepted platform-invariant sizes -#include -#include +// Stdint and a layer on top +#include + // Short type definitions typedef int8_t i8; typedef uint8_t u8; @@ -21,3 +19,7 @@ typedef int32_t i32; typedef uint32_t u32; typedef int64_t i64; typedef uint64_t u64; + +// Other commonly-used standard includes +#include +#include diff --git a/src/include/stddef.h b/src/include/stddef.h new file mode 100644 index 0000000..3bcc162 --- /dev/null +++ b/src/include/stddef.h @@ -0,0 +1,10 @@ + +#pragma once + +#include + +typedef u64 size_t; + +#if !defined(NULL) + #define NULL ((void *)0) +#endif diff --git a/src/include/stdio.h b/src/include/stdio.h index 9048a92..1fbea3b 100644 --- a/src/include/stdio.h +++ b/src/include/stdio.h @@ -4,8 +4,6 @@ #include #include -typedef u64 size_t; - typedef struct FILE FILE; struct FILE { _RT_File rt_file;