Rework include guards

This commit is contained in:
mintsuki 2023-03-15 23:08:11 +01:00
parent b447ceb80b
commit 12c13fb867
7 changed files with 36 additions and 36 deletions

10
float.h
View File

@ -1,6 +1,10 @@
#if !defined(_FLOAT_H) || defined(__LIBC_GUARDLESS_INCLUDE)
#if !defined(__LIBC_GUARDLESS_INCLUDE)
#define _FLOAT_H 1
#endif
#ifndef _FLOAT_H
#ifndef __FLOAT_H_MACROS
#define __FLOAT_H_MACROS 1
#define FLT_ROUNDS 1
@ -52,8 +56,4 @@
#endif
#if !defined(__LIBC_GUARDLESS_INCLUDE)
#define _FLOAT_H 1
#endif
#endif

View File

@ -1,6 +1,10 @@
#if !defined(_LIMITS_H) || defined(__LIBC_GUARDLESS_INCLUDE)
#if !defined(__LIBC_GUARDLESS_INCLUDE)
#define _LIMITS_H 1
#endif
#ifndef _LIMITS_H
#ifndef __LIMITS_H_MACROS
#define __LIMITS_H_MACROS 1
#ifndef __LIBC_C_JOIN
# define __LIBC_C_EXPAND_JOIN(x, suffix) x ## suffix
@ -46,8 +50,4 @@
#endif
#if !defined(__LIBC_GUARDLESS_INCLUDE)
#define _LIMITS_H 1
#endif
#endif

View File

@ -1,6 +1,10 @@
#if !defined(_STDALIGN_H) || defined(__LIBC_GUARDLESS_INCLUDE)
#if !defined(__LIBC_GUARDLESS_INCLUDE)
#define _STDALIGN_H 1
#endif
#ifndef _STDALIGN_H
#ifndef __STDALIGN_H_MACROS
#define __STDALIGN_H_MACROS 1
#ifndef __cplusplus
# define alignas _Alignas
@ -13,8 +17,4 @@
#endif
#if !defined(__LIBC_GUARDLESS_INCLUDE)
#define _STDALIGN_H 1
#endif
#endif

View File

@ -1,8 +1,12 @@
#if !defined(_STDARG_H) || defined(__LIBC_GUARDLESS_INCLUDE)
#if !defined(__LIBC_GUARDLESS_INCLUDE)
#define _STDARG_H 1
#endif
typedef __builtin_va_list va_list;
#ifndef _STDARG_H
#ifndef __STDARG_H_MACROS
#define __STDARG_H_MACROS 1
#define va_start(v, l) __builtin_va_start(v, l)
#define va_end(v) __builtin_va_end(v)
@ -11,8 +15,4 @@ typedef __builtin_va_list va_list;
#endif
#if !defined(__LIBC_GUARDLESS_INCLUDE)
#define _STDARG_H 1
#endif
#endif

View File

@ -1,4 +1,10 @@
#if !defined(_STDBOOL_H) || defined(__LIBC_GUARDLESS_INCLUDE)
#if !defined(__LIBC_GUARDLESS_INCLUDE)
#define _STDBOOL_H 1
#endif
#ifndef __STDBOOL_H_MACROS
#define __STDBOOL_H_MACROS 1
#ifndef __cplusplus
# define bool _Bool
@ -7,14 +13,8 @@
# define false 0
#endif
#ifndef _STDBOOL_H
#define __bool_true_false_are_defined 1
#endif
#if !defined(__LIBC_GUARDLESS_INCLUDE)
#define _STDBOOL_H 1
#endif
#endif

View File

@ -1,4 +1,7 @@
#if !defined(_STDDEF_H) || defined(__LIBC_GUARDLESS_INCLUDE)
#if !defined(__LIBC_GUARDLESS_INCLUDE)
#define _STDDEF_H 1
#endif
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
@ -13,7 +16,8 @@ typedef decltype(nullptr) nullptr_t;
enum class byte : unsigned char {};
#endif
#ifndef _STDDEF_H
#ifndef __STDDEF_H_MACROS
#define __STDDEF_H_MACROS 1
#ifdef NULL
#undef NULL
@ -29,8 +33,4 @@ enum class byte : unsigned char {};
#endif
#if !defined(__LIBC_GUARDLESS_INCLUDE)
#define _STDDEF_H 1
#endif
#endif

View File

@ -1,4 +1,7 @@
#if !defined(_STDINT_H) || defined(__LIBC_GUARDLESS_INCLUDE)
#if !defined(__LIBC_GUARDLESS_INCLUDE)
#define _STDINT_H 1
#endif
typedef __UINT8_TYPE__ uint8_t;
typedef __UINT16_TYPE__ uint16_t;
@ -36,7 +39,8 @@ typedef __INTPTR_TYPE__ intptr_t;
typedef __UINTMAX_TYPE__ uintmax_t;
typedef __INTMAX_TYPE__ intmax_t;
#ifndef _STDINT_H
#ifndef __STDINT_H_MACROS
#define __STDINT_H_MACROS 1
/* Clang and GCC have different mechanisms for INT32_C and friends. */
#ifdef __clang__
@ -139,8 +143,4 @@ typedef __INTMAX_TYPE__ intmax_t;
#endif
#if !defined(__LIBC_GUARDLESS_INCLUDE)
#define _STDINT_H 1
#endif
#endif