#include "ldap-int.h"
-#if !defined( LDAP_R_COMPILE )
+#ifndef LDAP_R_COMPILE
# undef HAVE_REENTRANT_FUNCTIONS
# undef HAVE_CTIME_R
# undef HAVE_GETHOSTBYNAME_R
# undef HAVE_GETHOSTBYADDR_R
#else
-# include <ldap_pvt_thread.h>
+# include <ldap_pvt_thread.h>
+ ldap_pvt_thread_mutex_t ldap_int_resolv_mutex;
#if (defined( HAVE_CTIME_R ) || defined( HAVE_REENTRANT_FUNCTIONS)) \
&& defined( CTIME_R_NARGS )
-# define USE_CTIME_R
-#else
+# define USE_CTIME_R
+# else
static ldap_pvt_thread_mutex_t ldap_int_ctime_mutex;
-#endif
+# endif
-#if defined(HAVE_GETHOSTBYNAME_R) && \
+# if defined(HAVE_GETHOSTBYNAME_R) && \
(GETHOSTBYNAME_R_NARGS < 5) || (6 < GETHOSTBYNAME_R_NARGS)
/* Don't know how to handle this version, pretend it's not there */
# undef HAVE_GETHOSTBYNAME_R
-#endif
-#if defined(HAVE_GETHOSTBYADDR_R) && \
+# endif
+# if defined(HAVE_GETHOSTBYADDR_R) && \
(GETHOSTBYADDR_R_NARGS < 7) || (8 < GETHOSTBYADDR_R_NARGS)
/* Don't know how to handle this version, pretend it's not there */
# undef HAVE_GETHOSTBYADDR_R
-#endif
-
- ldap_pvt_thread_mutex_t ldap_int_resolv_mutex;
+# endif
#endif /* LDAP_R_COMPILE */
char *ldap_pvt_ctime( const time_t *tp, char *buf )
return r;
#if (GETHOSTBYNAME_R_NARGS < 6)
- r = ((*result=gethostbyname_r( name, resbuf, *buf,
- buflen, herrno_ptr ))== NULL) ?
- -1 : 0;
+ *result=gethostbyname_r( name, resbuf, *buf, buflen, herrno_ptr );
+ r = (*result == NULL) ? -1 : 0;
#else
r = gethostbyname_r( name, resbuf, *buf,
buflen, result, herrno_ptr );
if (safe_realloc( buf, buflen )==NULL)
return r;
#if (GETHOSTBYADDR_R_NARGS < 8)
- r = ((*result=gethostbyaddr_r( addr, len, type,
- resbuf, *buf, buflen,
- herrno_ptr )) == NULL) ?
- -1 : 0;
+ *result=gethostbyaddr_r( addr, len, type,
+ resbuf, *buf, buflen, herrno_ptr );
+ r = (*result == NULL) ? -1 : 0;
#else
r = gethostbyaddr_r( addr, len, type,
resbuf, *buf, buflen,
# undef NEED_SAFE_REALLOC
#define NEED_SAFE_REALLOC
-static char *cpy_aliases( char ***tgtio, char *buf, char **src )
+static char *cpy_aliases(
+ char ***tgtio,
+ char *buf,
+ char **src )
{
int len;
char **tgt=*tgtio;
return buf;
}
-static char *cpy_addresses( char ***tgtio, char *buf, char **src, int len )
+static char *cpy_addresses(
+ char ***tgtio,
+ char *buf,
+ char **src,
+ int len )
{
char **tgt=*tgtio;
for( ; (*src) ; src++ ) {
return buf;
}
-static int copy_hostent( struct hostent *res, char **buf, struct hostent * src )
+static int copy_hostent(
+ struct hostent *res,
+ char **buf,
+ struct hostent * src )
{
char **p;
char **tp;