X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=includes%2Fstddef.h;h=cec8dfbaddcf14a856f0db8843ca87dfd4a8f78f;hp=1c138c7b91324e75b5657d14369a05ae9f3154ac;hb=1d9d92ba957a0b8307c9a65c35867fde68e6533b;hpb=70f1c6f7c9d515ef426da68973511f46de57005a diff --git a/includes/stddef.h b/includes/stddef.h index 1c138c7..cec8dfb 100644 --- a/includes/stddef.h +++ b/includes/stddef.h @@ -1,31 +1,46 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Common definitions -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Common definitions + * ---------------------------------------------------------------------------- + * This header is part of a freestanding implementation + * --------------------------------------------------------------------------*/ -#ifndef __STDDEF_H -#define __STDDEF_H __STDDEF_H +#ifndef _STDDEF_H +#define _STDDEF_H _STDDEF_H -// TODO: Documentation +#ifndef _NULL +#include "__intern.h" +#endif -// ---------------------------------------------------------------------------- -// MACROS +/* TODO: Documentation */ -#define NULL 0 -#define offsetof( s-type, mbr ) // TODO - personality? +/* ---------------------------------------------------------------------------- + * MACROS + * --------------------------------------------------------------------------*/ -// ---------------------------------------------------------------------------- -// TYPEDEFS +#define NULL _NULL -typedef ptrdiff_t; // TODO - personality? -typedef size_t; // TODO - personality? +#define offsetof( s-type, mbr ) /* TODO - to __intern.h / __personality.h? */ -#ifndef __cplusplus -typedef wchar_t; // TODO - personality? -#endif // __cplusplus +/* ---------------------------------------------------------------------------- + * TYPEDEFS + * --------------------------------------------------------------------------*/ -#endif // __STDDEF_H +#ifndef _SIZE_T +#define _SIZE_T _SIZE_T +typedef __size_t size_t; +#endif /* _SIZE_T */ + +#ifndef _WCHAR_T +#define _WCHAR_T _WCHAR_T +typedef __wchar_t wchar_t; +#endif /* _WCHAR_T */ + +/* Look this up in the C Standard Rationale, which has example code on this. */ +typedef ptrdiff_t; /* TODO - to __intern.h / __personality.h? */ + +#endif /* _STDDEF_H */