Misc macro definition updates

This commit is contained in:
mintsuki 2023-04-16 07:24:29 +02:00
parent 144b9d3571
commit bbd441b204
9 changed files with 72 additions and 64 deletions

10
float.h
View File

@ -1,10 +1,10 @@
#if !defined(_FLOAT_H) || defined(__LIBC_CXX_WRAP)
#if !defined(__LIBC_CXX_WRAP)
#define _FLOAT_H 1
#if !defined(__FSTD_HDRS_FLOAT_H) || defined(__FSTD_HDRS_CXX_WRAP)
#if !defined(__FSTD_HDRS_CXX_WRAP)
#define __FSTD_HDRS_FLOAT_H 1
#endif
#ifndef __FLOAT_H_MACROS
#define __FLOAT_H_MACROS 1
#ifndef __FSTD_HDRS_FLOAT_H_MACROS
#define __FSTD_HDRS_FLOAT_H_MACROS 1
#define FLT_ROUNDS 1

View File

@ -1,5 +1,5 @@
#ifndef _ISO646_H
#define _ISO646_H 1
#ifndef __FSTD_HDRS_ISO646_H
#define __FSTD_HDRS_ISO646_H 1
#define and &&
#define and_eq &=

View File

@ -1,14 +1,14 @@
#if !defined(_LIMITS_H) || defined(__LIBC_CXX_WRAP)
#if !defined(__LIBC_CXX_WRAP)
#define _LIMITS_H 1
#if !defined(__FSTD_HDRS_LIMITS_H) || defined(__FSTD_HDRS_CXX_WRAP)
#if !defined(__FSTD_HDRS_CXX_WRAP)
#define __FSTD_HDRS_LIMITS_H 1
#endif
#ifndef __LIMITS_H_MACROS
#define __LIMITS_H_MACROS 1
#ifndef __FSTD_HDRS_LIMITS_H_MACROS
#define __FSTD_HDRS_LIMITS_H_MACROS 1
#ifndef __LIBC_C_JOIN
# define __LIBC_C_EXPAND_JOIN(x, suffix) x ## suffix
# define __LIBC_C_JOIN(x, suffix) __LIBC_C_EXPAND_JOIN(x, suffix)
#ifndef __FSTD_HDRS_C_JOIN
# define __FSTD_HDRS_C_EXPAND_JOIN(x, suffix) x ## suffix
# define __FSTD_HDRS_C_JOIN(x, suffix) __FSTD_HDRS_C_EXPAND_JOIN(x, suffix)
#endif
#define CHAR_BIT __CHAR_BIT__
@ -18,7 +18,7 @@
#define SCHAR_MAX __SCHAR_MAX__
#define SCHAR_MIN (-SCHAR_MAX - 1)
#define UCHAR_MAX (__LIBC_C_JOIN(SCHAR_MAX, U) * 2 + 1)
#define UCHAR_MAX (__FSTD_HDRS_C_JOIN(SCHAR_MAX, U) * 2 + 1)
#ifdef __CHAR_UNSIGNED__
# define CHAR_MAX UCHAR_MAX
@ -31,22 +31,22 @@
#define SHRT_MAX __SHRT_MAX__
#define SHRT_MIN (-SHRT_MAX - 1)
#define USHRT_MAX (__LIBC_C_JOIN(SHRT_MAX, U) * 2 + 1)
#define USHRT_MAX (__FSTD_HDRS_C_JOIN(SHRT_MAX, U) * 2 + 1)
#define INT_MAX __INT_MAX__
#define INT_MIN (-INT_MAX - 1)
#define UINT_MAX (__LIBC_C_JOIN(INT_MAX, U) * 2 + 1)
#define UINT_MAX (__FSTD_HDRS_C_JOIN(INT_MAX, U) * 2 + 1)
#define LONG_MAX __LONG_MAX__
#define LONG_MIN (-LONG_MAX - 1)
#define ULONG_MAX (__LIBC_C_JOIN(LONG_MAX, U) * 2 + 1)
#define ULONG_MAX (__FSTD_HDRS_C_JOIN(LONG_MAX, U) * 2 + 1)
#define LLONG_MAX __LONG_LONG_MAX__
#define LLONG_MIN (-LLONG_MAX - 1)
#define ULLONG_MAX (__LIBC_C_JOIN(LLONG_MAX, U) * 2 + 1)
#define ULLONG_MAX (__FSTD_HDRS_C_JOIN(LLONG_MAX, U) * 2 + 1)
#endif

