stdalign.h, stdbool.h, stdnoreturn.h

This commit is contained in:
bumbread 2022-08-06 23:12:36 +11:00
parent 6e941f6ac8
commit 9fef829466
6 changed files with 27 additions and 42 deletions

View File

@ -12,15 +12,8 @@ in different kinds of programs.
The implementation doesn't provide all headers. The headers that aren't The implementation doesn't provide all headers. The headers that aren't
provided are supposed to be provided by compiler. The list of such headers: provided are supposed to be provided by compiler. The list of such headers:
- float.h
- iso646.h
- limits.h
- stdalign.h
- stdarg.h - stdarg.h
- stdbool.h - setjmp.h
- stddef.h
- stdint.h
- stdnoreturn.h
The headers that are provided have documentation included: The headers that are provided have documentation included:

View File

@ -5,17 +5,25 @@
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
#include <fenv.h> #include <fenv.h>
#include <float.h>
#include <inttypes.h> #include <inttypes.h>
#include <iso646.h>
#include <limits.h> #include <limits.h>
#include <locale.h> #include <locale.h>
#include <math.h> #include <math.h>
#include <setjmp.h>
#include <signal.h> #include <signal.h>
#include <stdalign.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdatomic.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdnoreturn.h>
#include <string.h> #include <string.h>
#include <tgmath.h>
#include <threads.h> #include <threads.h>
#include <time.h> #include <time.h>
#include <uchar.h> #include <uchar.h>

8
inc/stdalign.h Normal file
View File

@ -0,0 +1,8 @@
#pragma once
#define __alignas_is_defined 1
#define __alignof_is_defined 1
#define alignas _Alignas
#define alignof _Alignof

View File

@ -1,14 +1,8 @@
#pragma once #pragma once
#if !defined(bool) #define __bool_true_false_are_defined 1
#define bool _Bool
#endif
#if !defined(true) #define bool _Bool
#define true 1 #define true 1
#endif #define false 0
#if !defined(false)
#define false 0
#endif

View File

@ -1,35 +1,11 @@
#pragma once #pragma once
#define __bool_true_false_are_defined 1
#define __alignas_is_defined 1
#define __alignof_is_defined 1
#if !defined(NULL) #if !defined(NULL)
#define NULL ((void *)0) #define NULL ((void *)0)
#endif #endif
#if !defined(bool)
#define bool _Bool
#endif
#if !defined(true)
#define true 1
#endif
#if !defined(false)
#define false 0
#endif
#define offsetof(st, m) ((size_t)((char *)&((st *)0)->m - (char *)0)) #define offsetof(st, m) ((size_t)((char *)&((st *)0)->m - (char *)0))
#define alignas _Alignas
#define alignof _Alignof
#if !defined(_MSC_VER)
#define noreturn _Noreturn
#else
#define noreturn declspec(noreturn)
#endif
#if defined(_WIN32) #if defined(_WIN32)
typedef long long ptrdiff_t; typedef long long ptrdiff_t;

6
inc/stdnoreturn.h Normal file
View File

@ -0,0 +1,6 @@
#pragma once
#if !defined(noreturn)
#define noreturn _Noreturn
#endif