Eliminate DECL_STRDUP check in favor of simple fix to <ac/string.h> header.

Add #undef and other protection of macros.
This commit is contained in:
Kurt Zeilenga 1999-05-24 23:01:57 +00:00
parent e8116a8a74
commit 83408503a7
9 changed files with 8 additions and 70 deletions

View file

@ -626,25 +626,6 @@ if test $ol_cv_dcl_sys_errlist = no ; then
fi fi
])dnl ])dnl
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 <string.h> ],
[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 ====================================================================
dnl Early MIPS compilers (used in Ultrix 4.2) don't like dnl Early MIPS compilers (used in Ultrix 4.2) don't like
dnl "int x; int *volatile a = &x; *a = 0;" dnl "int x; int *volatile a = &x; *a = 0;"

37
configure vendored
View file

@ -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 <<EOF
#line 11238 "configure"
#include "confdefs.h"
#include <string.h>
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 if test "$ol_enable_debug" != no ; then
cat >> confdefs.h <<\EOF cat >> confdefs.h <<\EOF
#define LDAP_DEBUG 1 #define LDAP_DEBUG 1

View file

@ -1600,10 +1600,6 @@ dnl ----------------------------------------------------------------
# Check Configuration # Check Configuration
OL_SYS_ERRLIST OL_SYS_ERRLIST
dnl ----------------------------------------------------------------
dnl Check our declaration of strdup()
OL_DECL_STRDUP
dnl ---------------------------------------------------------------- dnl ----------------------------------------------------------------
dnl Sort out defines dnl Sort out defines

View file

@ -12,6 +12,8 @@
#ifndef _AC_ASSERT_H #ifndef _AC_ASSERT_H
#define _AC_ASSERT_H #define _AC_ASSERT_H
#undef assert
#ifdef LDAP_DEBUG #ifdef LDAP_DEBUG
#if defined( HAVE_ASSERT_H ) || defined( STDC_HEADERS ) #if defined( HAVE_ASSERT_H ) || defined( STDC_HEADERS )

View file

@ -14,6 +14,9 @@
#include <ctype.h> #include <ctype.h>
#undef TOUPPER
#undef TOLOWER
#ifdef C_UPPER_LOWER #ifdef C_UPPER_LOWER
# define TOUPPER(c) (islower(c) ? toupper(c) : (c)) # define TOUPPER(c) (islower(c) ? toupper(c) : (c))
# define TOLOWER(c) (isupper(c) ? tolower(c) : (c)) # define TOLOWER(c) (isupper(c) ? tolower(c) : (c))

View file

@ -14,6 +14,7 @@
#include <signal.h> #include <signal.h>
#undef SIGNAL
#ifdef HAVE_SIGSET #ifdef HAVE_SIGSET
#define SIGNAL sigset #define SIGNAL sigset
#else #else

View file

@ -55,10 +55,8 @@ extern char *ldap_pvt_strdup( const char * s );
# undef strdup # undef strdup
# define strdup(s) ldap_pvt_strdup(s) # define strdup(s) ldap_pvt_strdup(s)
#else #else
# ifdef DECL_STRDUP /* some systems fail to declare strdup */
/* some systems fail to declare strdup */ extern char *(strdup)();
extern char *(strdup)();
# endif
#endif #endif
/* /*

View file

@ -44,9 +44,6 @@ ldap_pvt_gethostbyaddr_a LDAP_P((
struct hostent **result, struct hostent **result,
int *herrno_ptr )); int *herrno_ptr ));
LDAP_F( void )
ldap_pvt_init_utils LDAP_P(( void ));
LDAP_END_DECL LDAP_END_DECL
#endif #endif

View file

@ -747,9 +747,6 @@
/* define if you actually have sys_errlist in your libs */ /* define if you actually have sys_errlist in your libs */
#undef HAVE_SYS_ERRLIST #undef HAVE_SYS_ERRLIST
/* define if you have strdup() but it's not declared */
#undef DECL_STRDUP
/* begin of postamble */ /* begin of postamble */
#ifdef HAVE_STDDEF_H #ifdef HAVE_STDDEF_H