From 06eb5a1467ba63ad95b9de0dcda922cb9cbe75fc Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 15 Dec 2022 02:57:36 +0200 Subject: [PATCH] Fixed header conflict --- libc/include/stdarg.h | 2 ++ libc/include/stddef.h | 5 +++++ libc/include/types.h | 18 +++--------------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/libc/include/stdarg.h b/libc/include/stdarg.h index f42c605..45202e9 100644 --- a/libc/include/stdarg.h +++ b/libc/include/stdarg.h @@ -1,7 +1,9 @@ #ifndef _STDARG_H #define _STDARG_H +#ifndef __va_list__ typedef __builtin_va_list va_list; +#endif #define va_start(ap, last) __builtin_va_start(ap, last) #define va_end(ap) __builtin_va_end(ap) diff --git a/libc/include/stddef.h b/libc/include/stddef.h index 0326705..d893259 100644 --- a/libc/include/stddef.h +++ b/libc/include/stddef.h @@ -1,7 +1,12 @@ #ifndef _STDDEF_H #define _STDDEF_H +#ifdef __cplusplus +#define NULL 0 +#else #define NULL ((void *)0) +#define bool _Bool +#endif typedef __INT8_TYPE__ int8_t; typedef __INT16_TYPE__ int16_t; diff --git a/libc/include/types.h b/libc/include/types.h index 272e08c..d1fa251 100644 --- a/libc/include/types.h +++ b/libc/include/types.h @@ -1,6 +1,9 @@ #ifndef __FENNIX_LIBC_TYPES_H__ #define __FENNIX_LIBC_TYPES_H__ +#include +#include + #ifdef __cplusplus #define EXTERNC extern "C" #define START_EXTERNC \ @@ -14,13 +17,6 @@ #define END_EXTERNC #endif -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void *)0) -#define bool _Bool -#endif - #define asm __asm__ #define asmv __asm__ volatile @@ -38,14 +34,6 @@ #define toupper(c) ((c)-0x20 * (((c) >= 'a') && ((c) <= 'z'))) #define tolower(c) ((c) + 0x20 * (((c) >= 'A') && ((c) <= 'Z'))) -#ifndef __va_list__ -typedef __builtin_va_list va_list; -#endif - -#define va_start(v, l) __builtin_va_start(v, l) -#define va_end(v) __builtin_va_end(v) -#define va_arg(v, l) __builtin_va_arg(v, l) - #define ALIGN_UP(x, align) ((__typeof__(x))(((uint64_t)(x) + ((align)-1)) & (~((align)-1)))) #define ALIGN_DOWN(x, align) ((__typeof__(x))((x) & (~((align)-1))))