]> git.sur5r.net Git - openldap/commitdiff
Back out K&Rification change; would only be needed in ldap.h and lber.h.
authorHallvard Furuseth <hallvard@openldap.org>
Tue, 17 Nov 1998 04:07:31 +0000 (04:07 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Tue, 17 Nov 1998 04:07:31 +0000 (04:07 +0000)
include/ac/errno.h
include/ac/krb.h
include/ac/socket.h
include/ac/string.h
include/ac/syslog.h
include/ac/termios.h
include/ac/time.h
include/ac/unistd.h
include/ldbm.h
include/lthread.h

index de2b0334301463124e1e68d63d5081293646f19f..b083cbbdf5eadbfafcb5fd7569b7b5cd85c67f71 100644 (file)
@@ -5,10 +5,8 @@
 
 #if defined( HAVE_ERRNO_H )
 # include <errno.h>
-#else
-# if defined( HAVE_SYS_ERRNO_H )
-#  include <sys/errno.h>
-# endif
+#elif defined( HAVE_SYS_ERRNO_H )
+# include <sys/errno.h>
 #endif
 
 #ifdef DECL_SYS_ERRLIST 
index 75113137e0590f72ddd2522a5802ceab4bf5069f..d3713503541d406c1812713563197966c9af82a1 100644 (file)
@@ -6,19 +6,15 @@
 #if defined( HAVE_KERBEROS )
 
 #if defined( HAVE_KERBEROSIV_KRB_H )
-# include <kerberosIV/krb.h>
-#else
-# if defined( HAVE_KRB_H )
-#  include <krb.h>
-# endif
+#include <kerberosIV/krb.h>
+#elif defined( HAVE_KRB_H )
+#include <krb.h>
 #endif
 
 #if defined( HAVE_KERBEROSIV_DES_H )
-# include <kerberosIV/des.h>
-#else
-# if defined( HAVE_DES_H )
-#  include <des.h>
-# endif
+#include <kerberosIV/des.h>
+#elif defined( HAVE_DES_H )
+#include <des.h>
 #endif
 
 #endif /* HAVE_KERBEROS */
index 310402d24d401d82649de2466feceeb3948bdbcf..1527d02e5f051ecf8f8791e6bf8fd7e452128213 100644 (file)
 #endif
 
 #ifdef HAVE_WINSOCK2
-# include <winsock2.h>
+#include <winsock2.h>
+#elif HAVE_WINSOCK
+#include <winsock.h>
 #else
-# if HAVE_WINSOCK
-#  include <winsock.h>
-# else
-#  define WSACleanup()
-# endif
+#define WSACleanup()
 #endif
 
 #ifdef HAVE_PCNFS
index 87c5cb258fec47189332cb92cf5ec617f589fd48..8df4116cff56846cfe70acc946c353016d09ed35 100644 (file)
@@ -8,10 +8,8 @@
 #else
 #      ifdef HAVE_STRING_H
 #              include <string.h>
-#      else
-#        ifdef HAVE_STRINGS_H
+#      elif 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))
-#      else
-#        if defined( HAVE_BCOPY )
+#      elif defined( HAVE_BCOPY )
 #              define SAFEMEMCPY( d, s, n )    bcopy((s), (d), (n))
-#        else
-#          if defined( MACOS )
+#      elif 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
 
index 8ac3950750f35c6c8fbcd3c5f04d0e5d8a56c98b..c7afb100ba003881e5364a9ac8e718c548919510 100644 (file)
@@ -5,25 +5,19 @@
 #define _AC_SYSLOG_H_
 
 #if defined( HAVE_SYSLOG_H )
-#  include <syslog.h>
-#else
-#  if defined ( HAVE_SYS_SYSLOG_H )
-#    include <sys/syslog.h>
-#  endif
+#include <syslog.h>
+#elif defined ( HAVE_SYS_SYSLOG_H )
+#include <sys/syslog.h>
 #endif
 
 #if defined( LOG_NDELAY ) && defined( LOG_NOWAIT )
 #      define OPENLOG_OPTIONS ( LOG_PID | LOG_NDELAY | LOG_NOWAIT )
-#else
-#  if defined( LOG_NDELAY )
+#elif defined( LOG_NDELAY )
 #      define OPENLOG_OPTIONS ( LOG_PID | LOG_NDELAY )
-#  else
-#    if defined( LOG_NOWAIT )
+#elif defined( LOG_NOWAIT )
 #      define OPENLOG_OPTIONS ( LOG_PID | LOG_NOWAIT )
-#    else
+#else
 #      define OPENLOG_OPTIONS ( LOG_PID )
-#    endif
-#  endif
 #endif
 
 #endif /* _AC_SYSLOG_H_ */
index b5adaa94c7a90f3ee0328c3de67b0c51d2bde554..5590ab0df6d5dcf76c3a043f48c937e5f53be81a 100644 (file)
@@ -13,8 +13,7 @@
 #define GETFLAGS( tio )                ((tio).c_lflag)
 #define SETFLAGS( tio, flags ) ((tio).c_lflag = (flags))
 
-#else /* !HAVE_TERMIOS_H */
-#if defined( HAVE_SGTTY_H )
+#elif defined( HAVE_SGTTY_H )
 #include <sgtty.h>
 
 #ifdef HAVE_SYS_IOCTL_H
@@ -29,6 +28,5 @@
 #define SETFLAGS( tio, flags )  ((tio).sg_flags = (flags))
 
 #endif /* HAVE_SGTTY_H */
-#endif /* HAVE_TERMIOS_H */
 
 #endif /* _AC_TERMIOS_H */
index 0742a5ce60c0797799193982f9c4f56acd7a2cef..ba18790a4ce63f195238d4b5aee6d65549ac39f7 100644 (file)
@@ -6,13 +6,10 @@
 #if TIME_WITH_SYS_TIME
 # include <sys/time.h>
 # include <time.h>
+#elif HAVE_SYS_TIME_H
+# include <sys/time.h>
 #else
-  /* 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
+# include <time.h>
 #endif
 
 #endif /* _AC_TIME_H */
index 1c5a82ba8230c6a2e53e4e0b646ba1208a68ceae..a52b288417f42b88cb73da13cb9aaaeeb37753cd 100644 (file)
 #if HAVE_GETOPT_H
 #      include <getopt.h>
 
-#else
-#  if !defined(HAVE_GETOPT)
+#elif !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 /* HAVE_GETOPT_H */
+#endif
 
 #ifndef HAVE_TEMPNAM
        extern char *tempnam(const char *tmpdir, const char *prefix);
index 49903713590ff42f21c0c11926934a3f7175083c..0f4c07c3ad8f1f46614d3b26736e97d2d0eec123 100644 (file)
@@ -57,9 +57,7 @@ typedef DB    *LDBM;
 #define LDBM_REPLACE   0
 #define LDBM_SYNC      0x80000000
 
-/* Do not use #elif.  K&R does not support it. */
-#else /* !LDBM_USE_DBBTREE */
-#ifdef LDBM_USE_DBHASH
+#elif defined( LDBM_USE_DBHASH )
 
 /*****************************************************************
  *                                                               *
@@ -110,8 +108,7 @@ typedef DB  *LDBM;
 #define LDBM_REPLACE   0
 #define LDBM_SYNC      0x80000000
 
-#else /* !LDBM_USE_DBHASH */
-#ifdef HAVE_GDBM
+#elif defined( HAVE_GDBM )
 
 /*****************************************************************
  *                                                               *
@@ -142,8 +139,7 @@ extern gdbm_error   gdbm_errno;
 #define LDBM_SYNC      0x80000000
 
 
-#else /* !HAVE_GDBM */
-#ifdef HAVE_NDBM
+#elif defined( HAVE_NDBM )
 
 /*****************************************************************
  *                                                               *
@@ -175,10 +171,7 @@ typedef DBM        *LDBM;
 #define LDBM_REPLACE   DBM_REPLACE
 #define LDBM_SYNC      0
 
-#endif /* HAVE_NDBM */
-#endif /* HAVE_GDBM */
-#endif /* LDBM_USE_DBHASH */
-#endif /* LDBM_USE_DBBTREE */
+#endif
 
 int    ldbm_errno( LDBM ldbm );
 LDBM   ldbm_open( char *name, int rw, int mode, int dbcachesize );
index 123b7efa8767e2f6adddeac201c5890d60266404..2a23c7791fdebb36fd5c58731c38ad5753cd8f65 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "portable.h"
 
-#ifdef HAVE_PTHREADS
+#if defined( HAVE_PTHREADS )
 /**********************************
  *                                *
  * definitions for POSIX Threads  *
@@ -51,9 +51,7 @@ LDAP_F void pthread_kill LDAP_P(( pthread_t tid, int sig ));
 
 LDAP_END_DECL
 
-/* Do not use #elif.  K&R does not support it. */
-#else /* !HAVE_PTHREADS */
-#ifdef HAVE_MACH_CTHREADS
+#elif defined ( HAVE_MACH_CTHREADS )
 /**********************************
  *                                *
  * definitions for Mach CThreads  *
@@ -93,8 +91,7 @@ typedef struct condition pthread_cond_t;
 
 LDAP_END_DECL
 
-#else /* !HAVE_MACH_CTHREADS */
-#ifdef HAVE_THR
+#elif defined( HAVE_THR )
 /**************************************
  *                                    *
  * thread definitions for Solaris LWP *
@@ -139,8 +136,7 @@ typedef cond_t      pthread_cond_t;
 
 LDAP_END_DECL
 
-#else /* !HAVE_THR */
-#ifdef HAVE_LWP
+#elif defined( HAVE_LWP )
 /*************************************
  *                                   *
  * thread definitions for SunOS LWP  *
@@ -189,7 +185,8 @@ typedef struct lwpcv {
 
 LDAP_END_DECL
 
-#else /* !HAVE_LWP */
+#else
+
 /***********************************
  *                                 *
  * thread definitions for no       *
@@ -239,8 +236,5 @@ typedef int pthread_cond_t;
 
 LDAP_END_DECL
 
-#endif /* HAVE_LWP */
-#endif /* HAVE_THR */
-#endif /* HAVE_MACH_CTHREADS */
-#endif /* HAVE_PTHREADS */
+#endif /* no threads support */
 #endif /* _LTHREAD_H */