From d2ac0350652ae88b6cfc97f7339365e02e1bf5e5 Mon Sep 17 00:00:00 2001 From: charonxin <1656746727@qq.com> Date: Wed, 9 Aug 2023 22:55:53 +0800 Subject: [PATCH] fix --- System/Classes/tm_timer.hpp | 24 --------------- System/config_l1.h.xmake | 42 ++++++++++++++++++++------ tests/System/Classes/tm_timer_test.cpp | 4 +-- 3 files changed, 34 insertions(+), 36 deletions(-) diff --git a/System/Classes/tm_timer.hpp b/System/Classes/tm_timer.hpp index 8dd05061f..3abee4f8f 100644 --- a/System/Classes/tm_timer.hpp +++ b/System/Classes/tm_timer.hpp @@ -15,30 +15,6 @@ #include "string.hpp" #include "tm_ostream.hpp" -#ifndef __FreeBSD__ -#ifndef HAVE_TIME_T -#define HAVE_TIME_T -typedef long time_t; -#endif -#else -#include -#endif - -#ifdef OS_SUN -#include -#endif - -#ifdef HAVE_GETTIMEOFDAY -#include -#else -#include -#ifdef OS_SUN -extern "C" { -extern int ftime __P ((struct timeb * __timebuf)); -}; -#endif -#endif - time_t raw_time (); time_t texmacs_time (); diff --git a/System/config_l1.h.xmake b/System/config_l1.h.xmake index 817271db4..f4310331d 100644 --- a/System/config_l1.h.xmake +++ b/System/config_l1.h.xmake @@ -1,8 +1,7 @@ -${define HAVE_INTPTR_T} -${define HAVE_STDINT_H} -${define HAVE_INTTYPES_H} -${define HAVE_TIME_T} -${define HAVE_GETTIMEOFDAY} +${define HAVE_INTPTR_T} ${define HAVE_STDINT_H} ${define HAVE_INTTYPES_H} ${ + define HAVE_TIME_T} ${define HAVE_GETTIMEOFDAY} ${define __FreeBSD__} $ { + define OS_SUN +} #ifdef HAVE_INTPTR_T #ifdef HAVE_INTTYPES_H @@ -15,8 +14,31 @@ ${define HAVE_GETTIMEOFDAY} typedef long intptr_t; #endif -${define SANITY_CHECKS} -${define OS_MINGW} -${define OS_WIN32} -${define MIMALLOC} -${define JEMALLOC} \ No newline at end of file +#ifndef __FreeBSD__ +#ifndef HAVE_TIME_T +#define HAVE_TIME_T +typedef long time_t; +#endif +#else +#include +#endif + +#ifdef OS_SUN +#include +#endif + +#ifdef HAVE_GETTIMEOFDAY +#include +#else +#include +#ifdef OS_SUN +extern "C" { +extern int ftime __P ((struct timeb * __timebuf)); +}; +#endif +#endif + +${define SANITY_CHECKS} ${define OS_MINGW} ${define OS_WIN32} ${ + define MIMALLOC} $ { + define JEMALLOC +} \ No newline at end of file diff --git a/tests/System/Classes/tm_timer_test.cpp b/tests/System/Classes/tm_timer_test.cpp index 885ec4926..48125d4d6 100644 --- a/tests/System/Classes/tm_timer_test.cpp +++ b/tests/System/Classes/tm_timer_test.cpp @@ -72,11 +72,11 @@ to_zero (tm_ostream& out) { } TEST_CASE ("function raw_time") { - long startTime= raw_time (); + unsigned int startTime= raw_time (); CHECK (startTime >= 0); - long endTime= raw_time (); + unsigned int endTime= raw_time (); CHECK (endTime >= startTime); }