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