Windows: Fix the build
authorBart Van Assche <bvanassche@acm.org>
Mon, 7 Nov 2022 20:37:16 +0000 (12:37 -0800)
committerBart Van Assche <bvanassche@acm.org>
Mon, 7 Nov 2022 22:46:26 +0000 (14:46 -0800)
Fix the build errors about passing arguments without a prototype.

Fixes: 93bcfd20e37c ("Move Windows port to MinGW")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
os/windows/dlls.c
os/windows/posix/include/syslog.h

index 774b1c612f99356a8fe1b4658be8268ed513057b..ffedfa1e8f4663d694723c184b35892e00fcbd37 100644 (file)
@@ -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
+}
index b8582e95407523356c71e7508a4e3f5125da5a52..03a04f69f87148fd5a7bb0e703b4d0b397d33e21 100644 (file)
@@ -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