From a8eb7a2f9a793b0748737a0a9b646fa3f5495f0f Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sat, 8 Aug 2026 03:45:29 +0000 Subject: [PATCH 1/2] crn_timer: use sys/time.h on everything that is not Windows, do not use sys/timex.h --- crnlib/crn_timer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crnlib/crn_timer.cpp b/crnlib/crn_timer.cpp index 044c6b8c..70bea900 100644 --- a/crnlib/crn_timer.cpp +++ b/crnlib/crn_timer.cpp @@ -4,7 +4,7 @@ #include "crn_timer.h" #include -#if defined(__FreeBSD__) +#if !defined(CRNLIB_USE_WIN32_API) #include "sys/time.h" #endif @@ -27,7 +27,6 @@ inline void query_counter_frequency(timer_ticks* pTicks) { QueryPerformanceFrequency(reinterpret_cast(pTicks)); } #elif defined(__GNUC__) -#include inline void query_counter(timer_ticks* pTicks) { struct timeval cur_time; gettimeofday(&cur_time, NULL); From b204b11f2157a9b22771ba37426ab98525397db6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Noel?= Date: Sat, 8 Aug 2026 03:52:37 +0000 Subject: [PATCH 2/2] crn_file_utils: use a realpath() variant that doesn't need PATH_MAX to be defined Co-authored-by: Thomas Debesse --- crnlib/crn_file_utils.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crnlib/crn_file_utils.cpp b/crnlib/crn_file_utils.cpp index 0405c37b..f6cc22fe 100644 --- a/crnlib/crn_file_utils.cpp +++ b/crnlib/crn_file_utils.cpp @@ -347,23 +347,23 @@ bool file_utils::full_path(dynamic_string& path) { if (!p) return false; #else - char buf[PATH_MAX]; - char* p; + char* p = nullptr; dynamic_string pn, fn; split_path(path.get_ptr(), pn, fn); if ((fn == ".") || (fn == "..")) { - p = realpath(path.get_ptr(), buf); + p = realpath(path.get_ptr(), NULL); if (!p) return false; - path.set(buf); + path.set(p); } else { if (pn.is_empty()) pn = "./"; - p = realpath(pn.get_ptr(), buf); + p = realpath(pn.get_ptr(), NULL); if (!p) return false; - combine_path(path, buf, fn.get_ptr()); + combine_path(path, p, fn.get_ptr()); } + free(p); #endif return true;