Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e9fd554

Browse files
committed
Try to fix busted gettimeofday() code.
Per buildfarm, we have to match the _stdcall property of the system functions.
1 parent 332f02f commit e9fd554

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/port/gettimeofday.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030

3131
#include <sys/time.h>
3232

33-
static void init_gettimeofday(LPFILETIME lpSystemTimeAsFileTime);
34-
3533
/* FILETIME of Jan 1 1970 00:00:00, the PostgreSQL epoch */
3634
static const unsigned __int64 epoch = UINT64CONST(116444736000000000);
3735

@@ -49,6 +47,9 @@ static const unsigned __int64 epoch = UINT64CONST(116444736000000000);
4947
*/
5048
typedef VOID (WINAPI *PgGetSystemTimeFn)(LPFILETIME);
5149

50+
/* One-time initializer function, must match that signature. */
51+
static void WINAPI init_gettimeofday(LPFILETIME lpSystemTimeAsFileTime);
52+
5253
/* Storage for the function we pick at runtime */
5354
static PgGetSystemTimeFn pg_get_system_time = &init_gettimeofday;
5455

@@ -57,7 +58,7 @@ static PgGetSystemTimeFn pg_get_system_time = &init_gettimeofday;
5758
* is available and if so, plan to use it; if not, fall back to
5859
* GetSystemTimeAsFileTime.
5960
*/
60-
static void
61+
static void WINAPI
6162
init_gettimeofday(LPFILETIME lpSystemTimeAsFileTime)
6263
{
6364
/*

0 commit comments

Comments
 (0)