linux/tools/include/nolibc/stddef.h
Thomas Weißschuh 2217abe09c tools/nolibc: move NULL and offsetof() to sys/stddef.h
This is the location regular userspace expects these definitions.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20250515-nolibc-sys-v1-8-74f82eea3b59@weissschuh.net
2025-05-21 15:32:25 +02:00

24 lines
476 B
C

/* SPDX-License-Identifier: LGPL-2.1 OR MIT */
/*
* Stddef definitions for NOLIBC
* Copyright (C) 2017-2021 Willy Tarreau <w@1wt.eu>
*/
/* make sure to include all global symbols */
#include "nolibc.h"
#ifndef _NOLIBC_STDDEF_H
#define _NOLIBC_STDDEF_H
#include "stdint.h"
/* note: may already be defined */
#ifndef NULL
#define NULL ((void *)0)
#endif
#ifndef offsetof
#define offsetof(TYPE, FIELD) ((size_t) &((TYPE *)0)->FIELD)
#endif
#endif /* _NOLIBC_STDDEF_H */