RECVFROM_TYPE_ARG2, RECVFROM_TYPE_ARG5 and RECVFROM_TYPE_ARG6 are now defined

to the data type pointed by its respective argument and not the pointer type.
pull/1/head
Yang Tse 17 years ago
parent 7dd6d7cbe1
commit 2aeb0314f5
  1. 4
      CHANGES
  2. 8
      Makefile.dj
  3. 12
      Makefile.netware
  4. 41
      acinclude.m4
  5. 14
      config-win32.h
  6. 12
      setup_once.h

@ -1,5 +1,9 @@
Changelog for the c-ares project
* Jul 17 2008 (Yang Tse)
- RECVFROM_TYPE_ARG2, RECVFROM_TYPE_ARG5 and RECVFROM_TYPE_ARG6 are now defined
to the data type pointed by its respective argument and not the pointer type.
* Jul 16 2008 (Yang Tse)
- Improved configure detection of number of arguments for getservbyport_r.
Detection is now based on compilation checks instead of linker ones.

@ -24,10 +24,10 @@ CFLAGS += -DWATT32 -DHAVE_AF_INET6 -DHAVE_PF_INET6 -DHAVE_IOCTLSOCKET \
-DRECV_TYPE_ARG3='int' -DRECV_TYPE_ARG4='int' \
-DRECV_TYPE_RETV='int' -DHAVE_STRUCT_TIMEVAL \
-Dselect=select_s -Dsocklen_t=int -UHAVE_CONFIG_H \
-DRECVFROM_TYPE_ARG1='int' -DRECVFROM_TYPE_ARG2='void*' \
-DRECVFROM_TYPE_ARG3='int' -DRECVFROM_TYPE_ARG4='int' \
-DRECVFROM_TYPE_ARG6='int*' -DRECVFROM_TYPE_RETV='int' \
-DRECVFROM_TYPE_ARG5='struct sockaddr*' -DHAVE_RECVFROM
-DRECVFROM_TYPE_ARG1='int' -DRECVFROM_TYPE_ARG2='void' \
-DRECVFROM_TYPE_ARG3='int' -DRECVFROM_TYPE_ARG4='int' \
-DRECVFROM_TYPE_ARG6='int' -DRECVFROM_TYPE_RETV='int' \
-DRECVFROM_TYPE_ARG5='struct sockaddr' -DHAVE_RECVFROM
LDFLAGS = -s

@ -289,11 +289,11 @@ ifeq ($(LIBARCH),CLIB)
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define RECV_TYPE_RETV int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG1 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG2 char *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG2 char$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG3 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG6 int *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG6 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_RETV int$(DL) >> $@
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
@ -332,11 +332,11 @@ else
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define RECV_TYPE_RETV ssize_t$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG1 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG2 void *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG2 void$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG3 size_t$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG6 int *$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_ARG6 int$(DL) >> $@
@echo $(DL)#define RECVFROM_TYPE_RETV ssize_t$(DL) >> $@
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@

