xref: /linux/tools/include/nolibc/stddef.h (revision 015a99fa76650e7d6efa3e36f20c0f5b346fe9ce)
1*2217abe0SThomas Weißschuh /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
2*2217abe0SThomas Weißschuh /*
3*2217abe0SThomas Weißschuh  * Stddef definitions for NOLIBC
4*2217abe0SThomas Weißschuh  * Copyright (C) 2017-2021 Willy Tarreau <w@1wt.eu>
5*2217abe0SThomas Weißschuh  */
6*2217abe0SThomas Weißschuh 
7*2217abe0SThomas Weißschuh /* make sure to include all global symbols */
8*2217abe0SThomas Weißschuh #include "nolibc.h"
9*2217abe0SThomas Weißschuh 
10*2217abe0SThomas Weißschuh #ifndef _NOLIBC_STDDEF_H
11*2217abe0SThomas Weißschuh #define _NOLIBC_STDDEF_H
12*2217abe0SThomas Weißschuh 
13*2217abe0SThomas Weißschuh #include "stdint.h"
14*2217abe0SThomas Weißschuh 
15*2217abe0SThomas Weißschuh /* note: may already be defined */
16*2217abe0SThomas Weißschuh #ifndef NULL
17*2217abe0SThomas Weißschuh #define NULL ((void *)0)
18*2217abe0SThomas Weißschuh #endif
19*2217abe0SThomas Weißschuh 
20*2217abe0SThomas Weißschuh #ifndef offsetof
21*2217abe0SThomas Weißschuh #define offsetof(TYPE, FIELD) ((size_t) &((TYPE *)0)->FIELD)
22*2217abe0SThomas Weißschuh #endif
23*2217abe0SThomas Weißschuh 
24*2217abe0SThomas Weißschuh #endif /* _NOLIBC_STDDEF_H */
25