Fix clash of strncasecmp prototypes in C++ mode.
authorBruno Haible <bruno@clisp.org>
Wed, 1 Nov 2006 20:48:47 +0000 (20:48 +0000)
committerBruno Haible <bruno@clisp.org>
Wed, 1 Nov 2006 20:48:47 +0000 (20:48 +0000)
ChangeLog
lib/strcase.h
m4/strcase.m4

index 0bdba7f..b975ac7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2006-11-01  Bruno Haible  <bruno@clisp.org>
 
+       * m4/strcase.m4 (gl_FUNC_STRNCASECMP): Check whether strncasecmp is
+       already declared in <string.h>.
+       * lib/strcase.h (strncasecmp): Don't declare it if yes.
+
+2006-11-01  Bruno Haible  <bruno@clisp.org>
+
        * m4/strcase.m4 (gl_FUNC_STRCASECMP): Don't define strcasecmp here.
        * lib/strcase.h: Include <string.h>.
        (strcasecmp): Define to rpl_strcasecmp here.
index fa5a68d..07d4c9a 100644 (file)
@@ -43,7 +43,9 @@ extern int strcasecmp (const char *s1, const char *s2);
    returning less than, equal to or greater than zero if S1 is
    lexicographically less than, equal to or greater than S2.
    Note: This function can not work correctly in multibyte locales.  */
+#if ! HAVE_DECL_STRNCASECMP
 extern int strncasecmp (const char *s1, const char *s2, size_t n);
+#endif
 
 
 #ifdef __cplusplus
index 2e3d9cd..ae82790 100644 (file)
@@ -21,6 +21,7 @@ AC_DEFUN([gl_FUNC_STRCASECMP],
 AC_DEFUN([gl_FUNC_STRNCASECMP],
 [
   AC_REPLACE_FUNCS(strncasecmp)
+  AC_CHECK_DECLS(strncasecmp)
   if test $ac_cv_func_strncasecmp = no; then
     gl_PREREQ_STRNCASECMP
   fi