On Android, I'm seeing these compilation errors:

../gllib/string.h:855:1: error: reference to overloaded function could not be 
resolved; did you mean to call it?
_GL_CXXALIASWARN (memrchr);
^~~~~~~~~~~~~~~~~~~~~~~~~~

../gllib/string.h:1010:1: error: reference to overloaded function could not be 
resolved; did you mean to call it?
_GL_CXXALIASWARN (strchrnul);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~

../gllib/string.h:1375:1: error: reference to overloaded function could not be 
resolved; did you mean to call it?
_GL_CXXALIASWARN (strcasestr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~


This patch fixes them.


2023-01-05  Bruno Haible  <br...@clisp.org>

        string: Fix compilation errors in C++ mode on Android.
        * lib/string.in.h (memrchr, strchrnul, strcasestr): Disable
        _GL_CXXALIASWARN invocation on non-glibc systems.

diff --git a/lib/string.in.h b/lib/string.in.h
index b2683b6e4c..b227a17887 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -344,7 +344,7 @@ _GL_CXXALIAS_SYS_CAST2 (memrchr,
          || defined __clang__)
 _GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t) throw ());
 _GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t) throw 
());
-# else
+# elif __GLIBC__ >= 2
 _GL_CXXALIASWARN (memrchr);
 # endif
 #elif defined GNULIB_POSIXCHECK
@@ -499,7 +499,7 @@ _GL_CXXALIAS_SYS_CAST2 (strchrnul,
 _GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in) throw ());
 _GL_CXXALIASWARN1 (strchrnul, char const *,
                    (char const *__s, int __c_in) throw ());
-# else
+# elif __GLIBC__ >= 2
 _GL_CXXALIASWARN (strchrnul);
 # endif
 #elif defined GNULIB_POSIXCHECK
@@ -864,7 +864,7 @@ _GL_CXXALIASWARN1 (strcasestr, char *,
                    (char *haystack, const char *needle) throw ());
 _GL_CXXALIASWARN1 (strcasestr, const char *,
                    (const char *haystack, const char *needle) throw ());
-# else
+# elif __GLIBC__ >= 2
 _GL_CXXALIASWARN (strcasestr);
 # endif
 #elif defined GNULIB_POSIXCHECK




Reply via email to