mescc: Support glibc-2.2.5: header tweaks.

* include/sys/types.h [__PTRDIFF_T]: Extra guard for ptrdiff_t.
  [__SIZE_T]: Extra guard for size_t.
* include/stdlib.h: Include alloca; remove alloca prototype,
* include/errno.h: Add E2BIG.
This commit is contained in:
Jan Nieuwenhuizen 2018-06-21 00:27:27 +02:00
parent 41a6585295
commit c2ff5ec954
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
5 changed files with 30 additions and 6 deletions

View file

@ -28,7 +28,21 @@
#include_next <alloca.h>
#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

View file

@ -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

View file

@ -25,6 +25,13 @@
#include_next <stddef.h>
#else // ! WITH_GLIBC
#ifndef __MES_SIZE_T
#define __MES_SIZE_T
#undef size_t
typedef unsigned long size_t;
#endif
#include <sys/types.h>
#include <stdint.h>
#include <unistd.h>

View file

@ -29,12 +29,8 @@
#else // ! WITH_GLIBC
#include <sys/types.h>
#include <alloca.h>
#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);

View file

@ -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