aboutsummaryrefslogtreecommitdiff
path: root/lib/compiler/aro/include/stddef.h
blob: bda4c942974b983d9cff27f1c2a2fcfcca19802d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* <stddef.h> for the Aro C compiler */

#pragma once

#define __STDC_VERSION_STDDEF_H__ 202311L

typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __SIZE_TYPE__ size_t;
typedef __WCHAR_TYPE__ wchar_t;

/* define max_align_t to match GCC and Clang */
typedef struct {
  long long __aro_max_align_ll;
  long double __aro_max_align_ld;
} max_align_t;

#define NULL ((void*)0)
#define offsetof(T, member) __builtin_offsetof(T, member)

#if __STDC_VERSION__ >= 202311L
#  pragma GCC diagnostic push
#  pragma GCC diagnostic ignored "-Wpre-c23-compat"
   typedef typeof(nullptr) nullptr_t;
#  pragma GCC diagnostic pop

#  if defined unreachable
#    error unreachable() is a standard macro in C23
#  else
#    define unreachable() __builtin_unreachable()
#  endif
#endif