#include <ac/socket.h>
#include <ac/string.h>
+#include <ac/unistd.h>
#include <lber.h>
#include <ldap.h>
#include <ac/ctype.h>
#include <ac/string.h>
#include <ac/time.h>
+#include <ac/unistd.h>
#include <lber.h>
#include <ldap.h>
--- /dev/null
+/* Generic stdarg.h */
+
+#ifndef _AC_STDARG_H
+#define _AC_STDARG_H 1
+
+#if defined( HAVE_STDARG_H ) && \
+ ( defined( __STDC__ ) || defined( _WIN32 ) )
+# include <stdarg.h>
+# define HAVE_STDARG 1
+#else
+# include <varargs.h>
+#endif
+
+#endif /* _AC_STDARG_H */
#include <stdlib.h>
#endif
-#if defined( HAVE_STDARG_H ) && __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
+#include <ac/stdarg.h>
#include <ac/string.h>
#include <ac/socket.h>
/* VARARGS */
unsigned long
ber_scanf
-#if defined( HAVE_STDARG_H ) && __STDC__
+#if HAVE_STDARG
( BerElement *ber, char *fmt, ... )
#else
( va_alist )
#endif
{
va_list ap;
-#if !(defined( HAVE_STDARG_H ) && __STDC__)
+#ifndef HAVE_STDARG
BerElement *ber;
char *fmt;
#endif
long *l;
unsigned long rc, tag, len;
-#if defined( HAVE_STDARG_H ) && __STDC__
+#ifdef HAVE_STDARG
va_start( ap, fmt );
#else
va_start( ap );
#include <stdio.h>
#include <stdlib.h>
-#if defined( HAVE_STDARG_H ) && __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
+#include <ac/stdarg.h>
#include <ac/socket.h>
#include <ac/string.h>
/* VARARGS */
int
ber_printf
-#if defined( HAVE_STDARG_H ) && __STDC__
+#ifdef HAVE_STDARG
( BerElement *ber, char *fmt, ... )
#else
( va_alist )
#endif
{
va_list ap;
-#if !(defined( HAVE_STDARG_H ) && __STDC__)
+#ifndef HAVE_STDARG
BerElement *ber;
char *fmt;
#endif
int rc, i;
unsigned long len;
-#if defined( HAVE_STDARG_H ) && __STDC__
+#ifdef HAVE_STDARG
va_start( ap, fmt );
#else
va_start( ap );
connected = use_hp = 0;
- if ( host != NULL && ( address = inet_addr( host )) == -1UL ) {
+ if ( host != NULL && ( address = inet_addr( host )) == (unsigned long) -1L ) {
if ( (hp = gethostbyname( host )) == NULL ) {
#ifdef HAVE_WINSOCK
errno = WSAGetLastError();