1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

In CURL_FUNC_GETNAMEINFO_ARGTYPES, when cross-compiling a windows

target use calling convention WSAAPI for getnameinfo() prototype.
Checking type DWORD as argument 4 and 6 of getnameinfo not needed.
This commit is contained in:
Yang Tse 2005-12-20 23:49:14 +00:00
parent 7d1e3ebeed
commit e3657644d6
2 changed files with 14 additions and 10 deletions

View File

@ -243,26 +243,27 @@ AC_DEFUN([CURL_FUNC_GETNAMEINFO_ARGTYPES], [
curl_cv_func_getnameinfo_args="unknown" curl_cv_func_getnameinfo_args="unknown"
for gni_arg1 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do for gni_arg1 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
for gni_arg2 in 'socklen_t' 'size_t' 'int'; do for gni_arg2 in 'socklen_t' 'size_t' 'int'; do
for gni_arg46 in 'size_t' 'int' 'socklen_t' 'unsigned int' 'DWORD'; do for gni_arg46 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
for gni_arg7 in 'int' 'unsigned int'; do for gni_arg7 in 'int' 'unsigned int'; do
AC_COMPILE_IFELSE([ AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([ AC_LANG_PROGRAM([
#undef inline #undef inline
#ifdef HAVE_WINDOWS_H #ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN #ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#endif #endif
#if defined(__MINGW32__) && ( (!defined(_WIN32_WINNT)) || (_WIN32_WINNT < 0x0501) ) #if (!defined(_WIN32_WINNT)) || (_WIN32_WINNT < 0x0501)
#undef _WIN32_WINNT #undef _WIN32_WINNT
#define _WIN32_WINNT 0x0501 #define _WIN32_WINNT 0x0501
#endif #endif
#include <windows.h> #include <windows.h>
#ifdef HAVE_WINSOCK2_H #ifdef HAVE_WINSOCK2_H
#include <winsock2.h> #include <winsock2.h>
#ifdef HAVE_WS2TCPIP_H #ifdef HAVE_WS2TCPIP_H
#include <ws2tcpip.h> #include <ws2tcpip.h>
#endif #endif
#endif #endif
#define GNICALLCONV WSAAPI
#else #else
#ifdef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> #include <sys/types.h>
@ -273,8 +274,9 @@ AC_DEFUN([CURL_FUNC_GETNAMEINFO_ARGTYPES], [
#ifdef HAVE_NETDB_H #ifdef HAVE_NETDB_H
#include <netdb.h> #include <netdb.h>
#endif #endif
#define GNICALLCONV
#endif #endif
extern int getnameinfo($gni_arg1, $gni_arg2, extern int GNICALLCONV getnameinfo($gni_arg1, $gni_arg2,
char *, $gni_arg46, char *, $gni_arg46,
char *, $gni_arg46, char *, $gni_arg46,
$gni_arg7); $gni_arg7);

View File

@ -222,26 +222,27 @@ AC_DEFUN([CURL_FUNC_GETNAMEINFO_ARGTYPES], [
curl_cv_func_getnameinfo_args="unknown" curl_cv_func_getnameinfo_args="unknown"
for gni_arg1 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do for gni_arg1 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
for gni_arg2 in 'socklen_t' 'size_t' 'int'; do for gni_arg2 in 'socklen_t' 'size_t' 'int'; do
for gni_arg46 in 'size_t' 'int' 'socklen_t' 'unsigned int' 'DWORD'; do for gni_arg46 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
for gni_arg7 in 'int' 'unsigned int'; do for gni_arg7 in 'int' 'unsigned int'; do
AC_COMPILE_IFELSE([ AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([ AC_LANG_PROGRAM([
#undef inline #undef inline
#ifdef HAVE_WINDOWS_H #ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN #ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#endif #endif
#if defined(__MINGW32__) && ( (!defined(_WIN32_WINNT)) || (_WIN32_WINNT < 0x0501) ) #if (!defined(_WIN32_WINNT)) || (_WIN32_WINNT < 0x0501)
#undef _WIN32_WINNT #undef _WIN32_WINNT
#define _WIN32_WINNT 0x0501 #define _WIN32_WINNT 0x0501
#endif #endif
#include <windows.h> #include <windows.h>
#ifdef HAVE_WINSOCK2_H #ifdef HAVE_WINSOCK2_H
#include <winsock2.h> #include <winsock2.h>
#ifdef HAVE_WS2TCPIP_H #ifdef HAVE_WS2TCPIP_H
#include <ws2tcpip.h> #include <ws2tcpip.h>
#endif #endif
#endif #endif
#define GNICALLCONV WSAAPI
#else #else
#ifdef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> #include <sys/types.h>
@ -252,8 +253,9 @@ AC_DEFUN([CURL_FUNC_GETNAMEINFO_ARGTYPES], [
#ifdef HAVE_NETDB_H #ifdef HAVE_NETDB_H
#include <netdb.h> #include <netdb.h>
#endif #endif
#define GNICALLCONV
#endif #endif
extern int getnameinfo($gni_arg1, $gni_arg2, extern int GNICALLCONV getnameinfo($gni_arg1, $gni_arg2,
char *, $gni_arg46, char *, $gni_arg46,
char *, $gni_arg46, char *, $gni_arg46,
$gni_arg7); $gni_arg7);