From 7dd6d7cbe13a7b55a52be0bdf6499ca809ea8523 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 16 Jul 2008 19:16:41 +0000 Subject: 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. --- setup_once.h | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'setup_once.h') 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. -- cgit v1.2.3