From bf4af8166405773c82d2f40ddd2f6379dd5f0add Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sat, 1 Jun 2019 08:44:18 +0200 Subject: [PATCH] mescc: Mes C Library: Avoid type/size_t conflicts. * include/alloca.h: Remove typedefs, include sys/types.h. * include/stdint.h: Likewise. * include/string.h: Likewise. --- include/alloca.h | 6 +----- include/stdint.h | 20 +------------------- include/string.h | 16 +--------------- 3 files changed, 3 insertions(+), 39 deletions(-) diff --git a/include/alloca.h b/include/alloca.h index 692f8fb0..aceea860 100644 --- a/include/alloca.h +++ b/include/alloca.h @@ -29,11 +29,7 @@ #else // ! SYSTEM_LIBC -#ifndef __MES_SIZE_T -#define __MES_SIZE_T -#undef size_t -typedef unsigned long size_t; -#endif +#include #if _ALLOCA_UNSIGNED void *alloca (unsigned size); diff --git a/include/stdint.h b/include/stdint.h index 68821dbe..8b8994e3 100644 --- a/include/stdint.h +++ b/include/stdint.h @@ -58,28 +58,10 @@ typedef int int32_t; typedef unsigned long long uint64_t; typedef long long int64_t; -#ifndef __MES_SIZE_T -#define __MES_SIZE_T -#undef size_t -typedef unsigned long size_t; -#endif - -#ifndef __MES_INTPTR_T -#define __MES_INTPTR_T -#undef intptr_t -typedef long intptr_t; -#endif - -// FIXME typedef int intmax_t; typedef unsigned uintmax_t; -typedef unsigned* uintptr_t; -#ifndef __MES_PTRDIFF_T -#define __MES_PTRDIFF_T -#undef ptrdiff_t -typedef long ptrdiff_t; -#endif +#include #define CHAR_BIT 8 #define CHAR_MAX 255 diff --git a/include/string.h b/include/string.h index e8748dd6..60b2887e 100644 --- a/include/string.h +++ b/include/string.h @@ -29,21 +29,7 @@ #else // ! SYSTEM_LIBC -#ifndef NULL -#define NULL 0 -#endif - -#ifndef __MES_SIZE_T -#define __MES_SIZE_T -#undef size_t -typedef unsigned long size_t; -#endif - -#ifndef __MES_SSIZE_T -#define __MES_SSIZE_T -#undef ssize_t -typedef long ssize_t; -#endif +#include void *memchr (void const *block, int c, size_t size); void *memcpy (void *dest, void const *src, size_t n);