/* this doesn't below as part of ldap.h */
#ifdef LDAP_SYSLOG
#define Debug( level, fmt, arg1, arg2, arg3 ) \
- { \
+ do { \
if ( ldap_debug & (level) ) \
fprintf( stderr, (fmt), (arg1), (arg2), (arg3) ); \
if ( ldap_syslog & (level) ) \
syslog( ldap_syslog_level, (fmt), (arg1), (arg2), (arg3) ); \
- }
+ } while ( 0 )
#else /* LDAP_SYSLOG */
#ifndef HAVE_WINSOCK
#define Debug( level, fmt, arg1, arg2, arg3 ) \
+ do { \
if ( ldap_debug & (level) ) \
- fprintf( stderr, (fmt), (arg1), (arg2), (arg3) );
+ fprintf( stderr, (fmt), (arg1), (arg2), (arg3) ); \
+ } while ( 0 )
#else /* !WINSOCK */
extern void Debug( int level, char* fmt, ... );
#endif /* !WINSOCK */
#if defined(LDAP_SYSLOG) && defined(LDAP_DEBUG)
#define Statslog( level, fmt, connid, opid, arg1, arg2, arg3 ) \
- { \
+ do { \
if ( ldap_debug & (level) ) \
fprintf( stderr, (fmt), (connid), (opid), (arg1), (arg2), (arg3) );\
if ( ldap_syslog & (level) ) \
syslog( ldap_syslog_level, (fmt), (connid), (opid), (arg1), \
(arg2), (arg3) ); \
- }
+ } while (0)
#else
#define Statslog( level, fmt, connid, opid, arg1, arg2, arg3 )
#endif