--- a/psycopg/win32_support.h +++ b/psycopg/win32_support.h @@ -37,11 +37,8 @@ #ifdef _WIN32 -#ifndef __MINGW32__ extern HIDDEN int gettimeofday(struct timeval * tp, void * tzp); extern HIDDEN void timeradd(struct timeval *a, struct timeval *b, struct timeval *c); -#elif -#endif extern HIDDEN void timersub(struct timeval *a, struct timeval *b, struct timeval *c); --- a/psycopg/win32_support.c +++ b/psycopg/win32_support.c @@ -31,7 +31,6 @@ #ifdef _WIN32 -#ifndef __MINGW32__ /* millisecond-precision port of gettimeofday for Win32, taken from src/port/gettimeofday.c in PostgreSQL core */ @@ -73,7 +72,6 @@ timeradd(struct timeval *a, struct timev c->tv_sec += 1; } } -#endif /* !defined(__MINGW32__) */ /* timersub is missing on mingw & MS VC */ void --- psycopg2-2.9.11/psycopg/config.h.orig 2025-10-10 01:33:17.000000000 +0200 +++ psycopg2-2.9.11/psycopg/config.h 2026-01-08 19:24:38.036378400 +0100 @@ -134,8 +134,6 @@ /* to work around the fact that Windows does not have a gmtime_r function, or a proper gmtime function */ #ifdef _WIN32 -#define gmtime_r(t, tm) (gmtime(t)?memcpy((tm), gmtime(t), sizeof(*(tm))):NULL) -#define localtime_r(t, tm) (localtime(t)?memcpy((tm), localtime(t), sizeof(*(tm))):NULL) /* remove the inline keyword, since it doesn't work unless C++ file */ #define inline