diff --git a/include/alloca.h b/include/alloca.h index b06ffbaf..6643b142 100644 --- a/include/alloca.h +++ b/include/alloca.h @@ -28,7 +28,21 @@ #include_next #else // ! WITH_GLIBC -void* alloca (size_t); + +#ifndef __MES_SIZE_T +#define __MES_SIZE_T +#undef size_t +typedef unsigned long size_t; +#endif + +#if _ALLOCA_UNSIGNED +void * alloca (unsigned size); +#elif _ALLOCA_CHAR +char * alloca (int); +#else +void * alloca (size_t size); +#endif + #endif // ! WITH_GLIBC #endif // __MES_ALLOCA_H diff --git a/include/errno.h b/include/errno.h index 19e8f5c0..49c515c7 100644 --- a/include/errno.h +++ b/include/errno.h @@ -31,6 +31,7 @@ int errno; #define ENOENT 2 #define EINTR 4 #define EIO 5 +#define E2BIG 7 #define EBADF 9 #define EAGAIN 11 #define ENOMEM 12 diff --git a/include/stddef.h b/include/stddef.h index 1283066f..e352bf63 100644 --- a/include/stddef.h +++ b/include/stddef.h @@ -25,6 +25,13 @@ #include_next #else // ! WITH_GLIBC +#ifndef __MES_SIZE_T +#define __MES_SIZE_T +#undef size_t +typedef unsigned long size_t; +#endif + +#include #include #include diff --git a/include/stdlib.h b/include/stdlib.h index 5c5beda2..99f72bbd 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -29,12 +29,8 @@ #else // ! WITH_GLIBC #include +#include -#if _ALLOCA_UNSIGNED -void * alloca (unsigned size); -#else -void * alloca (size_t size); -#endif int atoi (char const *s); int atexit (void (*function) (void)); void * calloc (size_t nmemb, size_t size); diff --git a/include/sys/types.h b/include/sys/types.h index 0b275b19..11949317 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -87,11 +87,14 @@ typedef unsigned long off_t; typedef int pid_t; #endif +#ifndef __PTRDIFF_T +#define __PTRDIFF_T #ifndef __MES_PTRDIFF_T #define __MES_PTRDIFF_T #undef ptrdiff_t typedef long ptrdiff_t; #endif +#endif #ifndef __MES_SIGVAL_T #define __MES_SIGVAL_T @@ -99,11 +102,14 @@ typedef long ptrdiff_t; typedef int sigval_t; #endif +#ifndef __SIZE_T +#define __SIZE_T #ifndef __MES_SIZE_T #define __MES_SIZE_T #undef size_t typedef unsigned long size_t; #endif +#endif #ifndef __MES_SSIZE_T #define __MES_SSIZE_T