View File

@ -1,10 +1,10 @@
#if !defined(_STDALIGN_H) || defined(__LIBC_CXX_WRAP)
#if !defined(__LIBC_CXX_WRAP)
#define _STDALIGN_H 1
#if !defined(__FSTD_HDRS_STDALIGN_H) || defined(__FSTD_HDRS_CXX_WRAP)
#if !defined(__FSTD_HDRS_CXX_WRAP)
#define __FSTD_HDRS_STDALIGN_H 1
#endif
#ifndef __STDALIGN_H_MACROS
#define __STDALIGN_H_MACROS 1
#ifndef __FSTD_HDRS_STDALIGN_H_MACROS
#define __FSTD_HDRS_STDALIGN_H_MACROS 1
#ifndef __cplusplus
# define alignas _Alignas

View File

@ -1,12 +1,12 @@
#if !defined(_STDARG_H) || defined(__LIBC_CXX_WRAP)
#if !defined(__LIBC_CXX_WRAP)
#define _STDARG_H 1
#if !defined(__FSTD_HDRS_STDARG_H) || defined(__FSTD_HDRS_CXX_WRAP)
#if !defined(__FSTD_HDRS_CXX_WRAP)
#define __FSTD_HDRS_STDARG_H 1
#endif
typedef __builtin_va_list va_list;
#ifndef __STDARG_H_MACROS
#define __STDARG_H_MACROS 1
#ifndef __FSTD_HDRS_STDARG_H_MACROS
#define __FSTD_HDRS_STDARG_H_MACROS 1
#define va_start(v, l) __builtin_va_start(v, l)
#define va_end(v) __builtin_va_end(v)

View File

@ -1,10 +1,10 @@
#if !defined(_STDBOOL_H) || defined(__LIBC_CXX_WRAP)
#if !defined(__LIBC_CXX_WRAP)
#define _STDBOOL_H 1
#if !defined(__FSTD_HDRS_STDBOOL_H) || defined(__FSTD_HDRS_CXX_WRAP)
#if !defined(__FSTD_HDRS_CXX_WRAP)
#define __FSTD_HDRS_STDBOOL_H 1
#endif
#ifndef __STDBOOL_H_MACROS
#define __STDBOOL_H_MACROS 1
#ifndef __FSTD_HDRS_STDBOOL_H_MACROS
#define __FSTD_HDRS_STDBOOL_H_MACROS 1
#ifndef __cplusplus
# define bool _Bool

View File

@ -1,6 +1,6 @@
#if !defined(_STDDEF_H) || defined(__LIBC_CXX_WRAP)
#if !defined(__LIBC_CXX_WRAP)
#define _STDDEF_H 1
#if !defined(__FSTD_HDRS_STDDEF_H) || defined(__FSTD_HDRS_CXX_WRAP)
#if !defined(__FSTD_HDRS_CXX_WRAP)
#define __FSTD_HDRS_STDDEF_H 1
#endif
typedef __SIZE_TYPE__ size_t;
@ -20,8 +20,8 @@ typedef typeof(nullptr) nullptr_t;
typedef decltype(nullptr) nullptr_t;
#endif
#ifndef __STDDEF_H_MACROS
#define __STDDEF_H_MACROS 1
#ifndef __FSTD_HDRS_STDDEF_H_MACROS
#define __FSTD_HDRS_STDDEF_H_MACROS 1
#ifdef NULL
#undef NULL

View File

