3
/***************************************************************************
5
* Project ___| | | | _ \| |
7
* | (__| |_| | _ <| |___
8
* \___|\___/|_| \_\_____|
10
* Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
12
* This software is licensed as described in the file COPYING, which
13
* you should have received as part of this distribution. The terms
14
* are also available at http://curl.haxx.se/docs/copyright.html.
16
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
17
* copies of the Software, and permit persons to whom the Software is
18
* furnished to do so, under the terms of the COPYING file.
20
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21
* KIND, either express or implied.
23
* $Id: setup_once.h,v 1.2 2006-07-31 17:12:24 yangtse Exp $
24
***************************************************************************/
28
* If we have the MSG_NOSIGNAL define, make sure we use
29
* it as the fourth argument of send() and recv()
32
#ifdef HAVE_MSG_NOSIGNAL
33
#define SEND_4TH_ARG MSG_NOSIGNAL
35
#define SEND_4TH_ARG 0
40
* The definitions for the return type and arguments types
41
* of functions recv() and send() belong and come from the
42
* configuration file. Do not define them in any other place.
44
* HAVE_RECV is defined if you have a function named recv()
45
* which is used to read incoming data from sockets. If your
46
* function has another name then don't define HAVE_RECV.
48
* If HAVE_RECV is defined then RECV_TYPE_ARG1, RECV_TYPE_ARG2,
49
* RECV_TYPE_ARG3, RECV_TYPE_ARG4 and RECV_TYPE_RETV must also
52
* HAVE_SEND is defined if you have a function named send()
53
* which is used to write outgoing data on a connected socket.
54
* If yours has another name then don't define HAVE_SEND.
56
* If HAVE_SEND is defined then SEND_TYPE_ARG1, SEND_QUAL_ARG2,
57
* SEND_TYPE_ARG2, SEND_TYPE_ARG3, SEND_TYPE_ARG4 and
58
* SEND_TYPE_RETV must also be defined.
62
#if !defined(RECV_TYPE_ARG1) || \
63
!defined(RECV_TYPE_ARG2) || \
64
!defined(RECV_TYPE_ARG3) || \
65
!defined(RECV_TYPE_ARG4) || \
66
!defined(RECV_TYPE_RETV)
68
Error Missing_definition_of_return_and_arguments_types_of_recv
71
#define sread(x,y,z) (ssize_t)recv((RECV_TYPE_ARG1)(x), \
72
(RECV_TYPE_ARG2)(y), \
73
(RECV_TYPE_ARG3)(z), \
74
(RECV_TYPE_ARG4)(SEND_4TH_ARG))
78
#define sread(x,y,z) (ssize_t)read_s((int)(x), (char *)(y), (int)(z))
82
Error Missing_definition_of_macro_sread
85
#endif /* HAVE_RECV */
88
#if !defined(SEND_TYPE_ARG1) || \
89
!defined(SEND_QUAL_ARG2) || \
90
!defined(SEND_TYPE_ARG2) || \
91
!defined(SEND_TYPE_ARG3) || \
92
!defined(SEND_TYPE_ARG4) || \
93
!defined(SEND_TYPE_RETV)
95
Error Missing_definition_of_return_and_arguments_types_of_send
98
#define swrite(x,y,z) (ssize_t)send((SEND_TYPE_ARG1)(x), \
99
(SEND_TYPE_ARG2)(y), \
100
(SEND_TYPE_ARG3)(z), \
101
(SEND_TYPE_ARG4)(SEND_4TH_ARG))
103
#else /* HAVE_SEND */
105
#define swrite(x,y,z) (ssize_t)write_s((int)(x), (char *)(y), (int)(z))
109
Error Missing_definition_of_macro_swrite
112
#endif /* HAVE_SEND */
115
#endif /* __SETUP_ONCE_H */