This is an automated email from Gerrit. "Antonio Borneo <[email protected]>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9748
-- gerrit commit 6c947a1bbd0c9ec488f765d0dc2a69cefba2a948 Author: Antonio Borneo <[email protected]> Date: Mon Jun 15 22:54:38 2026 +0200 openocd: drop windows replacement for gettimeofday() The replacement helper provides an implementation of gettimeofday() based on Windows API. With no use of gettimeofday() in Windows build, drop the replacement implementation. While there, drop the CameCase Windows API not referenced anymore and the configure check for gettimeofday(). Change-Id: I32b6b1e7fafde0fbc681c060c8cf1a3243f04389 Signed-off-by: Antonio Borneo <[email protected]> diff --git a/configure.ac b/configure.ac index b617694530..74a476fe51 100644 --- a/configure.ac +++ b/configure.ac @@ -95,7 +95,6 @@ AC_C_BIGENDIAN AC_CHECK_FUNCS([strndup]) AC_CHECK_FUNCS([strnlen]) -AC_CHECK_FUNCS([gettimeofday]) AC_CHECK_FUNCS([clock_gettime]) AC_CHECK_FUNCS([usleep]) AC_CHECK_FUNCS([realpath]) diff --git a/src/helper/replacements.c b/src/helper/replacements.c index 16b918020d..de7ee84ec6 100644 --- a/src/helper/replacements.c +++ b/src/helper/replacements.c @@ -59,51 +59,6 @@ void *fill_malloc(size_t size) #include <winsock2.h> #endif -/* replacements for gettimeofday */ -#ifndef HAVE_GETTIMEOFDAY - -/* Windows */ -#ifdef _WIN32 - -#ifndef __GNUC__ -#define EPOCHFILETIME (116444736000000000i64) -#else -#define EPOCHFILETIME (116444736000000000LL) -#endif - -int gettimeofday(struct timeval *tv, struct timezone *tz) -{ - FILETIME ft; - LARGE_INTEGER li; - __int64 t; - static int tzflag; - - if (tv) { - GetSystemTimeAsFileTime(&ft); - li.LowPart = ft.dwLowDateTime; - li.HighPart = ft.dwHighDateTime; - t = li.QuadPart; /* In 100-nanosecond intervals */ - t -= EPOCHFILETIME; /* Offset to the Epoch time */ - t /= 10; /* In microseconds */ - tv->tv_sec = (long)(t / 1000000); - tv->tv_usec = (long)(t % 1000000); - } - - if (tz) { - if (!tzflag) { - _tzset(); - tzflag++; - } - tz->tz_minuteswest = _timezone / 60; - tz->tz_dsttime = _daylight; - } - - return 0; -} -#endif /* _WIN32 */ - -#endif /* HAVE_GETTIMEOFDAY */ - #ifndef HAVE_STRNLEN size_t strnlen(const char *s, size_t maxlen) { diff --git a/src/helper/replacements.h b/src/helper/replacements.h index 11e3c119e7..c48bc79a87 100644 --- a/src/helper/replacements.h +++ b/src/helper/replacements.h @@ -51,21 +51,6 @@ struct timeval { #endif -/* gettimeofday() */ -#ifndef HAVE_GETTIMEOFDAY - -#ifdef _WIN32 -struct timezone { - int tz_minuteswest; - int tz_dsttime; -}; -#endif -struct timezone; - -int gettimeofday(struct timeval *tv, struct timezone *tz); - -#endif - void *clear_malloc(size_t size); void *fill_malloc(size_t size); diff --git a/tools/scripts/camelcase.txt b/tools/scripts/camelcase.txt index e566eafad5..ee690f64d9 100644 --- a/tools/scripts/camelcase.txt +++ b/tools/scripts/camelcase.txt @@ -161,7 +161,6 @@ CreateFile CloseHandle FormatMessage GetModuleFileName -GetSystemTimeAsFileTime GetTickCount GetVersionEx HighPart @@ -179,8 +178,6 @@ WSACleanup WSAGetLastError WSASetLastError WSAStartup -dwHighDateTime -dwLowDateTime dwPlatformId dwOSVersionInfoSize --
