[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnulib] strncasecmp and AIX
From: |
Bruno Haible |
Subject: |
Re: [Bug-gnulib] strncasecmp and AIX |
Date: |
Fri, 26 Mar 2004 19:57:16 +0100 |
User-agent: |
KMail/1.5 |
Karl Berry wrote:
> Perhaps simply:
>
> #if !HAVE_STRCASECMP || !HAVE_STRNCASECMP
> # include "strcase.h"
> #endif
>
> After all, there's not much point in including our strcase.h if we're
> not actually going to use our replacement functions.
The philosophy is that the gnulib modules should be simple to use. This means
that the header files can be #included unconditionally, in any order. Any
#ifs belong in our header.
Then the strcase.h would look like this:
#if !HAVE_STRCASECMP || !HAVE_STRNCASECMP
extern int strcasecmp(...);
extern int strncasecmp(...);
#endif
But when used on AIX 4.3.2 now we would get "undeclared function" errors/
warnings. After fixing this, it would look like
#if HAVE_STRCASECMP && HAVE_STRNCASECMP
# if HAVE_STRINGS_H
# include <strings.h>
# endif
#else
extern int strcasecmp(...);
extern int strncasecmp(...);
#endif
I don't see the point of this added complexity. The thing works fine as is.
Bruno