From 69a71425f1c616d8a62a8f2bb8f340dfc0543de7 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Wed, 16 Jan 2019 13:21:36 +0100 Subject: [PATCH] mescc: Mes C Library: Support gcc-4.6.4. WIP --- include/stdint.h | 13 +++++++++---- lib/stub/ctime.c | 7 ++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/include/stdint.h b/include/stdint.h index e225c7e9..60a6715a 100644 --- a/include/stdint.h +++ b/include/stdint.h @@ -58,6 +58,9 @@ typedef int int32_t; typedef unsigned long long uint64_t; typedef long long int64_t; +typedef int intmax_t; +typedef unsigned uintmax_t; + #ifndef __MES_SIZE_T #define __MES_SIZE_T #undef size_t @@ -70,10 +73,12 @@ typedef unsigned long size_t; typedef long intptr_t; #endif -// FIXME -typedef int intmax_t; -typedef unsigned uintmax_t; -typedef unsigned* uintptr_t; +#ifndef __MES_UINTPTR_T +#define __MES_UINTPTR_T +#undef intptr_t +typedef long uintptr_t; +#endif + #ifndef __MES_PTRDIFF_T #define __MES_PTRDIFF_T diff --git a/lib/stub/ctime.c b/lib/stub/ctime.c index 30c7475b..f848b563 100644 --- a/lib/stub/ctime.c +++ b/lib/stub/ctime.c @@ -19,14 +19,15 @@ */ #include +#include -int -ctime (int x) +char * +ctime (time_t const *TIME) { static int stub = 0; if (__mes_debug () && !stub) eputs ("ctime stub\n"); stub = 1; errno = 0; - return 0; + return "now"; }