#endif
/* make sure task runs first */
-#if HAVE_THR_YIELD
+#ifdef HAVE_THR_YIELD
thr_yield();
#elif defined( HAVE_SCHED_YIELD )
sched_yield();
#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>
}
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
return TCL_ERROR;
}
-#if UMICH_LDAP
+#ifdef UMICH_LDAP
ldap->ld_deref = LDAP_DEREF_NEVER; /* Turn off alias dereferencing */
#endif
#ifdef __GNUC__
# define alloca __builtin_alloca
#else
-# if HAVE_ALLOCA_H
+# ifdef HAVE_ALLOCA_H
# include <alloca.h>
# else
# ifdef _AIX
#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)();
#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)
#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
/* 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[];
# 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__
#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>
#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
#endif
/* getopt() defines may be in separate include file */
-#if HAVE_GETOPT_H
+#ifdef HAVE_GETOPT_H
# include <getopt.h>
#elif !defined(HAVE_GETOPT)
#include <sys/types.h>
-#if HAVE_SYS_WAIT_H
+#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
#endif
* If none is available, unsigned long data is used.
*/
-#if USE_MP_BIGNUM
+#ifdef USE_MP_BIGNUM
/*
* Use OpenSSL's BIGNUM
*/
#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
*/
* 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
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;
{
#ifdef HAVE_PTHREAD_SETCONCURRENCY
return pthread_setconcurrency( n );
-#elif HAVE_THR_SETCONCURRENCY
+#elif defined(HAVE_THR_SETCONCURRENCY)
return thr_setconcurrency( n );
#else
return 0;
{
#ifdef HAVE_PTHREAD_GETCONCURRENCY
return pthread_getconcurrency();
-#elif HAVE_THR_GETCONCURRENCY
+#elif defined(HAVE_THR_GETCONCURRENCY)
return thr_getconcurrency();
#else
return 0;
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
select( 0, NULL, NULL, NULL, &tv );
#endif
return 0;
-#elif HAVE_THR_YIELD
+#elif defined(HAVE_THR_YIELD)
thr_yield();
return 0;
#ifdef HAVE_SYSCONF
nbits = sysconf( _SC_OPEN_MAX );
-#elif HAVE_GETDTABLESIZE
+#elif defined(HAVE_GETDTABLESIZE)
nbits = getdtablesize();
#else
nbits = FD_SETSIZE;
if ( debug == 0 ) {
for ( i = 0; i < 5; i++ ) {
-#if HAVE_THR
+#ifdef HAVE_THR
switch ( fork1() )
#else
switch ( fork() )
#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
# 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
#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>
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
#endif
-#if HAVE_UNISTD_H
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
}
#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);
#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;
* 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
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
#ifdef LOG_LOCAL4
openlog( logName, OPENLOG_OPTIONS, syslogUser );
-#elif LOG_DEBUG
+#elif defined LOG_DEBUG
openlog( logName, OPENLOG_OPTIONS );
#endif
#ifdef HAVE_EBCDIC
#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
rc = LDAP_SUCCESS;
if (pp->pwdCheckModule[0]) {
-#if SLAPD_MODULES
+#ifdef SLAPD_MODULES
lt_dlhandle mod;
const char *err;
} 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"
#ifdef LOG_LOCAL4
openlog( logName, OPENLOG_OPTIONS, syslogUser );
-#elif LOG_DEBUG
+#elif defined LOG_DEBUG
openlog( logName, OPENLOG_OPTIONS );
#endif
#ifdef HAVE_EBCDIC