Incorrect standard library headers
alexfru opened this issue · 1 comments
alexfru commented
include/stddef.h: missing: NULL, size_t, ptrdiff_t.
How about adding the following?:
#ifndef NULL
#define NULL 0
#endif
#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned size_t;
#endif
typedef int ptrdiff_t;
sys/include/types.h: is included from stdio.h, stdlib.h, string.h, time.h and unnecessarily pollutes the name/type space with things that aren't in the C standard. Most of the things defined in sys/include/types.h should not be visible to anyone including standard C headers. Nobody expects to get ushort when including stdio.h. I suggest replacing #include<sys/types.h> in stdio.h, stdlib.h, string.h, time.h with proper typedefs that are really needed, e.g. size_t, time_t (time_t will have to be typedef'd under #ifndef in both time.h and types.h).