xref: /minix/include/stddef.h (revision 58a2b000)
1 /* The <stddef.h> header defines certain commonly used macros. */
2 
3 #ifndef _STDDEF_H
4 #define _STDDEF_H
5 
6 #include <sys/null.h>
7 
8 /* The following is not portable, but the compiler accepts it. */
9 #ifdef __GNUC__
10 #define offsetof(type, ident)	__builtin_offsetof (type, ident)
11 #else
12 #define offsetof(type, ident)	((size_t) (unsigned long) &((type *)0)->ident)
13 #endif
14 
15 #if _EM_PSIZE == _EM_WSIZE
16 typedef int ptrdiff_t;		/* result of subtracting two pointers */
17 #else	/* _EM_PSIZE == _EM_LSIZE */
18 typedef long ptrdiff_t;
19 #endif
20 
21 #ifndef _SIZE_T
22 #define _SIZE_T
23 typedef unsigned int size_t;	/* type returned by sizeof */
24 #endif
25 
26 #ifndef _WCHAR_T
27 #define _WCHAR_T
28 typedef char wchar_t;		/* type expanded character set */
29 #endif
30 
31 #endif /* _STDDEF_H */
32