From 3f10299f43aa356386cad60d8889d815303dbabf Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 23 Jun 2018 19:49:29 +0200 Subject: [PATCH] Move the portable time code into core. clock() goes into sys (as it calls times()). --- lang/cem/libcc.ansi/build.lua | 5 ++--- lang/cem/libcc.ansi/{ => core}/time/asctime.c | 0 lang/cem/libcc.ansi/{ => core}/time/ctime.c | 0 lang/cem/libcc.ansi/{ => core}/time/difftime.c | 0 lang/cem/libcc.ansi/{ => core}/time/gmtime.c | 0 lang/cem/libcc.ansi/{ => core}/time/loc_time.h | 4 ++-- lang/cem/libcc.ansi/{ => core}/time/localtime.c | 0 lang/cem/libcc.ansi/{ => core}/time/misc.c | 0 lang/cem/libcc.ansi/{ => core}/time/mktime.c | 0 lang/cem/libcc.ansi/{ => core}/time/strftime.c | 0 lang/cem/libcc.ansi/{ => core}/time/tzset.c | 0 lang/cem/libcc.ansi/{time => sys/misc}/clock.c | 0 lang/cem/libcc.ansi/time/LIST | 12 ------------ lang/cem/libcc.ansi/time/Makefile | 3 --- 14 files changed, 4 insertions(+), 20 deletions(-) rename lang/cem/libcc.ansi/{ => core}/time/asctime.c (100%) rename lang/cem/libcc.ansi/{ => core}/time/ctime.c (100%) rename lang/cem/libcc.ansi/{ => core}/time/difftime.c (100%) rename lang/cem/libcc.ansi/{ => core}/time/gmtime.c (100%) rename lang/cem/libcc.ansi/{ => core}/time/loc_time.h (91%) rename lang/cem/libcc.ansi/{ => core}/time/localtime.c (100%) rename lang/cem/libcc.ansi/{ => core}/time/misc.c (100%) rename lang/cem/libcc.ansi/{ => core}/time/mktime.c (100%) rename lang/cem/libcc.ansi/{ => core}/time/strftime.c (100%) rename lang/cem/libcc.ansi/{ => core}/time/tzset.c (100%) rename lang/cem/libcc.ansi/{time => sys/misc}/clock.c (100%) delete mode 100644 lang/cem/libcc.ansi/time/LIST delete mode 100644 lang/cem/libcc.ansi/time/Makefile diff --git a/lang/cem/libcc.ansi/build.lua b/lang/cem/libcc.ansi/build.lua index 9e06c243b..f6bdc8f45 100644 --- a/lang/cem/libcc.ansi/build.lua +++ b/lang/cem/libcc.ansi/build.lua @@ -39,16 +39,15 @@ for _, plat in ipairs(vars.plats) do "./core/locale/*.c", "./core/setjmp/*.c", "./core/setjmp/*.e", - "./core/math/*.c", -- hypot.c + "./core/math/*.c", "./core/math/*.e", "./core/ctype/*.c", "./core/misc/*.c", + "./core/time/*.c", "./sys/malloc/*.c", "./sys/exit/*.c", "./sys/stdio/*.c", "./sys/misc/*.c", - "./stdio/*.c", - "./time/*.c", }, hdrs = {}, -- must be empty deps = { diff --git a/lang/cem/libcc.ansi/time/asctime.c b/lang/cem/libcc.ansi/core/time/asctime.c similarity index 100% rename from lang/cem/libcc.ansi/time/asctime.c rename to lang/cem/libcc.ansi/core/time/asctime.c diff --git a/lang/cem/libcc.ansi/time/ctime.c b/lang/cem/libcc.ansi/core/time/ctime.c similarity index 100% rename from lang/cem/libcc.ansi/time/ctime.c rename to lang/cem/libcc.ansi/core/time/ctime.c diff --git a/lang/cem/libcc.ansi/time/difftime.c b/lang/cem/libcc.ansi/core/time/difftime.c similarity index 100% rename from lang/cem/libcc.ansi/time/difftime.c rename to lang/cem/libcc.ansi/core/time/difftime.c diff --git a/lang/cem/libcc.ansi/time/gmtime.c b/lang/cem/libcc.ansi/core/time/gmtime.c similarity index 100% rename from lang/cem/libcc.ansi/time/gmtime.c rename to lang/cem/libcc.ansi/core/time/gmtime.c diff --git a/lang/cem/libcc.ansi/time/loc_time.h b/lang/cem/libcc.ansi/core/time/loc_time.h similarity index 91% rename from lang/cem/libcc.ansi/time/loc_time.h rename to lang/cem/libcc.ansi/core/time/loc_time.h index 180bc74a4..e0f43ad5b 100644 --- a/lang/cem/libcc.ansi/time/loc_time.h +++ b/lang/cem/libcc.ansi/core/time/loc_time.h @@ -17,8 +17,8 @@ extern const int _ytab[2][12]; extern const char *_days[]; extern const char *_months[]; -void _tzset(void); -unsigned _dstget(struct tm *timep); +extern void _tzset(void); +extern unsigned _dstget(struct tm *timep); extern long _timezone; extern long _dst_off; diff --git a/lang/cem/libcc.ansi/time/localtime.c b/lang/cem/libcc.ansi/core/time/localtime.c similarity index 100% rename from lang/cem/libcc.ansi/time/localtime.c rename to lang/cem/libcc.ansi/core/time/localtime.c diff --git a/lang/cem/libcc.ansi/time/misc.c b/lang/cem/libcc.ansi/core/time/misc.c similarity index 100% rename from lang/cem/libcc.ansi/time/misc.c rename to lang/cem/libcc.ansi/core/time/misc.c diff --git a/lang/cem/libcc.ansi/time/mktime.c b/lang/cem/libcc.ansi/core/time/mktime.c similarity index 100% rename from lang/cem/libcc.ansi/time/mktime.c rename to lang/cem/libcc.ansi/core/time/mktime.c diff --git a/lang/cem/libcc.ansi/time/strftime.c b/lang/cem/libcc.ansi/core/time/strftime.c similarity index 100% rename from lang/cem/libcc.ansi/time/strftime.c rename to lang/cem/libcc.ansi/core/time/strftime.c diff --git a/lang/cem/libcc.ansi/time/tzset.c b/lang/cem/libcc.ansi/core/time/tzset.c similarity index 100% rename from lang/cem/libcc.ansi/time/tzset.c rename to lang/cem/libcc.ansi/core/time/tzset.c diff --git a/lang/cem/libcc.ansi/time/clock.c b/lang/cem/libcc.ansi/sys/misc/clock.c similarity index 100% rename from lang/cem/libcc.ansi/time/clock.c rename to lang/cem/libcc.ansi/sys/misc/clock.c diff --git a/lang/cem/libcc.ansi/time/LIST b/lang/cem/libcc.ansi/time/LIST deleted file mode 100644 index 4beee1806..000000000 --- a/lang/cem/libcc.ansi/time/LIST +++ /dev/null @@ -1,12 +0,0 @@ -loc_time.h -ctime.c -asctime.c -localtime.c -clock.c -difftime.c -gmtime.c -mktime.c -strftime.c -time.c -tzset.c -misc.c diff --git a/lang/cem/libcc.ansi/time/Makefile b/lang/cem/libcc.ansi/time/Makefile deleted file mode 100644 index e0cbf5db6..000000000 --- a/lang/cem/libcc.ansi/time/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -clean: - rm -f ctime.o asctime.o localtime.o clock.o difftime.o gmtime.o \ - mktime.o strftime.o time.o tzset.o misc.o OLIST