From db3f7a4de7a4c3bed8f232fac8172d0a2c9c0537 Mon Sep 17 00:00:00 2001 From: juergen Date: Sun, 15 Dec 2024 15:17:24 +0100 Subject: [PATCH 1/2] implemented: #define localtime_r(T,Tm) (localtime_s(Tm,T) ? NULL:Tm) #define ctime_r(T,Tm) (localtime_s(Tm,T) ? NULL:Tm) --- src/planner.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/planner.c b/src/planner.c index 1684d3b..5494d33 100644 --- a/src/planner.c +++ b/src/planner.c @@ -15,6 +15,10 @@ #include #include +#define ctime_r(T,Tm) (localtime_s(Tm,T) ? NULL:Tm) +#define localtime_r(T,Tm) (localtime_s(Tm,T) ? NULL:Tm) + + const uint intervalLen = 45; // min const uint pauseLen = 10; // From 0c27b315a95ee7445077f36bce2d0f1ec8d54328 Mon Sep 17 00:00:00 2001 From: ketrptr Date: Mon, 16 Dec 2024 09:20:06 +0100 Subject: [PATCH 2/2] modified: src/planner.c modified: src/ui.c --- src/planner.c | 10 ++++++---- src/ui.c | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/planner.c b/src/planner.c index 5494d33..723658a 100644 --- a/src/planner.c +++ b/src/planner.c @@ -15,12 +15,14 @@ #include #include -#define ctime_r(T,Tm) (localtime_s(Tm,T) ? NULL:Tm) -#define localtime_r(T,Tm) (localtime_s(Tm,T) ? NULL:Tm) +#ifdef _WIN32 +_WIN32 #define ctime_r(T, Tm)(localtime_s(Tm, T) ? NULL : Tm) +#define localtime_r(T, Tm) (localtime_s(Tm, T) ? NULL : Tm) +#endif /* ifdef _WIN32 */ -const uint intervalLen = 45; // min -const uint pauseLen = 10; // + const uint intervalLen = 45; // min +const uint pauseLen = 10; // const char taskFormat[] = "Task { %.64s = {\n created={%lu},\n deadline={%lu},\n " diff --git a/src/ui.c b/src/ui.c index 90417ea..bb0af5f 100644 --- a/src/ui.c +++ b/src/ui.c @@ -13,8 +13,9 @@ #include #include -#define localtime_r(T,Tm) (localtime_s(Tm,T) ? NULL:Tm) - +#ifdef _WIN32 +#define localtime_r(T, Tm) (localtime_s(Tm, T) ? NULL : Tm) +#endif const char *dbName = "db.csv";