aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2005-12-20 23:49:14 +0000
committerYang Tse <yangsita@gmail.com>2005-12-20 23:49:14 +0000
commite3657644d695373e9cf9ab9b4f1571afda7fd041 (patch)
tree46a4506331deb071dc9a32d04e22eba931d32764
parent7d1e3ebeed8ec2e3b70e2d7e11015e50e3ec291c (diff)
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.
-rw-r--r--acinclude.m412
-rw-r--r--ares/acinclude.m412
2 files changed, 14 insertions, 10 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 3637e3e6e..5e59b153a 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -243,26 +243,27 @@ AC_DEFUN([CURL_FUNC_GETNAMEINFO_ARGTYPES], [
curl_cv_func_getnameinfo_args="unknown"
for gni_arg1 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; 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
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([
-#undef inline
+#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
-#if defined(__MINGW32__) && ( (!defined(_WIN32_WINNT)) || (_WIN32_WINNT < 0x0501) )
+#if (!defined(_WIN32_WINNT)) || (_WIN32_WINNT < 0x0501)
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif
#include <windows.h>
#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
+#include <winsock2.h>
#ifdef HAVE_WS2TCPIP_H
#include <ws2tcpip.h>
#endif
#endif
+#define GNICALLCONV WSAAPI
#else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -273,8 +274,9 @@ AC_DEFUN([CURL_FUNC_GETNAMEINFO_ARGTYPES], [
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
+#define GNICALLCONV
#endif
- extern int getnameinfo($gni_arg1, $gni_arg2,
+ extern int GNICALLCONV getnameinfo($gni_arg1, $gni_arg2,
char *, $gni_arg46,
char *, $gni_arg46,
$gni_arg7);
diff --git a/ares/acinclude.m4 b/ares/acinclude.m4
index 5a7a460e8..bf1c7de42 100644
--- a/ares/acinclude.m4
+++ b/ares/acinclude.m4
@@ -222,26 +222,27 @@ AC_DEFUN([CURL_FUNC_GETNAMEINFO_ARGTYPES], [
curl_cv_func_getnameinfo_args="unknown"
for gni_arg1 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; 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
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([
-#undef inline
+#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
-#if defined(__MINGW32__) && ( (!defined(_WIN32_WINNT)) || (_WIN32_WINNT < 0x0501) )
+#if (!defined(_WIN32_WINNT)) || (_WIN32_WINNT < 0x0501)
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif
#include <windows.h>
#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
+#include <winsock2.h>
#ifdef HAVE_WS2TCPIP_H
#include <ws2tcpip.h>
#endif
#endif
+#define GNICALLCONV WSAAPI
#else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -252,8 +253,9 @@ AC_DEFUN([CURL_FUNC_GETNAMEINFO_ARGTYPES], [
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
+#define GNICALLCONV
#endif
- extern int getnameinfo($gni_arg1, $gni_arg2,
+ extern int GNICALLCONV getnameinfo($gni_arg1, $gni_arg2,
char *, $gni_arg46,
char *, $gni_arg46,
$gni_arg7);