Commit bb1b8147 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Add configure tests for ssize_t and caddr_t and remove NT preamble

(excepting WIN32_LEAN_AND_MEAN).  Rework openlog/closelog use to
eliminate need for defines.
parent 4757d60f
......@@ -11,29 +11,8 @@
#ifndef _LDAP_PORTABLE_H
#define _LDAP_PORTABLE_H
/* --------------------------------------------------- */
/* begin of WINNT specific entries */
#if defined(WINNT) || defined(_WIN32)
/* don't suck in all of the win32 api */
#define WIN32_LEAN_AND_MEAN
/* preprocess out undefined functions */
#define LOG_DEBUG 0
#define openlog(a, b)
#define closelog()
/* define undefined types */
#define ssize_t signed int
typedef char * caddr_t;
#endif
/* end of WINNT specific entries */
/* --------------------------------------------------- */
/* end of preamble */
@TOP@
/* define this if needed to get reentrant functions */
......@@ -81,12 +60,24 @@ typedef char * caddr_t;
LBER_TAG_T
*/
/* define to character address type */
#undef caddr_t
/* define to signed size type */
#undef ssize_t
/* Leave that blank line there!! Autoheader needs it. */
@BOTTOM@
/* begin of postamble */
#ifdef _WIN32
/* don't suck in all of the win32 api */
# define WIN32_LEAN_AND_MEAN
#endif
#ifndef __NEED_PROTOTYPES
/* force LDAP_P to always include prototypes */
#define __NEED_PROTOTYPES 1
......
......@@ -189,7 +189,7 @@ main ( int argc, char **argv )
#ifdef LOG_MAIL
openlog( myname, OPENLOG_OPTIONS, LOG_MAIL );
#else
#elif LOG_DEBUG
openlog( myname, OPENLOG_OPTIONS );
#endif
......
......@@ -130,7 +130,7 @@ main( int argc, char **argv )
if ( dosyslog ) {
#ifdef LOG_LOCAL4
openlog( myname, OPENLOG_OPTIONS, LOG_LOCAL4 );
#else
#elif LOG_DEBUG
openlog( myname, OPENLOG_OPTIONS );
#endif
}
......
......@@ -181,7 +181,7 @@ main( int argc, char **argv )
if ( dosyslog ) {
#ifdef LOG_LOCAL3
openlog( myname, OPENLOG_OPTIONS, LOG_LOCAL3 );
#else
#elif LOG_DEBUG
openlog( myname, OPENLOG_OPTIONS );
#endif
}
......
......@@ -204,7 +204,7 @@ main (int argc, char **argv )
if ( dosyslog ) {
#ifdef LOG_LOCAL3
openlog( myname, OPENLOG_OPTIONS, LOG_LOCAL3 );
#else
#elif LOG_DEBUG
openlog( myname, OPENLOG_OPTIONS );
#endif
}
......
......@@ -204,7 +204,7 @@ main ( int argc, char **argv )
#ifdef LOG_MAIL
openlog( myname, OPENLOG_OPTIONS, LOG_MAIL );
#else
#elif LOG_DEBUG
openlog( myname, OPENLOG_OPTIONS );
#endif
......
......@@ -126,7 +126,7 @@ main( int argc, char **argv )
*/
#ifdef LOG_DAEMON
openlog( prog, OPENLOG_OPTIONS, LOG_DAEMON );
#else
#elif LOG_DEBUG
openlog( prog, OPENLOG_OPTIONS );
#endif
}
......
This diff is collapsed.
......@@ -1913,6 +1913,10 @@ AC_TYPE_PID_T
AM_TYPE_PTRDIFF_T
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
AC_CHECK_TYPE(ssize_t, [signed int])
AC_CHECK_TYPE(caddr_t, [char *])
OL_TYPE_SOCKLEN_T
AC_STRUCT_ST_BLKSIZE
AC_HEADER_TIME
......
......@@ -12,30 +12,9 @@
#ifndef _LDAP_PORTABLE_H
#define _LDAP_PORTABLE_H
/* --------------------------------------------------- */
/* begin of WINNT specific entries */
#if defined(WINNT) || defined(_WIN32)
/* don't suck in all of the win32 api */
#define WIN32_LEAN_AND_MEAN
/* preprocess out undefined functions */
#define LOG_DEBUG 0
#define openlog(a, b)
#define closelog()
/* define undefined types */
#define ssize_t signed int
typedef char * caddr_t;
#endif
/* end of WINNT specific entries */
/* --------------------------------------------------- */
/* end of preamble */
/* Define if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
......@@ -160,6 +139,12 @@ typedef char * caddr_t;
LBER_TAG_T
*/
/* define to character address type */
#undef caddr_t
/* define to signed size type */
#undef ssize_t
/* Define if you have the bcopy function. */
#undef HAVE_BCOPY
......@@ -913,8 +898,14 @@ typedef char * caddr_t;
/* define to support dynamic TCL backend */
#undef SLAPD_TCL_DYNAMIC
/* begin of postamble */
#ifdef _WIN32
/* don't suck in all of the win32 api */
# define WIN32_LEAN_AND_MEAN
#endif
#ifndef __NEED_PROTOTYPES
/* force LDAP_P to always include prototypes */
#define __NEED_PROTOTYPES 1
......
......@@ -58,10 +58,6 @@ typedef char * caddr_t;
#define ssize_t signed int
#define LOG_DEBUG 0
#define openlog( a, b )
#define closelog()
/* we have NT threads */
#ifdef _MT
#define HAVE_NT_THREADS 1
......
......@@ -277,7 +277,7 @@ main( int argc, char **argv )
if ( dosyslog ) {
#ifdef LOG_LOCAL4
openlog( myname, OPENLOG_OPTIONS, LOG_LOCAL4 );
#else
#elif LOG_DEBUG
openlog( myname, OPENLOG_OPTIONS );
#endif
}
......
......@@ -337,7 +337,7 @@ int main( int argc, char **argv )
#ifdef LOG_LOCAL4
openlog( serverName, OPENLOG_OPTIONS, syslogUser );
#else
#elif LOG_DEBUG
openlog( serverName, OPENLOG_OPTIONS );
#endif
......@@ -457,7 +457,9 @@ stop:
ReportSlapdShutdownComplete();
#endif
#ifdef LOG_DEBUG
closelog();
#endif
slapd_daemon_destroy();
#ifdef CSRIMALLOC
......
......@@ -152,7 +152,7 @@ doargs(
#ifdef LOG_LOCAL4
openlog( g->myname, OPENLOG_OPTIONS, LOG_LOCAL4 );
#else
#elif LOG_DEBUG
openlog( g->myname, OPENLOG_OPTIONS );
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment