]> git.sur5r.net Git - openldap/commitdiff
ITS#4948: '#if <undefined macro>' -> '#ifdef' warning cleanup
authorHallvard Furuseth <hallvard@openldap.org>
Wed, 9 May 2007 18:17:10 +0000 (18:17 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Wed, 9 May 2007 18:17:10 +0000 (18:17 +0000)
24 files changed:
configure.in
contrib/ldapc++/src/ac/time.h
contrib/ldaptcl/neoXldap.c
include/ac/alloca.h
include/ac/crypt.h
include/ac/dirent.h
include/ac/errno.h
include/ac/socket.h
include/ac/time.h
include/ac/unistd.h
include/ac/wait.h
include/ldap_pvt.h
libraries/liblber/sockbuf.c
libraries/libldap_r/thr_posix.c
libraries/liblutil/detach.c
libraries/liblutil/lockf.c
servers/slapd/alock.c
servers/slapd/config.c
servers/slapd/connection.c
servers/slapd/daemon.c
servers/slapd/main.c
servers/slapd/overlays/ppolicy.c
servers/slapd/proto-slap.h
servers/slapd/slapcommon.c

index 04cb8886a64d531be214857cdc0e720ef091fc8a..0ae38989490ca9b08cbcab773fd5cfc3e90a1601 100644 (file)
@@ -1472,7 +1472,7 @@ int main(argc, argv)
 #endif
 
        /* make sure task runs first */
-#if HAVE_THR_YIELD
+#ifdef HAVE_THR_YIELD
        thr_yield();
 #elif defined( HAVE_SCHED_YIELD )
        sched_yield();
index 332d96d0531fbf488741669c6392e34968a18555..94db3bb1b241348e2ffe9528404aec1d3897b322 100644 (file)
 #ifndef _AC_TIME_H
 #define _AC_TIME_H
 
-#if TIME_WITH_SYS_TIME
+#ifdef TIME_WITH_SYS_TIME
 # include <sys/time.h>
 # include <time.h>
-#elif HAVE_SYS_TIME_H
+#elif defined HAVE_SYS_TIME_H
 # include <sys/time.h>
 # ifdef HAVE_SYS_TIMEB_H
 #  include <sys/timeb.h>
index a9f1a8f2b9a271f650057a5bd9bea97c268b7b86..b1ce03e705ce055ca475e165ed6d6128a7b55909 100644 (file)
@@ -1408,7 +1408,7 @@ NeoX_LdapObjCmd (clientData, interp, objc, objv)
        }
        ldap = ldap_init (ldapHost, ldapPort);
 
-#if LDAP_OPT_PROTOCOL_VERSION
+#ifdef LDAP_OPT_PROTOCOL_VERSION
        if (version != -1)
            ldap_set_option(ldap, LDAP_OPT_PROTOCOL_VERSION, &version);
 #endif
@@ -1426,7 +1426,7 @@ NeoX_LdapObjCmd (clientData, interp, objc, objv)
        return TCL_ERROR;
     }
 
-#if UMICH_LDAP
+#ifdef UMICH_LDAP
     ldap->ld_deref = LDAP_DEREF_NEVER;  /* Turn off alias dereferencing */
 #endif
 
index 20884dd9bcecf366b21516ac50d1cf1d6e29486b..be352ccdd6150725cd26551a4fde3145e9a41ace 100644 (file)
@@ -26,7 +26,7 @@
 #ifdef __GNUC__
 # define alloca __builtin_alloca
 #else
-# if HAVE_ALLOCA_H
+# ifdef HAVE_ALLOCA_H
 #  include <alloca.h>
 # else
 #  ifdef _AIX
index 4596a06cbe83a06083c329dc7e55b635430c7caf..c5a16bd1fbef621958d1e103147ea24c20a3fae0 100644 (file)
@@ -20,7 +20,7 @@
 #include <ac/unistd.h>
 
 /* crypt() may be defined in a separate include file */
-#if HAVE_CRYPT_H
+#ifdef HAVE_CRYPT_H
 #      include <crypt.h>
 #else
        extern char *(crypt)();
index 169d29d5025137c7916bb9ba70ddd773112147ef..6b4de339b5904f4770987821a1d1c02477cecd75 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef _AC_DIRENT_H
 #define _AC_DIRENT_H
 
-#if HAVE_DIRENT_H
+#ifdef HAVE_DIRENT_H
 # include <dirent.h>
 # define NAMLEN(dirent) strlen((dirent)->d_name)
 #elif defined(_MSC_VER)
@@ -37,13 +37,13 @@ typedef struct DIR {
 #else
 # define dirent direct
 # define NAMLEN(dirent) (dirent)->d_namlen
-# if HAVE_SYS_NDIR_H
+# ifdef HAVE_SYS_NDIR_H
 #  include <sys/ndir.h>
 # endif
-# if HAVE_SYS_DIR_H
+# ifdef HAVE_SYS_DIR_H
 #  include <sys/dir.h>
 # endif
-# if HAVE_NDIR_H
+# ifdef HAVE_NDIR_H
 #  include <ndir.h>
 # endif
 #endif
index 89ef242ef7e6a9dc845c9b9cf76c932d4c817680..601f2456ba8266839fde6f441fa586f76ec31a20 100644 (file)
@@ -27,7 +27,7 @@
        /* no sys_errlist */
 #      define          sys_nerr        0
 #      define          sys_errlist     ((char **)0)
-#elif DECL_SYS_ERRLIST
+#elif defined( DECL_SYS_ERRLIST )
        /* have sys_errlist but need declaration */
        LDAP_LIBC_V(int)      sys_nerr;
        LDAP_LIBC_V(char)    *sys_errlist[];
index 3ee751e3a6071eacf6a8bdedd3788a3d1945d860..d5644b3dfa0f9656bfc53eeff4d8975d471b5dce 100644 (file)
@@ -127,7 +127,7 @@ LBER_F( char * ) ber_pvt_wsa_err2string LDAP_P((int));
 #              define tcp_write( s, buf, len ) netwrite( s, buf, len )
 #      endif /* NCSA */
 
-#elif HAVE_CLOSESOCKET
+#elif defined(HAVE_CLOSESOCKET)
 #      define tcp_close( s )           closesocket( s )
 
 #      ifdef __BEOS__
index 6dd5b541dc6dd2a9ee951072ca712e1f88205046..cdf8cebb5abc72f3714e88d071b32ed4c0ccd655 100644 (file)
 #ifndef _AC_TIME_H
 #define _AC_TIME_H
 
-#if TIME_WITH_SYS_TIME
+#ifdef TIME_WITH_SYS_TIME
 # include <sys/time.h>
 # include <time.h>
-#elif HAVE_SYS_TIME_H
+#elif defined(HAVE_SYS_TIME_H)
 # include <sys/time.h>
 # ifdef HAVE_SYS_TIMEB_H
 #  include <sys/timeb.h>
index dd3c2788ae83cf1e8db423ebed6aff48d4b24868..c3accf62535bc1ba076563b75f7676c57b8b70c1 100644 (file)
 #ifndef _AC_UNISTD_H
 #define _AC_UNISTD_H
 
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
 #      include <sys/types.h>
 #endif
 
-#if HAVE_UNISTD_H
+#ifdef HAVE_UNISTD_H
 #      include <unistd.h>
 #endif
 
-#if HAVE_PROCESS_H
+#ifdef HAVE_PROCESS_H
 #      include <process.h>
 #endif
 
@@ -45,7 +45,7 @@ LDAP_LUTIL_F(char*)(lutil_getpass) LDAP_P((const char *getpass));
 #endif
 
 /* getopt() defines may be in separate include file */
-#if HAVE_GETOPT_H
+#ifdef HAVE_GETOPT_H
 #      include <getopt.h>
 
 #elif !defined(HAVE_GETOPT)
index 705a2de41f3beaca610c5f7f5938f532cca2d733..555e859bb03f7eb75e3e10623dbeb9620cd22f8f 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <sys/types.h>
 
-#if HAVE_SYS_WAIT_H
+#ifdef HAVE_SYS_WAIT_H
 # include <sys/wait.h>
 #endif
 
index b25721af9c2faf4bd804b308a0eab71f0e07da62..934999a48c92f61f9adc844a3ebc40d1d4918578 100644 (file)
@@ -311,7 +311,7 @@ LDAP_END_DECL
  * If none is available, unsigned long data is used.
  */
 
-#if USE_MP_BIGNUM
+#ifdef USE_MP_BIGNUM
 /*
  * Use OpenSSL's BIGNUM
  */
@@ -337,7 +337,7 @@ typedef     BIGNUM* ldap_pvt_mp_t;
 #define ldap_pvt_mp_clear(mp) \
        do { BN_free((mp)); (mp) = 0; } while (0)
 
-#elif USE_MP_GMP
+#elif defined(USE_MP_GMP)
 /*
  * Use GNU's multiple precision library
  */
@@ -366,13 +366,13 @@ typedef mpz_t             ldap_pvt_mp_t;
  * Use unsigned long long
  */
 
-#if USE_MP_LONG_LONG
+#ifdef USE_MP_LONG_LONG
 typedef        unsigned long long      ldap_pvt_mp_t;
 #define        LDAP_PVT_MP_INIT        (0LL)
-#elif USE_MP_LONG
+#elif defined(USE_MP_LONG)
 typedef        unsigned long           ldap_pvt_mp_t;
 #define        LDAP_PVT_MP_INIT        (0L)
-#elif HAVE_LONG_LONG
+#elif defined(HAVE_LONG_LONG)
 typedef        unsigned long long      ldap_pvt_mp_t;
 #define        LDAP_PVT_MP_INIT        (0LL)
 #else
index a828d078302a9f37aeaf03d4ae5bec04186b835c..25403e16b2a4e496542c4c07acb3c58bb6aa1a93 100644 (file)
@@ -339,7 +339,7 @@ ber_pvt_sb_do_write( Sockbuf_IO_Desc *sbiod, Sockbuf_Buf *buf_out )
 int
 ber_pvt_socket_set_nonblock( ber_socket_t sd, int nb )
 {
-#if HAVE_FCNTL
+#ifdef HAVE_FCNTL
        int flags = fcntl( sd, F_GETFL);
        if( nb ) {
                flags |= O_NONBLOCK;
index f378cfcaf8b6515db6f12ef46d037d141b90ad3a..1531acff32b30bffce1901e358b09f0161837194 100644 (file)
@@ -84,7 +84,7 @@ ldap_pvt_thread_set_concurrency(int n)
 {
 #ifdef HAVE_PTHREAD_SETCONCURRENCY
        return pthread_setconcurrency( n );
-#elif HAVE_THR_SETCONCURRENCY
+#elif defined(HAVE_THR_SETCONCURRENCY)
        return thr_setconcurrency( n );
 #else
        return 0;
@@ -98,7 +98,7 @@ ldap_pvt_thread_get_concurrency(void)
 {
 #ifdef HAVE_PTHREAD_GETCONCURRENCY
        return pthread_getconcurrency();
-#elif HAVE_THR_GETCONCURRENCY
+#elif defined(HAVE_THR_GETCONCURRENCY)
        return thr_getconcurrency();
 #else
        return 0;
@@ -197,10 +197,10 @@ ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **thread_return )
 int 
 ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
 {
-#if ( HAVE_PTHREAD_KILL && HAVE_PTHREADS > 6 )
+#if defined(HAVE_PTHREAD_KILL) && HAVE_PTHREADS > 6
        /* MacOS 10.1 is detected as v10 but has no pthread_kill() */
        return pthread_kill( thread, signo );
-#elif ( HAVE_PTHREAD_KILL && HAVE_PTHREADS > 4 )
+#elif defined(HAVE_PTHREAD_KILL) && HAVE_PTHREADS > 4
        if ( pthread_kill( thread, signo ) < 0 ) return errno;
        return 0;
 #else
@@ -223,7 +223,7 @@ ldap_pvt_thread_yield( void )
        select( 0, NULL, NULL, NULL, &tv );
 #endif
        return 0;
-#elif HAVE_THR_YIELD
+#elif defined(HAVE_THR_YIELD)
        thr_yield();
        return 0;
 
index 603c9ae2ae1fa393dddb8bb43a3e090869b5eaf4..eacd3fefec3572115af0c54d7d9f7c0f564545a1 100644 (file)
@@ -56,7 +56,7 @@ lutil_detach( int debug, int do_close )
 
 #ifdef HAVE_SYSCONF
        nbits = sysconf( _SC_OPEN_MAX );
-#elif HAVE_GETDTABLESIZE
+#elif defined(HAVE_GETDTABLESIZE)
        nbits = getdtablesize();
 #else
        nbits = FD_SETSIZE;
@@ -70,7 +70,7 @@ lutil_detach( int debug, int do_close )
 
        if ( debug == 0 ) {
                for ( i = 0; i < 5; i++ ) {
-#if HAVE_THR
+#ifdef HAVE_THR
                        switch ( fork1() )
 #else
                        switch ( fork() )
index b808e6abdb7d58c04cd99cc204a73109108e198c..00d91dfb2f2027b4d35dbbf6c20dff2008da56c3 100644 (file)
 
 #undef LOCK_API
 
-#if HAVE_LOCKF && defined(F_LOCK)
+#if defined(HAVE_LOCKF) && defined(F_LOCK)
 #      define USE_LOCKF 1
 #      define LOCK_API "lockf"
 #endif
 
-#if !defined(LOCK_API) && HAVE_FCNTL
+#if !defined(LOCK_API) && defined(HAVE_FCNTL)
 #      ifdef HAVE_FCNTL_H
 #              include <fcntl.h>
 #      endif
@@ -48,8 +48,8 @@
 #      endif
 #endif
 
-#if !defined(LOCK_API) && HAVE_FLOCK
-#      if HAVE_SYS_FILE_H
+#if !defined(LOCK_API) && defined(HAVE_FLOCK)
+#      ifdef HAVE_SYS_FILE_H
 #              include <sys/file.h>
 #      endif
 #      define USE_FLOCK 1
index 37d467ad127e658ee0ee0021998f4a13cfa22924..c7bb16d56f3b41c9ccd4518e38381cc68f783bd7 100644 (file)
@@ -32,7 +32,7 @@
 #include <ac/assert.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#if HAVE_SYS_FILE_H
+#ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>
 #endif
 #include <fcntl.h>
index 4f4f91e1af8ad0c0661a85b0c0d896acadc552dd..2aaa4d5128ba63cd2492e08148460c230cb49060 100644 (file)
@@ -41,7 +41,7 @@
 #define        S_ISREG(m)      (((m) & _S_IFMT) == _S_IFREG)
 #endif
 
-#if HAVE_UNISTD_H
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
index e4e2c9e28c7aa77db83da7d650b77774c44c825f..8c86a026221a6e41a6180c1ab18598a2296d78fc 100644 (file)
@@ -1453,7 +1453,7 @@ int connection_read(ber_socket_t s)
        }
 #ifdef DATA_READY_LOOP
        while( !rc && ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_DATA_READY, NULL ));
-#elif CONNECTION_INPUT_LOOP
+#elif defined CONNECTION_INPUT_LOOP
        while(!rc);
 #else
        while(0);
index 704a138772a777fd994391679dd1091eb6e5b462..9953c6d8dc17929e5c90dfe8a77faa00baa01f0f 100644 (file)
@@ -1434,7 +1434,7 @@ slapd_daemon_init( const char *urls )
 
 #ifdef HAVE_SYSCONF
        dtblsize = sysconf( _SC_OPEN_MAX );
-#elif HAVE_GETDTABLESIZE
+#elif defined(HAVE_GETDTABLESIZE)
        dtblsize = getdtablesize();
 #else /* ! HAVE_SYSCONF && ! HAVE_GETDTABLESIZE */
        dtblsize = FD_SETSIZE;
@@ -2651,7 +2651,7 @@ slap_sig_shutdown( int sig )
         * SIGBREAK is generated when a user logs out.
         */
 
-#if HAVE_NT_SERVICE_MANAGER && SIGBREAK
+#if defined(HAVE_NT_SERVICE_MANAGER) && defined(SIGBREAK)
        if (is_NT_Service && sig == SIGBREAK) {
                /* empty */;
        } else
index 9dc39c9f9f9dc995037a96d3c442fa832b5cece4..ec33cf84da03ce08576269d5997c9b633110d2fa 100644 (file)
@@ -441,7 +441,7 @@ int main( int argc, char **argv )
 
        while ( (i = getopt( argc, argv,
                             "c:d:f:F:h:n:o:s:tT:V"
-#if LDAP_PF_INET6
+#ifdef LDAP_PF_INET6
                                "46"
 #endif
 #ifdef HAVE_CHROOT
@@ -686,7 +686,7 @@ unhandled_option:;
 
 #ifdef LOG_LOCAL4
                openlog( logName, OPENLOG_OPTIONS, syslogUser );
-#elif LOG_DEBUG
+#elif defined LOG_DEBUG
                openlog( logName, OPENLOG_OPTIONS );
 #endif
 #ifdef HAVE_EBCDIC
index e10cdac62b3b624e84a10267ed1bbd34d95feec1..aa7bcee63717500c763702d88d0f5ad43832f036 100644 (file)
@@ -31,7 +31,7 @@
 #include <ldap.h>
 #include "lutil.h"
 #include "slap.h"
-#if SLAPD_MODULES
+#ifdef SLAPD_MODULES
 #define LIBLTDL_DLL_IMPORT     /* Win32: don't re-export libltdl's symbols */
 #include <ltdl.h>
 #endif
@@ -618,7 +618,7 @@ check_password_quality( struct berval *cred, PassPolicy *pp, LDAPPasswordPolicyE
        rc = LDAP_SUCCESS;
 
        if (pp->pwdCheckModule[0]) {
-#if SLAPD_MODULES
+#ifdef SLAPD_MODULES
                lt_dlhandle mod;
                const char *err;
                
index c665adc3b1d52698182af04674bc5457b57e89e8..83f68c3a70231e5ffd9f200184ca6b006aac4f7b 100644 (file)
@@ -1952,11 +1952,11 @@ LDAP_SLAPD_F (int) fe_access_allowed LDAP_P((
        } while ( 0 )
 
 #else
-# if USE_MP_LONG_LONG
+# ifdef USE_MP_LONG_LONG
 #  define UI2BV_FORMAT "%llu"
-# elif USE_MP_LONG
+# elif defined USE_MP_LONG
 #  define UI2BV_FORMAT "%lu"
-# elif HAVE_LONG_LONG
+# elif defined HAVE_LONG_LONG
 #  define UI2BV_FORMAT "%llu"
 # else
 #  define UI2BV_FORMAT "%lu"
index 70843c731e9c6c2317c568974ad916eafb46de17..07bf6dc0135ea23cbbb5cf345ae29cead63c5926 100644 (file)
@@ -429,7 +429,7 @@ slap_tool_init(
 
 #ifdef LOG_LOCAL4
                openlog( logName, OPENLOG_OPTIONS, syslogUser );
-#elif LOG_DEBUG
+#elif defined LOG_DEBUG
                openlog( logName, OPENLOG_OPTIONS );
 #endif
 #ifdef HAVE_EBCDIC