65816-llvm-mos/runtime/include/stddef.h
2026-05-30 19:40:29 -05:00

27 lines
581 B
C

// Minimal stddef.h for the W65816 runtime. Standalone (does not
// include the host clang's stddef.h).
#ifndef _STDDEF_H
#define _STDDEF_H
typedef unsigned long size_t;
typedef int ptrdiff_t;
// wchar_t is a built-in keyword in C++; only typedef in C.
#ifndef __cplusplus
#ifndef _WCHAR_T_DEFINED
# define _WCHAR_T_DEFINED
typedef int wchar_t; // matches clang builtin signature
#endif
#endif
#ifndef NULL
# ifdef __cplusplus
# define NULL 0
# else
# define NULL ((void *)0)
# endif
#endif
#define offsetof(t, m) __builtin_offsetof(t, m)
#endif