@ -1058,6 +1058,8 @@ dnl will be defined, defining the types of the arguments
dnl in RECVFROM_TYPE_ARG1, RECVFROM_TYPE_ARG2, and so on
dnl to RECVFROM_TYPE_ARG6, defining also the type of the
dnl function return value in RECVFROM_TYPE_RETV.
dnl Notice that the types returned for pointer arguments
dnl will actually be the type pointed by the pointer.
AC_DEFUN([CURL_CHECK_FUNC_RECVFROM], [
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl
@ -1170,21 +1172,48 @@ AC_DEFUN([CURL_CHECK_FUNC_RECVFROM], [
IFS=$recvfrom_prev_IFS
shift
#
recvfrom_ptrt_arg2=$[2]
recvfrom_ptrt_arg5=$[5]
recvfrom_ptrt_arg6=$[6]
#
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG1, $[1],
[Define to the type of arg 1 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG2, $[2],
[Define to the type of arg 2 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG3, $[3],
[Define to the type of arg 3 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG4, $[4],
[Define to the type of arg 4 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG5, $[5],
[Define to the type of arg 5 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG6, $[6],
[Define to the type of arg 6 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_RETV, $[7],
[Define to the function return type for recvfrom.])
#
prev_sh_opts=$-
#
case $prev_sh_opts in
*f*)
;;
*)
set -f
;;
esac
#
recvfrom_type_arg2=`echo $recvfrom_ptrt_arg2 | sed 's/ \*//'`
recvfrom_type_arg5=`echo $recvfrom_ptrt_arg5 | sed 's/ \*//'`
recvfrom_type_arg6=`echo $recvfrom_ptrt_arg6 | sed 's/ \*//'`
#
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG2, $recvfrom_type_arg2,
[Define to the type pointed by arg 2 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG5, $recvfrom_type_arg5,
[Define to the type pointed by arg 5 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG6, $recvfrom_type_arg6,
[Define to the type pointed by arg 6 for recvfrom.])
#
case $prev_sh_opts in
*f*)
;;
*)
set +f
;;
esac
#
AC_DEFINE_UNQUOTED(HAVE_RECVFROM, 1,
[Define to 1 if you have the recvfrom function.])
ac_cv_func_recvfrom="yes"

@ -3,7 +3,7 @@
/* $Id$ */
/* Copyright (C) 2004 - 2006 by Daniel Stenberg et al
/* Copyright (C) 2004 - 2008 by Daniel Stenberg et al
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
@ -103,8 +103,8 @@
/* Define to the type of arg 1 for recvfrom. */
#define RECVFROM_TYPE_ARG1 SOCKET
/* Define to the type of arg 2 for recvfrom. */
#define RECVFROM_TYPE_ARG2 char *
/* Define to the type pointed by arg 2 for recvfrom. */
#define RECVFROM_TYPE_ARG2 char
/* Define to the type of arg 3 for recvfrom. */
#define RECVFROM_TYPE_ARG3 int
@ -112,11 +112,11 @@
/* Define to the type of arg 4 for recvfrom. */
#define RECVFROM_TYPE_ARG4 int
/* Define to the type of arg 5 for recvfrom. */
#define RECVFROM_TYPE_ARG5 struct sockaddr *
/* Define to the type pointed by arg 5 for recvfrom. */
#define RECVFROM_TYPE_ARG5 struct sockaddr
/* Define to the type of arg 6 for recvfrom. */
#define RECVFROM_TYPE_ARG6 int *
/* Define to the type pointed by arg 6 for recvfrom. */
#define RECVFROM_TYPE_ARG6 int
/* Define to the function return type for recvfrom. */
#define RECVFROM_TYPE_RETV int

@ -206,12 +206,12 @@ struct timeval {
Error Missing_definition_of_return_and_arguments_types_of_recvfrom
/* */
#else
#define sreadfrom(s,b,bl,f,fl) (ssize_t)recvfrom((RECVFROM_TYPE_ARG1)(s), \
(RECVFROM_TYPE_ARG2)(b), \
(RECVFROM_TYPE_ARG3)(bl), \
(RECVFROM_TYPE_ARG4)(0), \
(RECVFROM_TYPE_ARG5)(f), \
(RECVFROM_TYPE_ARG6)(fl))
#define sreadfrom(s,b,bl,f,fl) (ssize_t)recvfrom((RECVFROM_TYPE_ARG1) (s), \
(RECVFROM_TYPE_ARG2 *)(b), \
(RECVFROM_TYPE_ARG3) (bl), \
(RECVFROM_TYPE_ARG4) (0), \
(RECVFROM_TYPE_ARG5 *)(f), \
(RECVFROM_TYPE_ARG6 *)(fl))
#endif
#else /* HAVE_RECVFROM */
#ifndef sreadfrom

Loading…
Cancel
Save