@ -1,6 +1,6 @@
#if !defined(_STDINT_H) || defined(__LIBC_CXX_WRAP)
#if !defined(__LIBC_CXX_WRAP)
#define _STDINT_H 1
#if !defined(__FSTD_HDRS_STDINT_H) || defined(__FSTD_HDRS_CXX_WRAP)
#if !defined(__FSTD_HDRS_CXX_WRAP)
#define __FSTD_HDRS_STDINT_H 1
#endif
typedef __UINT8_TYPE__ uint8_t;
@ -39,28 +39,28 @@ typedef __INTPTR_TYPE__ intptr_t;
typedef __UINTMAX_TYPE__ uintmax_t;
typedef __INTMAX_TYPE__ intmax_t;
#ifndef __STDINT_H_MACROS
#define __STDINT_H_MACROS 1
#ifndef __FSTD_HDRS_STDINT_H_MACROS
#define __FSTD_HDRS_STDINT_H_MACROS 1
/* Clang and GCC have different mechanisms for INT32_C and friends. */
#ifdef __clang__
# ifndef __LIBC_C_JOIN
# define __LIBC_C_EXPAND_JOIN(x, suffix) x ## suffix
# define __LIBC_C_JOIN(x, suffix) __LIBC_C_EXPAND_JOIN(x, suffix)
# ifndef __FSTD_HDRS_C_JOIN
# define __FSTD_HDRS_C_EXPAND_JOIN(x, suffix) x ## suffix
# define __FSTD_HDRS_C_JOIN(x, suffix) __FSTD_HDRS_C_EXPAND_JOIN(x, suffix)
# endif
# define INT8_C(x) __LIBC_C_JOIN(x, __INT8_C_SUFFIX__)
# define INT16_C(x) __LIBC_C_JOIN(x, __INT16_C_SUFFIX__)
# define INT32_C(x) __LIBC_C_JOIN(x, __INT32_C_SUFFIX__)
# define INT64_C(x) __LIBC_C_JOIN(x, __INT64_C_SUFFIX__)
# define INT8_C(x) __FSTD_HDRS_C_JOIN(x, __INT8_C_SUFFIX__)
# define INT16_C(x) __FSTD_HDRS_C_JOIN(x, __INT16_C_SUFFIX__)
# define INT32_C(x) __FSTD_HDRS_C_JOIN(x, __INT32_C_SUFFIX__)
# define INT64_C(x) __FSTD_HDRS_C_JOIN(x, __INT64_C_SUFFIX__)
# define UINT8_C(x) __LIBC_C_JOIN(x, __UINT8_C_SUFFIX__)
# define UINT16_C(x) __LIBC_C_JOIN(x, __UINT16_C_SUFFIX__)
# define UINT32_C(x) __LIBC_C_JOIN(x, __UINT32_C_SUFFIX__)
# define UINT64_C(x) __LIBC_C_JOIN(x, __UINT64_C_SUFFIX__)
# define UINT8_C(x) __FSTD_HDRS_C_JOIN(x, __UINT8_C_SUFFIX__)
# define UINT16_C(x) __FSTD_HDRS_C_JOIN(x, __UINT16_C_SUFFIX__)
# define UINT32_C(x) __FSTD_HDRS_C_JOIN(x, __UINT32_C_SUFFIX__)
# define UINT64_C(x) __FSTD_HDRS_C_JOIN(x, __UINT64_C_SUFFIX__)
# define INTMAX_C(x) __LIBC_C_JOIN(x, __INTMAX_C_SUFFIX__)
# define UINTMAX_C(x) __LIBC_C_JOIN(x, __UINTMAX_C_SUFFIX__)
# define INTMAX_C(x) __FSTD_HDRS_C_JOIN(x, __INTMAX_C_SUFFIX__)
# define UINTMAX_C(x) __FSTD_HDRS_C_JOIN(x, __UINTMAX_C_SUFFIX__)
#else
# define INT8_C(x) __INT8_C(x)
# define INT16_C(x) __INT16_C(x)
@ -137,11 +137,19 @@ typedef __INTMAX_TYPE__ intmax_t;
#define SIZE_MAX __SIZE_MAX__
#define WCHAR_MAX __WCHAR_MAX__
#define WCHAR_MIN (-WCHAR_MAX - 1)
#ifndef WCHAR_MAX
# define WCHAR_MAX __WCHAR_MAX__
#endif
#ifndef WCHAR_MIN
# define WCHAR_MIN (-WCHAR_MAX - 1)
#endif
#define WINT_MAX __WINT_MAX__
#define WINT_MIN (-WINT_MAX - 1)
#ifndef WINT_MAX
# define WINT_MAX __WINT_MAX__
#endif
#ifndef WINT_MIN
# define WINT_MIN (-WINT_MAX - 1)
#endif
#endif

View File

@ -1,5 +1,5 @@
#ifndef _STDNORETURN_H
#define _STDNORETURN_H 1
#ifndef __FSTD_HDRS_STDNORETURN_H
#define __FSTD_HDRS_STDNORETURN_H 1
#define noreturn _Noreturn