Misc std related updates

This commit is contained in:
mintsuki 2023-03-23 03:57:33 +01:00
parent f569ce1059
commit b28fd30353
2 changed files with 14 additions and 3 deletions

View File

@ -11,7 +11,9 @@ typedef __builtin_va_list va_list;
#define va_start(v, l) __builtin_va_start(v, l) #define va_start(v, l) __builtin_va_start(v, l)
#define va_end(v) __builtin_va_end(v) #define va_end(v) __builtin_va_end(v)
#define va_arg(v, l) __builtin_va_arg(v, l) #define va_arg(v, l) __builtin_va_arg(v, l)
#define va_copy(d, s) __builtin_va_copy(d, s) #if (defined(__cplusplus) && (__cplusplus >= 201103L)) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
# define va_copy(d, s) __builtin_va_copy(d, s)
#endif
#endif #endif

View File

@ -8,12 +8,16 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
#ifndef __cplusplus #ifndef __cplusplus
typedef __WCHAR_TYPE__ wchar_t; typedef __WCHAR_TYPE__ wchar_t;
/* XXX fix to use proper __STDC_VERSION__ number later on */
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202000L)
typedef typeof(nullptr) nullptr_t;
#endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
typedef decltype(nullptr) nullptr_t; typedef decltype(nullptr) nullptr_t;
enum class byte : unsigned char {};
#endif #endif
#ifndef __STDDEF_H_MACROS #ifndef __STDDEF_H_MACROS
@ -31,6 +35,11 @@ enum class byte : unsigned char {};
#define offsetof(s, m) __builtin_offsetof(s, m) #define offsetof(s, m) __builtin_offsetof(s, m)
/* XXX fix to use proper __STDC_VERSION__ number later on */
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202000L)
# define unreachable() __builtin_unreachable()
#endif
#endif #endif
#endif #endif