#if defined( HAVE_ERRNO_H )
# include <errno.h>
-#elif defined( HAVE_SYS_ERRNO_H )
-# include <sys/errno.h>
+#else
+# if defined( HAVE_SYS_ERRNO_H )
+# include <sys/errno.h>
+# endif
#endif
#ifdef DECL_SYS_ERRLIST
#if defined( HAVE_KERBEROS )
#if defined( HAVE_KERBEROSIV_KRB_H )
-#include <kerberosIV/krb.h>
-#elif defined( HAVE_KRB_H )
-#include <krb.h>
+# include <kerberosIV/krb.h>
+#else
+# if defined( HAVE_KRB_H )
+# include <krb.h>
+# endif
#endif
#if defined( HAVE_KERBEROSIV_DES_H )
-#include <kerberosIV/des.h>
-#elif defined( HAVE_DES_H )
-#include <des.h>
+# include <kerberosIV/des.h>
+#else
+# if defined( HAVE_DES_H )
+# include <des.h>
+# endif
#endif
#endif /* HAVE_KERBEROS */
#endif
#ifdef HAVE_WINSOCK2
-#include <winsock2.h>
-#elif HAVE_WINSOCK
-#include <winsock.h>
+# include <winsock2.h>
#else
-#define WSACleanup()
+# if HAVE_WINSOCK
+# include <winsock.h>
+# else
+# define WSACleanup()
+# endif
#endif
#ifdef HAVE_PCNFS
#else
# ifdef HAVE_STRING_H
# include <string.h>
-# elif HAVE_STRINGS_H
+# else
+# ifdef HAVE_STRINGS_H
# include <strings.h>
+# endif
# endif
# ifndef HAVE_STRCHR
#ifndef SAFEMEMCPY
# if defined( HAVE_MEMMOVE )
# define SAFEMEMCPY( d, s, n ) memmove((d), (s), (n))
-# elif defined( HAVE_BCOPY )
+# else
+# if defined( HAVE_BCOPY )
# define SAFEMEMCPY( d, s, n ) bcopy((s), (d), (n))
-# elif defined( MACOS )
+# else
+# if defined( MACOS )
# define SAFEMEMCPY( d, s, n ) BlockMoveData((Ptr)(s), (Ptr)(d), (n))
-# else
+# else
/* nothing left but memcpy() */
# define SAFEMEMCPY( d, s, n ) memcpy((d), (s), (n))
+# endif
+# endif
# endif
#endif
#define _AC_SYSLOG_H_
#if defined( HAVE_SYSLOG_H )
-#include <syslog.h>
-#elif defined ( HAVE_SYS_SYSLOG_H )
-#include <sys/syslog.h>
+# include <syslog.h>
+#else
+# if defined ( HAVE_SYS_SYSLOG_H )
+# include <sys/syslog.h>
+# endif
#endif
#if defined( LOG_NDELAY ) && defined( LOG_NOWAIT )
# define OPENLOG_OPTIONS ( LOG_PID | LOG_NDELAY | LOG_NOWAIT )
-#elif defined( LOG_NDELAY )
+#else
+# if defined( LOG_NDELAY )
# define OPENLOG_OPTIONS ( LOG_PID | LOG_NDELAY )
-#elif defined( LOG_NOWAIT )
+# else
+# if defined( LOG_NOWAIT )
# define OPENLOG_OPTIONS ( LOG_PID | LOG_NOWAIT )
-#else
+# else
# define OPENLOG_OPTIONS ( LOG_PID )
+# endif
+# endif
#endif
#endif /* _AC_SYSLOG_H_ */
#define GETFLAGS( tio ) ((tio).c_lflag)
#define SETFLAGS( tio, flags ) ((tio).c_lflag = (flags))
-#elif defined( HAVE_SGTTY_H )
+#else /* !HAVE_TERMIOS_H */
+#if defined( HAVE_SGTTY_H )
#include <sgtty.h>
#ifdef HAVE_SYS_IOCTL_H
#define SETFLAGS( tio, flags ) ((tio).sg_flags = (flags))
#endif /* HAVE_SGTTY_H */
+#endif /* HAVE_TERMIOS_H */
#endif /* _AC_TERMIOS_H */
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
-#elif HAVE_SYS_TIME_H
-# include <sys/time.h>
#else
-# include <time.h>
+ /* Do not use #elif, not all non-ANSI compilers support it. */
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
#endif
#endif /* _AC_TIME_H */
#if HAVE_GETOPT_H
# include <getopt.h>
-#elif !defined(HAVE_GETOPT)
+#else
+# if !defined(HAVE_GETOPT)
/* no getopt, assume we need getopt-compat.h */
# include <getopt-compat.h>
-#else
+# else
/* assume we need to declare these externs */
extern char *optarg;
extern int optind, opterr, optopt;
-#endif
+# endif
+#endif /* HAVE_GETOPT_H */
#ifndef HAVE_TEMPNAM
extern char *tempnam(const char *tmpdir, const char *prefix);
#define LDBM_REPLACE 0
#define LDBM_SYNC 0x80000000
-#elif defined( LDBM_USE_DBHASH )
+/* Do not use #elif. K&R does not support it. */
+#else /* !LDBM_USE_DBBTREE */
+#ifdef LDBM_USE_DBHASH
/*****************************************************************
* *
#define LDBM_REPLACE 0
#define LDBM_SYNC 0x80000000
-#elif defined( HAVE_GDBM )
+#else /* !LDBM_USE_DBHASH */
+#ifdef HAVE_GDBM
/*****************************************************************
* *
#define LDBM_SYNC 0x80000000
-#elif defined( HAVE_NDBM )
+#else /* !HAVE_GDBM */
+#ifdef HAVE_NDBM
/*****************************************************************
* *
#define LDBM_REPLACE DBM_REPLACE
#define LDBM_SYNC 0
-#endif
+#endif /* HAVE_NDBM */
+#endif /* HAVE_GDBM */
+#endif /* LDBM_USE_DBHASH */
+#endif /* LDBM_USE_DBBTREE */
int ldbm_errno( LDBM ldbm );
LDBM ldbm_open( char *name, int rw, int mode, int dbcachesize );
#include "portable.h"
-#if defined( HAVE_PTHREADS )
+#ifdef HAVE_PTHREADS
/**********************************
* *
* definitions for POSIX Threads *
LDAP_END_DECL
-#elif defined ( HAVE_MACH_CTHREADS )
+/* Do not use #elif. K&R does not support it. */
+#else /* !HAVE_PTHREADS */
+#ifdef HAVE_MACH_CTHREADS
/**********************************
* *
* definitions for Mach CThreads *
LDAP_END_DECL
-#elif defined( HAVE_THR )
+#else /* !HAVE_MACH_CTHREADS */
+#ifdef HAVE_THR
/**************************************
* *
* thread definitions for Solaris LWP *
LDAP_END_DECL
-#elif defined( HAVE_LWP )
+#else /* !HAVE_THR */
+#ifdef HAVE_LWP
/*************************************
* *
* thread definitions for SunOS LWP *
LDAP_END_DECL
-#else
-
+#else /* !HAVE_LWP */
/***********************************
* *
* thread definitions for no *
LDAP_END_DECL
-#endif /* no threads support */
+#endif /* HAVE_LWP */
+#endif /* HAVE_THR */
+#endif /* HAVE_MACH_CTHREADS */
+#endif /* HAVE_PTHREADS */
#endif /* _LTHREAD_H */