Configure process now checks availability of recvfrom() socket function and
finds out its return type and the types of its arguments. Added definitions for non-configure systems config files, and introduced macro sreadfrom which will be used on udp sockets as a recvfrom() wrapper.
This commit is contained in:
@@ -382,6 +382,13 @@ ifeq ($(LIBARCH),CLIB)
|
||||
@echo $(DL)#define RECV_TYPE_ARG3 int$(DL) >> $@
|
||||
@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_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_RETV int$(DL) >> $@
|
||||
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
|
||||
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
|
||||
@echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@
|
||||
@@ -414,6 +421,13 @@ else
|
||||
@echo $(DL)#define RECV_TYPE_ARG3 size_t$(DL) >> $@
|
||||
@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_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_RETV ssize_t$(DL) >> $@
|
||||
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
|
||||
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
|
||||
@echo $(DL)#define SEND_TYPE_ARG2 void *$(DL) >> $@
|
||||
@@ -441,6 +455,7 @@ endif
|
||||
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_RECV 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_RECVFROM 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SEND 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
@@ -131,6 +131,15 @@
|
||||
#define RECV_TYPE_ARG4 long
|
||||
#define RECV_TYPE_RETV long
|
||||
|
||||
#define HAVE_RECVFROM 1
|
||||
#define RECVFROM_TYPE_ARG1 long
|
||||
#define RECVFROM_TYPE_ARG2 char *
|
||||
#define RECVFROM_TYPE_ARG3 long
|
||||
#define RECVFROM_TYPE_ARG4 long
|
||||
#define RECVFROM_TYPE_ARG5 struct sockaddr *
|
||||
#define RECVFROM_TYPE_ARG6 long *
|
||||
#define RECVFROM_TYPE_RETV long
|
||||
|
||||
#define HAVE_SEND 1
|
||||
#define SEND_TYPE_ARG1 int
|
||||
#define SEND_QUAL_ARG2 const
|
||||
|
||||
@@ -63,6 +63,15 @@
|
||||
#define RECV_TYPE_ARG4 int
|
||||
#define RECV_TYPE_RETV ssize_t
|
||||
|
||||
#define HAVE_RECVFROM 1
|
||||
#define RECVFROM_TYPE_ARG1 int
|
||||
#define RECVFROM_TYPE_ARG2 void *
|
||||
#define RECVFROM_TYPE_ARG3 size_t
|
||||
#define RECVFROM_TYPE_ARG4 int
|
||||
#define RECVFROM_TYPE_ARG5 struct sockaddr *
|
||||
#define RECVFROM_TYPE_ARG6 int *
|
||||
#define RECVFROM_TYPE_RETV ssize_t
|
||||
|
||||
#define HAVE_SEND 1
|
||||
#define SEND_TYPE_ARG1 int
|
||||
#define SEND_QUAL_ARG2 const
|
||||
|
||||
@@ -456,6 +456,30 @@
|
||||
/* Define to the function return type for recv. */
|
||||
#define RECV_TYPE_RETV int
|
||||
|
||||
/* Define if you have the recvfrom function. */
|
||||
#define HAVE_RECVFROM
|
||||
|
||||
/* Define to the type of arg 1 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type of arg 2 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG2 char *
|
||||
|
||||
/* Define to the type of arg 3 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG3 int
|
||||
|
||||
/* 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 of arg 6 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG6 int *
|
||||
|
||||
/* Define to the function return type for recvfrom. */
|
||||
#define RECVFROM_TYPE_RETV int
|
||||
|
||||
/* Define if you have the send function. */
|
||||
#define HAVE_SEND
|
||||
|
||||
|
||||
@@ -430,6 +430,30 @@
|
||||
/* Define to the function return type for recv. */
|
||||
#define RECV_TYPE_RETV ssize_t
|
||||
|
||||
/* Define 1 if you have the recvfrom function. */
|
||||
#define HAVE_RECVFROM 1
|
||||
|
||||
/* Define to the type of arg 1 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type of arg 2 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG2 void *
|
||||
|
||||
/* Define to the type of arg 3 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG3 size_t
|
||||
|
||||
/* 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 of arg 6 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG6 int *
|
||||
|
||||
/* Define to the function return type for recvfrom. */
|
||||
#define RECVFROM_TYPE_RETV ssize_t
|
||||
|
||||
/* Define if you have the send function. */
|
||||
#define HAVE_SEND 1
|
||||
|
||||
|
||||
@@ -415,6 +415,9 @@
|
||||
/* Define to 1 if you have the recv function. */
|
||||
#define HAVE_RECV 1
|
||||
|
||||
/* Define to 1 if you have the recvfrom function. */
|
||||
#define HAVE_RECVFROM 1
|
||||
|
||||
/* Define to 1 if you have the <rsa.h> header file. */
|
||||
/* #undef HAVE_RSA_H */
|
||||
|
||||
@@ -680,6 +683,14 @@
|
||||
#define RECV_TYPE_ARG4 int
|
||||
#define RECV_TYPE_RETV ssize_t
|
||||
|
||||
#define RECVFROM_TYPE_ARG1 int
|
||||
#define RECVFROM_TYPE_ARG2 void*
|
||||
#define RECVFROM_TYPE_ARG3 size_t
|
||||
#define RECVFROM_TYPE_ARG4 int
|
||||
#define RECVFROM_TYPE_ARG5 struct sockaddr *
|
||||
#define RECVFROM_TYPE_ARG6 size_t *
|
||||
#define RECVFROM_TYPE_RETV ssize_t
|
||||
|
||||
#define SEND_TYPE_ARG1 int
|
||||
#define SEND_QUAL_ARG2 const
|
||||
#define SEND_TYPE_ARG2 void*
|
||||
|
||||
@@ -702,6 +702,30 @@
|
||||
/* Define to the function return type for recv. */
|
||||
#define RECV_TYPE_RETV int
|
||||
|
||||
/* Define to 1 if you have the recvfrom function. */
|
||||
#define HAVE_RECVFROM 1
|
||||
|
||||
/* Define to the type of arg 1 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type of arg 2 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG2 char *
|
||||
|
||||
/* Define to the type of arg 3 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG3 int
|
||||
|
||||
/* 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 of arg 6 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG6 int *
|
||||
|
||||
/* Define to the function return type for recvfrom. */
|
||||
#define RECVFROM_TYPE_RETV int
|
||||
|
||||
/* Define to 1 if you have the send function. */
|
||||
#define HAVE_SEND 1
|
||||
|
||||
|
||||
@@ -248,6 +248,30 @@
|
||||
/* Define to the function return type for recv. */
|
||||
#define RECV_TYPE_RETV int
|
||||
|
||||
/* Define if you have the recvfrom function. */
|
||||
#define HAVE_RECVFROM 1
|
||||
|
||||
/* 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 of arg 3 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG3 int
|
||||
|
||||
/* 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 of arg 6 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG6 int *
|
||||
|
||||
/* Define to the function return type for recvfrom. */
|
||||
#define RECVFROM_TYPE_RETV int
|
||||
|
||||
/* Define if you have the send function. */
|
||||
#define HAVE_SEND 1
|
||||
|
||||
|
||||
@@ -234,6 +234,30 @@
|
||||
/* Define to the function return type for recv. */
|
||||
#define RECV_TYPE_RETV int
|
||||
|
||||
/* Define if you have the recvfrom function. */
|
||||
#define HAVE_RECVFROM 1
|
||||
|
||||
/* 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 of arg 3 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG3 int
|
||||
|
||||
/* 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 of arg 6 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG6 int *
|
||||
|
||||
/* Define to the function return type for recvfrom. */
|
||||
#define RECVFROM_TYPE_RETV int
|
||||
|
||||
/* Define if you have the send function. */
|
||||
#define HAVE_SEND 1
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#define HAVE_NET_IF_H 1
|
||||
#define HAVE_PROCESS_H 1
|
||||
#define HAVE_RECV 1
|
||||
#define HAVE_RECVFROM 1
|
||||
#define HAVE_SELECT 1
|
||||
#define HAVE_SEND 1
|
||||
#define HAVE_SETJMP_H 1
|
||||
@@ -63,8 +64,8 @@
|
||||
#define STDC_HEADERS 1
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
/* Qualifiers for send() and recv().
|
||||
*/
|
||||
/* Qualifiers for send(), recv() and recv(). */
|
||||
|
||||
#define SEND_TYPE_ARG1 int
|
||||
#define SEND_QUAL_ARG2 const
|
||||
#define SEND_TYPE_ARG2 void *
|
||||
@@ -78,6 +79,13 @@
|
||||
#define RECV_TYPE_ARG4 int
|
||||
#define RECV_TYPE_RETV int
|
||||
|
||||
#define RECVFROM_TYPE_ARG1 int
|
||||
#define RECVFROM_TYPE_ARG2 void *
|
||||
#define RECVFROM_TYPE_ARG3 int
|
||||
#define RECVFROM_TYPE_ARG4 int
|
||||
#define RECVFROM_TYPE_ARG5 struct sockaddr *
|
||||
#define RECVFROM_TYPE_ARG6 int *
|
||||
#define RECVFROM_TYPE_RETV int
|
||||
|
||||
#define BSD
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
@@ -198,6 +198,37 @@ struct timeval {
|
||||
#endif /* HAVE_SEND */
|
||||
|
||||
|
||||
#if defined(HAVE_RECVFROM)
|
||||
/*
|
||||
* Currently recvfrom is only used on udp sockets.
|
||||
*/
|
||||
#if !defined(RECVFROM_TYPE_ARG1) || \
|
||||
!defined(RECVFROM_TYPE_ARG2) || \
|
||||
!defined(RECVFROM_TYPE_ARG3) || \
|
||||
!defined(RECVFROM_TYPE_ARG4) || \
|
||||
!defined(RECVFROM_TYPE_ARG5) || \
|
||||
!defined(RECVFROM_TYPE_ARG6) || \
|
||||
!defined(RECVFROM_TYPE_RETV)
|
||||
/* */
|
||||
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))
|
||||
#endif
|
||||
#else /* HAVE_RECVFROM */
|
||||
#ifndef sreadfrom
|
||||
/* */
|
||||
Error Missing_definition_of_macro_sreadfrom
|
||||
/* */
|
||||
#endif
|
||||
#endif /* HAVE_RECVFROM */
|
||||
|
||||
|
||||
/*
|
||||
* Uppercase macro versions of ANSI/ISO is*() functions/macros which
|
||||
* avoid negative number inputs with argument byte codes > 127.
|
||||
|
||||
Reference in New Issue
Block a user