From 83408503a78be21d5ad80d38ba789e4726c5cc89 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 24 May 1999 23:01:57 +0000 Subject: [PATCH] Eliminate DECL_STRDUP check in favor of simple fix to header. Add #undef and other protection of macros. --- build/openldap.m4 | 19 ------------------- configure | 37 ------------------------------------- configure.in | 4 ---- include/ac/assert.h | 2 ++ include/ac/ctype.h | 3 +++ include/ac/signal.h | 1 + include/ac/string.h | 6 ++---- include/ldap_pvt.h | 3 --- include/portable.h.in | 3 --- 9 files changed, 8 insertions(+), 70 deletions(-) diff --git a/build/openldap.m4 b/build/openldap.m4 index b6207fd892..be67f8a666 100644 --- a/build/openldap.m4 +++ b/build/openldap.m4 @@ -626,25 +626,6 @@ if test $ol_cv_dcl_sys_errlist = no ; then fi ])dnl dnl -dnl ==================================================================== -dnl Check to see if we should not declare strdup if we have it -dnl -AC_DEFUN([OL_DECL_STRDUP], -[ -AC_MSG_CHECKING([strdup declaration]) -AC_CACHE_VAL(ol_cv_dcl_strdup,[ - AC_TRY_COMPILE([ -#include ], - [extern char *(strdup)();], - [ol_cv_dcl_strdup=yes], - [ol_cv_dcl_strdup=no])]) -AC_MSG_RESULT($ol_cv_dcl_strdup) -if test $ol_cv_dcl_strdup = yes ; then - AC_DEFINE(DECL_STRDUP,1, - [define if you have strdup() but it's not declared]) -fi -])dnl - dnl ==================================================================== dnl Early MIPS compilers (used in Ultrix 4.2) don't like dnl "int x; int *volatile a = &x; *a = 0;" diff --git a/configure b/configure index 9611bb7c73..6f2e35505e 100755 --- a/configure +++ b/configure @@ -11227,43 +11227,6 @@ fi -echo $ac_n "checking strdup declaration""... $ac_c" 1>&6 -echo "configure:11232: checking strdup declaration" >&5 -if eval "test \"`echo '$''{'ol_cv_dcl_strdup'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - cat > conftest.$ac_ext < -int main() { -extern char *(strdup)(); -; return 0; } -EOF -if { (eval echo configure:11246: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ol_cv_dcl_strdup=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ol_cv_dcl_strdup=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ol_cv_dcl_strdup" 1>&6 -if test $ol_cv_dcl_strdup = yes ; then - cat >> confdefs.h <<\EOF -#define DECL_STRDUP 1 -EOF - -fi - - - if test "$ol_enable_debug" != no ; then cat >> confdefs.h <<\EOF #define LDAP_DEBUG 1 diff --git a/configure.in b/configure.in index 4652673f2e..df1d83a08a 100644 --- a/configure.in +++ b/configure.in @@ -1600,10 +1600,6 @@ dnl ---------------------------------------------------------------- # Check Configuration OL_SYS_ERRLIST -dnl ---------------------------------------------------------------- -dnl Check our declaration of strdup() -OL_DECL_STRDUP - dnl ---------------------------------------------------------------- dnl Sort out defines diff --git a/include/ac/assert.h b/include/ac/assert.h index a65e1c0cc2..f0720684ae 100644 --- a/include/ac/assert.h +++ b/include/ac/assert.h @@ -12,6 +12,8 @@ #ifndef _AC_ASSERT_H #define _AC_ASSERT_H +#undef assert + #ifdef LDAP_DEBUG #if defined( HAVE_ASSERT_H ) || defined( STDC_HEADERS ) diff --git a/include/ac/ctype.h b/include/ac/ctype.h index b5638fe97d..bcb71d5030 100644 --- a/include/ac/ctype.h +++ b/include/ac/ctype.h @@ -14,6 +14,9 @@ #include +#undef TOUPPER +#undef TOLOWER + #ifdef C_UPPER_LOWER # define TOUPPER(c) (islower(c) ? toupper(c) : (c)) # define TOLOWER(c) (isupper(c) ? tolower(c) : (c)) diff --git a/include/ac/signal.h b/include/ac/signal.h index 4ce0deb7b6..b19e276430 100644 --- a/include/ac/signal.h +++ b/include/ac/signal.h @@ -14,6 +14,7 @@ #include +#undef SIGNAL #ifdef HAVE_SIGSET #define SIGNAL sigset #else diff --git a/include/ac/string.h b/include/ac/string.h index 3a17c7c4d8..96056c2aa0 100644 --- a/include/ac/string.h +++ b/include/ac/string.h @@ -55,10 +55,8 @@ extern char *ldap_pvt_strdup( const char * s ); # undef strdup # define strdup(s) ldap_pvt_strdup(s) #else -# ifdef DECL_STRDUP - /* some systems fail to declare strdup */ - extern char *(strdup)(); -# endif + /* some systems fail to declare strdup */ + extern char *(strdup)(); #endif /* diff --git a/include/ldap_pvt.h b/include/ldap_pvt.h index d7157b1fe2..eb6b6dbe69 100644 --- a/include/ldap_pvt.h +++ b/include/ldap_pvt.h @@ -44,9 +44,6 @@ ldap_pvt_gethostbyaddr_a LDAP_P(( struct hostent **result, int *herrno_ptr )); -LDAP_F( void ) -ldap_pvt_init_utils LDAP_P(( void )); - LDAP_END_DECL #endif diff --git a/include/portable.h.in b/include/portable.h.in index 6cf2e68397..291d64b621 100644 --- a/include/portable.h.in +++ b/include/portable.h.in @@ -747,9 +747,6 @@ /* define if you actually have sys_errlist in your libs */ #undef HAVE_SYS_ERRLIST -/* define if you have strdup() but it's not declared */ -#undef DECL_STRDUP - /* begin of postamble */ #ifdef HAVE_STDDEF_H -- 2.39.5