diff options
author | Yang Tse <yangsita@gmail.com> | 2008-07-16 19:16:41 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2008-07-16 19:16:41 +0000 |
commit | 7dd6d7cbe13a7b55a52be0bdf6499ca809ea8523 (patch) | |
tree | eea630e5f9f1755ec6fdc2116457da6615b3698d /setup_once.h | |
parent | 6b84d9ff24e5d4921fb12f43b66f2b668b42bd06 (diff) | |
download | c-ares-7dd6d7cbe13a7b55a52be0bdf6499ca809ea8523.tar.gz c-ares-7dd6d7cbe13a7b55a52be0bdf6499ca809ea8523.tar.bz2 c-ares-7dd6d7cbe13a7b55a52be0bdf6499ca809ea8523.zip |
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.
Diffstat (limited to 'setup_once.h')
-rw-r--r-- | setup_once.h | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/setup_once.h b/setup_once.h index 59ed25c..85a291a 100644 --- a/setup_once.h +++ b/setup_once.h @@ -3,7 +3,7 @@ /* $Id$ */ -/* Copyright (C) 2004 - 2007 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 @@ -191,6 +191,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. |