[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strncasecmp dcl
From: |
Paul Eggert |
Subject: |
Re: strncasecmp dcl |
Date: |
Thu, 21 Jun 2001 08:44:15 -0700 (PDT) |
> From: Werner LEMBERG <address@hidden>
> Date: Wed, 20 Jun 2001 22:11:53 +0200 (CEST)
>
> How can this be fixed properly?
One way to fix it would be to follow the lead of AC_HEADER_TIME and
define an AC_HEADER_STRING that defines STRING_WITH_STRINGS if you can
include both <sys/time.h> and <time.h>. However, I've always thought
this method to be clumsy, as it clutters up the code.
Since <string.h> clearly dominates <strings.h>, how about the following
method instead:
* Modify _AC_INCLUDES_DEFAULT_REQUIREMENTS so that it does not
define HAVE_STRINGS_H if the two include files are incompatible.
* Modify the default includes to use the following pattern:
#if HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
# include <memory.h>
# endif
# include <string.h>
#endif
#if HAVE_STRINGS_H
# include <strings.h>
#endif
* (This is the tricky part.) Modify AC_CHECK_HEADER to use
AC_INCLUDES_DEFAULT before including the header in question. That
way, if string.h and strings.h are incompatible, HAVE_STRINGS_H
won't be defined; this is because the code checks string.h before
checking for strings.h. Extend AC_CHECK_HEADER to accept a new,
fourth argument specifying the default includes, just as
AC_CHECK_DECL does.
The advantage of the last step is that it will cause autoconf to
always check for header incompatibility. If done right, this would
render AC_HEADER_TIME obsolete.