File tree Expand file tree Collapse file tree 4 files changed +26
-9
lines changed Expand file tree Collapse file tree 4 files changed +26
-9
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ all_files := \
44
44
std.h \
45
45
stdarg.h \
46
46
stdbool.h \
47
+ stddef.h \
47
48
stdint.h \
48
49
stdlib.h \
49
50
string.h \
Original file line number Diff line number Diff line change 13
13
* syscall-specific stuff, as this file is expected to be included very early.
14
14
*/
15
15
16
- /* note: may already be defined */
17
- #ifndef NULL
18
- #define NULL ((void *)0)
19
- #endif
20
-
21
16
#include "stdint.h"
17
+ #include "stddef.h"
22
18
23
19
/* those are commonly provided by sys/types.h */
24
20
typedef unsigned int dev_t ;
Original file line number Diff line number Diff line change
1
+ /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
2
+ /*
3
+ * Stddef definitions for NOLIBC
4
+ * Copyright (C) 2017-2021 Willy Tarreau <[email protected] >
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 */
Original file line number Diff line number Diff line change @@ -188,10 +188,6 @@ struct stat {
188
188
typedef __kernel_clockid_t clockid_t ;
189
189
typedef int timer_t ;
190
190
191
- #ifndef offsetof
192
- #define offsetof (TYPE , FIELD ) ((size_t) &((TYPE *)0)->FIELD)
193
- #endif
194
-
195
191
#ifndef container_of
196
192
#define container_of (PTR , TYPE , FIELD ) ({ \
197
193
__typeof__(((TYPE *)0)->FIELD) *__FIELD_PTR = (PTR); \
You can’t perform that action at this time.
0 commit comments