[PATCH] newlib: m68k-atari-elf, fixed naming bug in defines

<[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <1763489228285.7.52370@webmail-backend-production-7f5d966f9d-mjhlf>
Fix to a reported problem in naming of defines.


/Mikael Hildenborg.
0001-m68k-atari-elf-fixed-naming-bug-in-defines.patch (text/x-patch, 1.8 KB)
From 65b71bd50631da48343b97fecdade55e7c1122f4 Mon Sep 17 00:00:00 2001
From: Mikael Hildenborg <[email protected]>
Date: Tue, 18 Nov 2025 18:40:48 +0100
Subject: [PATCH] m68k-atari-elf: fixed naming bug in defines.

---
 libgloss/m68k/atari/atari-gettod.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libgloss/m68k/atari/atari-gettod.c b/libgloss/m68k/atari/atari-gettod.c
index 75139ed8c..c8227ae5e 100644
--- a/libgloss/m68k/atari/atari-gettod.c
+++ b/libgloss/m68k/atari/atari-gettod.c
@@ -14,8 +14,8 @@
 	The code below uses that limitation to simplify the code.
 */
 
-#define SEC_1900_TO_1980 315529200
-#define SEC_1900_TO_MAX 0x7fffffff
+#define SEC_1970_TO_1980 315529200
+#define SEC_1970_TO_MAX 0x7fffffff
 #define SECONDS_IN_A_DAY (24 * 60 * 60)
 #define SEC_JAN_AND_FEB ((31 + 29) * SECONDS_IN_A_DAY)	// In a leap year
 #define SECONDS_IN_A_YEAR (365 * SECONDS_IN_A_DAY)
@@ -59,7 +59,7 @@ int gettimeofday(struct timeval* tv, void* __tz)
 		}
 
 		// Add it all together
-		tv->tv_sec = (((((days * 24) + hour) * 60) + min) * 60) + sec + SEC_1900_TO_1980;
+		tv->tv_sec = (((((days * 24) + hour) * 60) + min) * 60) + sec + SEC_1970_TO_1980;
 		tv->tv_usec = 0;
 	}
 	return 0;
@@ -70,14 +70,14 @@ int settimeofday(const struct timeval* tv, const struct timezone* tz)
 	// Support for timezone have been removed from linux glibc, so we just ignore it.
 	if (tv != 0)
 	{
-		if (tv->tv_sec < SEC_1900_TO_1980 || tv->tv_sec >= SEC_1900_TO_MAX)
+		if (tv->tv_sec < SEC_1970_TO_1980 || tv->tv_sec >= SEC_1970_TO_MAX)
 		{
 			// Outside the ranges we can handle.
 			gem_error_to_errno(GEM_EBADRQ);
 			return -1;
 		}
 
-		time_t seconds = tv->tv_sec - SEC_1900_TO_1980;
+		time_t seconds = tv->tv_sec - SEC_1970_TO_1980;
 		int year = 0;
 		time_t ysec = SECONDS_IN_A_YEAR;
 		do
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.