From 4b387ecdec69f7b5be4d10b69cc0da6cd818665b Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 7 Nov 2022 12:37:16 -0800 Subject: [PATCH] Windows: Fix the build Fix the build errors about passing arguments without a prototype. Fixes: 93bcfd20e37c ("Move Windows port to MinGW") Signed-off-by: Bart Van Assche --- os/windows/dlls.c | 16 +++++++++++----- os/windows/posix/include/syslog.h | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/os/windows/dlls.c b/os/windows/dlls.c index 774b1c61..ffedfa1e 100644 --- a/os/windows/dlls.c +++ b/os/windows/dlls.c @@ -11,12 +11,18 @@ void os_clk_tck(long *clk_tck) */ unsigned long minRes, maxRes, curRes; HMODULE lib; - FARPROC queryTimer; - FARPROC setTimer; + NTSTATUS NTAPI (*queryTimer) + (OUT PULONG MinimumResolution, + OUT PULONG MaximumResolution, + OUT PULONG CurrentResolution); + NTSTATUS NTAPI (*setTimer) + (IN ULONG DesiredResolution, + IN BOOLEAN SetResolution, + OUT PULONG CurrentResolution); if (!(lib = LoadLibrary(TEXT("ntdll.dll"))) || - !(queryTimer = GetProcAddress(lib, "NtQueryTimerResolution")) || - !(setTimer = GetProcAddress(lib, "NtSetTimerResolution"))) { + !(queryTimer = (void *)GetProcAddress(lib, "NtQueryTimerResolution")) || + !(setTimer = (void *)GetProcAddress(lib, "NtSetTimerResolution"))) { dprint(FD_HELPERTHREAD, "Failed to load ntdll library, set to lower bound 64 Hz\n"); *clk_tck = 64; @@ -30,4 +36,4 @@ void os_clk_tck(long *clk_tck) setTimer(maxRes, 1, &curRes); *clk_tck = (long) (10000000L / maxRes); } -} \ No newline at end of file +} diff --git a/os/windows/posix/include/syslog.h b/os/windows/posix/include/syslog.h index b8582e95..03a04f69 100644 --- a/os/windows/posix/include/syslog.h +++ b/os/windows/posix/include/syslog.h @@ -1,7 +1,7 @@ #ifndef SYSLOG_H #define SYSLOG_H -int syslog(); +int syslog(int priority, const char *format, ...); #define LOG_INFO 0x1 #define LOG_ERROR 0x2 -- 2.25.1