mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
Fix -Wcast-function-type warnings on Windows/MinGW
After de8feb1f3a
, some warnings remained
that were only visible when using GCC on Windows. Fix those as well.
Note that the ecpg test source files don't use the full pg_config.h,
so we can't use pg_funcptr_t there but have to do it the long way.
This commit is contained in:
@@ -79,12 +79,12 @@ haveNativeWindowsIPv6routines(void)
|
||||
{
|
||||
/* We found a dll, so now get the addresses of the routines */
|
||||
|
||||
getaddrinfo_ptr = (getaddrinfo_ptr_t) GetProcAddress(hLibrary,
|
||||
"getaddrinfo");
|
||||
freeaddrinfo_ptr = (freeaddrinfo_ptr_t) GetProcAddress(hLibrary,
|
||||
"freeaddrinfo");
|
||||
getnameinfo_ptr = (getnameinfo_ptr_t) GetProcAddress(hLibrary,
|
||||
"getnameinfo");
|
||||
getaddrinfo_ptr = (getaddrinfo_ptr_t) (pg_funcptr_t) GetProcAddress(hLibrary,
|
||||
"getaddrinfo");
|
||||
freeaddrinfo_ptr = (freeaddrinfo_ptr_t) (pg_funcptr_t) GetProcAddress(hLibrary,
|
||||
"freeaddrinfo");
|
||||
getnameinfo_ptr = (getnameinfo_ptr_t) (pg_funcptr_t) GetProcAddress(hLibrary,
|
||||
"getnameinfo");
|
||||
|
||||
/*
|
||||
* If any one of the routines is missing, let's play it safe and
|
||||
|
@@ -95,7 +95,7 @@ pgwin32_putenv(const char *envval)
|
||||
{
|
||||
PUTENVPROC putenvFunc;
|
||||
|
||||
putenvFunc = (PUTENVPROC) GetProcAddress(hmodule, "_putenv");
|
||||
putenvFunc = (PUTENVPROC) (pg_funcptr_t) GetProcAddress(hmodule, "_putenv");
|
||||
if (putenvFunc)
|
||||
putenvFunc(envval);
|
||||
FreeLibrary(hmodule);
|
||||
|
@@ -227,7 +227,7 @@ _pgstat64(const char *name, struct stat *buf)
|
||||
return -1;
|
||||
}
|
||||
|
||||
_NtQueryInformationFile = (PFN_NTQUERYINFORMATIONFILE)
|
||||
_NtQueryInformationFile = (PFN_NTQUERYINFORMATIONFILE) (pg_funcptr_t)
|
||||
GetProcAddress(ntdll, "NtQueryInformationFile");
|
||||
if (_NtQueryInformationFile == NULL)
|
||||
{
|
||||
|
Reference in New Issue
Block a user