stddef.h 476 B

123456789101112131415161718192021222324
  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. /* make sure to include all global symbols */
  7. #include "nolibc.h"
  8. #ifndef _NOLIBC_STDDEF_H
  9. #define _NOLIBC_STDDEF_H
  10. #include "stdint.h"
  11. /* note: may already be defined */
  12. #ifndef NULL
  13. #define NULL ((void *)0)
  14. #endif
  15. #ifndef offsetof
  16. #define offsetof(TYPE, FIELD) ((size_t) &((TYPE *)0)->FIELD)
  17. #endif
  18. #endif /* _NOLIBC_STDDEF_H */