From a4d45e6a295c8e9f00286a97781433784dcbc683 Mon Sep 17 00:00:00 2001 From: Josh Harris Date: Sat, 18 Oct 2025 01:04:53 +0100 Subject: [PATCH 1/2] Added line to PureDOOM header which removes the error prone tzp variable from gettimeofday for linux --- PureDOOM.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PureDOOM.h b/PureDOOM.h index 7de3872..9d1c010 100644 --- a/PureDOOM.h +++ b/PureDOOM.h @@ -7141,8 +7141,14 @@ void doom_gettime_impl(int* sec, int* usec) *usec = (int)(system_time.wMilliseconds * 1000); #else struct timeval tp; + +#ifdef __linux__ + gettimeofday(&tp, NULL); +#else struct timezone tzp; gettimeofday(&tp, &tzp); +#endif + *sec = tp.tv_sec; *usec = tp.tv_usec; #endif From d65b2bb4474e3593858998f83fa03d204a9fc648 Mon Sep 17 00:00:00 2001 From: Josh Harris Date: Sat, 18 Oct 2025 22:26:24 +0100 Subject: [PATCH 2/2] Changed DOOM.c code to remove tzp input into gettimeofday function for linux and replaced it with NULL --- src/DOOM/DOOM.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/DOOM/DOOM.c b/src/DOOM/DOOM.c index d3058ad..1cbf1a1 100644 --- a/src/DOOM/DOOM.c +++ b/src/DOOM/DOOM.c @@ -158,8 +158,14 @@ void doom_gettime_impl(int* sec, int* usec) *usec = (int)(system_time.wMilliseconds * 1000); #else struct timeval tp; + +#ifdef __linux__ + gettimeofday(&tp, NULL); +#else struct timezone tzp; gettimeofday(&tp, &tzp); +#endif + *sec = tp.tv_sec; *usec = tp.tv_usec; #endif