summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2010-04-10 11:29:14 +0200
committerBruno Haible <bruno@clisp.org>2010-04-10 11:29:14 +0200
commitccf404b1021c4d59c32878e9c4d81e3a551c5ffb (patch)
tree31f21cdcce6b980f1aa7b45cc70bb6a585828ad7 /lib
parent85f6993aa94a87689fb1c4d49e5be4f271cb97d1 (diff)
downloadgnulib-ccf404b1021c4d59c32878e9c4d81e3a551c5ffb.tar.gz
strnlen: Fix warning in C++ mode on MacOS X.
Diffstat (limited to 'lib')
-rw-r--r--lib/string.in.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/string.in.h b/lib/string.in.h
index 6712256f25..de446b47a6 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -372,12 +372,23 @@ _GL_WARN_ON_USE (strndup, "strndup is unportable - "
MAXLEN bytes. If no '\0' terminator is found in that many bytes,
return MAXLEN. */
#if @GNULIB_STRNLEN@
-# if ! @HAVE_DECL_STRNLEN@
+# if @REPLACE_STRNLEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strnlen
+# define strnlen rpl_strnlen
+# endif
+_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__string, size_t __maxlen)
+ __attribute__ ((__pure__))
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__string, size_t __maxlen));
+# else
+# if ! @HAVE_DECL_STRNLEN@
_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__string, size_t __maxlen)
__attribute__ ((__pure__))
_GL_ARG_NONNULL ((1)));
-# endif
+# endif
_GL_CXXALIAS_SYS (strnlen, size_t, (char const *__string, size_t __maxlen));
+# endif
_GL_CXXALIASWARN (strnlen);
#elif defined GNULIB_POSIXCHECK
# undef strnlen