|
@@ -1,4 +1,3 @@
|
|
|
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
|
|
|
|
|
/* A GNU-like <string.h>.
|
|
/* A GNU-like <string.h>.
|
|
|
|
|
|
|
|
Copyright (C) 1995-1996, 2001-2011 Free Software Foundation, Inc.
|
|
Copyright (C) 1995-1996, 2001-2011 Free Software Foundation, Inc.
|
|
@@ -17,24 +16,24 @@
|
|
|
along with this program; if not, write to the Free Software Foundation,
|
|
along with this program; if not, write to the Free Software Foundation,
|
|
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
|
|
|
|
|
|
|
-#ifndef _GL_STRING_H
|
|
|
|
|
|
|
+#ifndef _@GUARD_PREFIX@_STRING_H
|
|
|
|
|
|
|
|
#if __GNUC__ >= 3
|
|
#if __GNUC__ >= 3
|
|
|
-#pragma GCC system_header
|
|
|
|
|
|
|
+@PRAGMA_SYSTEM_HEADER@
|
|
|
#endif
|
|
#endif
|
|
|
-
|
|
|
|
|
|
|
+@PRAGMA_COLUMNS@
|
|
|
|
|
|
|
|
/* The include_next requires a split double-inclusion guard. */
|
|
/* The include_next requires a split double-inclusion guard. */
|
|
|
-#include_next <string.h>
|
|
|
|
|
|
|
+#@INCLUDE_NEXT@ @NEXT_STRING_H@
|
|
|
|
|
|
|
|
-#ifndef _GL_STRING_H
|
|
|
|
|
-#define _GL_STRING_H
|
|
|
|
|
|
|
+#ifndef _@GUARD_PREFIX@_STRING_H
|
|
|
|
|
+#define _@GUARD_PREFIX@_STRING_H
|
|
|
|
|
|
|
|
/* NetBSD 5.0 mis-defines NULL. */
|
|
/* NetBSD 5.0 mis-defines NULL. */
|
|
|
#include <stddef.h>
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
/* MirBSD defines mbslen as a macro. */
|
|
/* MirBSD defines mbslen as a macro. */
|
|
|
-#if 0 && defined __MirBSD__
|
|
|
|
|
|
|
+#if @GNULIB_MBSLEN@ && defined __MirBSD__
|
|
|
# include <wchar.h>
|
|
# include <wchar.h>
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
@@ -48,332 +47,21 @@
|
|
|
|
|
|
|
|
/* NetBSD 5.0 declares strsignal in <unistd.h>, not in <string.h>. */
|
|
/* NetBSD 5.0 declares strsignal in <unistd.h>, not in <string.h>. */
|
|
|
/* But in any case avoid namespace pollution on glibc systems. */
|
|
/* But in any case avoid namespace pollution on glibc systems. */
|
|
|
-#if (0 || defined GNULIB_POSIXCHECK) && defined __NetBSD__ \
|
|
|
|
|
|
|
+#if (@GNULIB_STRSIGNAL@ || defined GNULIB_POSIXCHECK) && defined __NetBSD__ \
|
|
|
&& ! defined __GLIBC__
|
|
&& ! defined __GLIBC__
|
|
|
# include <unistd.h>
|
|
# include <unistd.h>
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
|
|
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
|
|
|
-#ifndef _GL_CXXDEFS_H
|
|
|
|
|
-#define _GL_CXXDEFS_H
|
|
|
|
|
-
|
|
|
|
|
-/* The three most frequent use cases of these macros are:
|
|
|
|
|
-
|
|
|
|
|
- * For providing a substitute for a function that is missing on some
|
|
|
|
|
- platforms, but is declared and works fine on the platforms on which
|
|
|
|
|
- it exists:
|
|
|
|
|
-
|
|
|
|
|
- #if @GNULIB_FOO@
|
|
|
|
|
- # if !@HAVE_FOO@
|
|
|
|
|
- _GL_FUNCDECL_SYS (foo, ...);
|
|
|
|
|
- # endif
|
|
|
|
|
- _GL_CXXALIAS_SYS (foo, ...);
|
|
|
|
|
- _GL_CXXALIASWARN (foo);
|
|
|
|
|
- #elif defined GNULIB_POSIXCHECK
|
|
|
|
|
- ...
|
|
|
|
|
- #endif
|
|
|
|
|
-
|
|
|
|
|
- * For providing a replacement for a function that exists on all platforms,
|
|
|
|
|
- but is broken/insufficient and needs to be replaced on some platforms:
|
|
|
|
|
-
|
|
|
|
|
- #if @GNULIB_FOO@
|
|
|
|
|
- # if @REPLACE_FOO@
|
|
|
|
|
- # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
|
|
|
- # undef foo
|
|
|
|
|
- # define foo rpl_foo
|
|
|
|
|
- # endif
|
|
|
|
|
- _GL_FUNCDECL_RPL (foo, ...);
|
|
|
|
|
- _GL_CXXALIAS_RPL (foo, ...);
|
|
|
|
|
- # else
|
|
|
|
|
- _GL_CXXALIAS_SYS (foo, ...);
|
|
|
|
|
- # endif
|
|
|
|
|
- _GL_CXXALIASWARN (foo);
|
|
|
|
|
- #elif defined GNULIB_POSIXCHECK
|
|
|
|
|
- ...
|
|
|
|
|
- #endif
|
|
|
|
|
-
|
|
|
|
|
- * For providing a replacement for a function that exists on some platforms
|
|
|
|
|
- but is broken/insufficient and needs to be replaced on some of them and
|
|
|
|
|
- is additionally either missing or undeclared on some other platforms:
|
|
|
|
|
-
|
|
|
|
|
- #if @GNULIB_FOO@
|
|
|
|
|
- # if @REPLACE_FOO@
|
|
|
|
|
- # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
|
|
|
- # undef foo
|
|
|
|
|
- # define foo rpl_foo
|
|
|
|
|
- # endif
|
|
|
|
|
- _GL_FUNCDECL_RPL (foo, ...);
|
|
|
|
|
- _GL_CXXALIAS_RPL (foo, ...);
|
|
|
|
|
- # else
|
|
|
|
|
- # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
|
|
|
|
|
- _GL_FUNCDECL_SYS (foo, ...);
|
|
|
|
|
- # endif
|
|
|
|
|
- _GL_CXXALIAS_SYS (foo, ...);
|
|
|
|
|
- # endif
|
|
|
|
|
- _GL_CXXALIASWARN (foo);
|
|
|
|
|
- #elif defined GNULIB_POSIXCHECK
|
|
|
|
|
- ...
|
|
|
|
|
- #endif
|
|
|
|
|
-*/
|
|
|
|
|
-
|
|
|
|
|
-/* _GL_EXTERN_C declaration;
|
|
|
|
|
- performs the declaration with C linkage. */
|
|
|
|
|
-#if defined __cplusplus
|
|
|
|
|
-# define _GL_EXTERN_C extern "C"
|
|
|
|
|
-#else
|
|
|
|
|
-# define _GL_EXTERN_C extern
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
-/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
|
|
|
|
|
- declares a replacement function, named rpl_func, with the given prototype,
|
|
|
|
|
- consisting of return type, parameters, and attributes.
|
|
|
|
|
- Example:
|
|
|
|
|
- _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
|
|
|
|
|
- _GL_ARG_NONNULL ((1)));
|
|
|
|
|
- */
|
|
|
|
|
-#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
|
|
|
|
|
- _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
|
|
|
|
|
-#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
|
|
|
|
|
- _GL_EXTERN_C rettype rpl_func parameters_and_attributes
|
|
|
|
|
-
|
|
|
|
|
-/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
|
|
|
|
|
- declares the system function, named func, with the given prototype,
|
|
|
|
|
- consisting of return type, parameters, and attributes.
|
|
|
|
|
- Example:
|
|
|
|
|
- _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
|
|
|
|
|
- _GL_ARG_NONNULL ((1)));
|
|
|
|
|
- */
|
|
|
|
|
-#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
|
|
|
|
|
- _GL_EXTERN_C rettype func parameters_and_attributes
|
|
|
|
|
-
|
|
|
|
|
-/* _GL_CXXALIAS_RPL (func, rettype, parameters);
|
|
|
|
|
- declares a C++ alias called GNULIB_NAMESPACE::func
|
|
|
|
|
- that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
|
|
|
|
|
- Example:
|
|
|
|
|
- _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
|
|
|
|
|
- */
|
|
|
|
|
-#define _GL_CXXALIAS_RPL(func,rettype,parameters) \
|
|
|
|
|
- _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
|
|
|
|
|
-#if defined __cplusplus && defined GNULIB_NAMESPACE
|
|
|
|
|
-# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
|
|
|
|
|
- namespace GNULIB_NAMESPACE \
|
|
|
|
|
- { \
|
|
|
|
|
- rettype (*const func) parameters = ::rpl_func; \
|
|
|
|
|
- } \
|
|
|
|
|
- _GL_EXTERN_C int _gl_cxxalias_dummy
|
|
|
|
|
-#else
|
|
|
|
|
-# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
|
|
|
|
|
- _GL_EXTERN_C int _gl_cxxalias_dummy
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
-/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
|
|
|
|
|
- is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
|
|
|
|
|
- except that the C function rpl_func may have a slightly different
|
|
|
|
|
- declaration. A cast is used to silence the "invalid conversion" error
|
|
|
|
|
- that would otherwise occur. */
|
|
|
|
|
-#if defined __cplusplus && defined GNULIB_NAMESPACE
|
|
|
|
|
-# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
|
|
|
|
|
- namespace GNULIB_NAMESPACE \
|
|
|
|
|
- { \
|
|
|
|
|
- rettype (*const func) parameters = \
|
|
|
|
|
- reinterpret_cast<rettype(*)parameters>(::rpl_func); \
|
|
|
|
|
- } \
|
|
|
|
|
- _GL_EXTERN_C int _gl_cxxalias_dummy
|
|
|
|
|
-#else
|
|
|
|
|
-# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
|
|
|
|
|
- _GL_EXTERN_C int _gl_cxxalias_dummy
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
-/* _GL_CXXALIAS_SYS (func, rettype, parameters);
|
|
|
|
|
- declares a C++ alias called GNULIB_NAMESPACE::func
|
|
|
|
|
- that redirects to the system provided function func, if GNULIB_NAMESPACE
|
|
|
|
|
- is defined.
|
|
|
|
|
- Example:
|
|
|
|
|
- _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
|
|
|
|
|
- */
|
|
|
|
|
-#if defined __cplusplus && defined GNULIB_NAMESPACE
|
|
|
|
|
- /* If we were to write
|
|
|
|
|
- rettype (*const func) parameters = ::func;
|
|
|
|
|
- like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls
|
|
|
|
|
- better (remove an indirection through a 'static' pointer variable),
|
|
|
|
|
- but then the _GL_CXXALIASWARN macro below would cause a warning not only
|
|
|
|
|
- for uses of ::func but also for uses of GNULIB_NAMESPACE::func. */
|
|
|
|
|
-# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
|
|
|
|
|
- namespace GNULIB_NAMESPACE \
|
|
|
|
|
- { \
|
|
|
|
|
- static rettype (*func) parameters = ::func; \
|
|
|
|
|
- } \
|
|
|
|
|
- _GL_EXTERN_C int _gl_cxxalias_dummy
|
|
|
|
|
-#else
|
|
|
|
|
-# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
|
|
|
|
|
- _GL_EXTERN_C int _gl_cxxalias_dummy
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
-/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
|
|
|
|
|
- is like _GL_CXXALIAS_SYS (func, rettype, parameters);
|
|
|
|
|
- except that the C function func may have a slightly different declaration.
|
|
|
|
|
- A cast is used to silence the "invalid conversion" error that would
|
|
|
|
|
- otherwise occur. */
|
|
|
|
|
-#if defined __cplusplus && defined GNULIB_NAMESPACE
|
|
|
|
|
-# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
|
|
|
|
|
- namespace GNULIB_NAMESPACE \
|
|
|
|
|
- { \
|
|
|
|
|
- static rettype (*func) parameters = \
|
|
|
|
|
- reinterpret_cast<rettype(*)parameters>(::func); \
|
|
|
|
|
- } \
|
|
|
|
|
- _GL_EXTERN_C int _gl_cxxalias_dummy
|
|
|
|
|
-#else
|
|
|
|
|
-# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
|
|
|
|
|
- _GL_EXTERN_C int _gl_cxxalias_dummy
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
-/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
|
|
|
|
|
- is like _GL_CXXALIAS_SYS (func, rettype, parameters);
|
|
|
|
|
- except that the C function is picked among a set of overloaded functions,
|
|
|
|
|
- namely the one with rettype2 and parameters2. Two consecutive casts
|
|
|
|
|
- are used to silence the "cannot find a match" and "invalid conversion"
|
|
|
|
|
- errors that would otherwise occur. */
|
|
|
|
|
-#if defined __cplusplus && defined GNULIB_NAMESPACE
|
|
|
|
|
- /* The outer cast must be a reinterpret_cast.
|
|
|
|
|
- The inner cast: When the function is defined as a set of overloaded
|
|
|
|
|
- functions, it works as a static_cast<>, choosing the designated variant.
|
|
|
|
|
- When the function is defined as a single variant, it works as a
|
|
|
|
|
- reinterpret_cast<>. The parenthesized cast syntax works both ways. */
|
|
|
|
|
-# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
|
|
|
|
|
- namespace GNULIB_NAMESPACE \
|
|
|
|
|
- { \
|
|
|
|
|
- static rettype (*func) parameters = \
|
|
|
|
|
- reinterpret_cast<rettype(*)parameters>( \
|
|
|
|
|
- (rettype2(*)parameters2)(::func)); \
|
|
|
|
|
- } \
|
|
|
|
|
- _GL_EXTERN_C int _gl_cxxalias_dummy
|
|
|
|
|
-#else
|
|
|
|
|
-# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
|
|
|
|
|
- _GL_EXTERN_C int _gl_cxxalias_dummy
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
-/* _GL_CXXALIASWARN (func);
|
|
|
|
|
- causes a warning to be emitted when ::func is used but not when
|
|
|
|
|
- GNULIB_NAMESPACE::func is used. func must be defined without overloaded
|
|
|
|
|
- variants. */
|
|
|
|
|
-#if defined __cplusplus && defined GNULIB_NAMESPACE
|
|
|
|
|
-# define _GL_CXXALIASWARN(func) \
|
|
|
|
|
- _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
|
|
|
|
|
-# define _GL_CXXALIASWARN_1(func,namespace) \
|
|
|
|
|
- _GL_CXXALIASWARN_2 (func, namespace)
|
|
|
|
|
-/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
|
|
|
|
|
- we enable the warning only when not optimizing. */
|
|
|
|
|
-# if !__OPTIMIZE__
|
|
|
|
|
-# define _GL_CXXALIASWARN_2(func,namespace) \
|
|
|
|
|
- _GL_WARN_ON_USE (func, \
|
|
|
|
|
- "The symbol ::" #func " refers to the system function. " \
|
|
|
|
|
- "Use " #namespace "::" #func " instead.")
|
|
|
|
|
-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
|
|
|
|
|
-# define _GL_CXXALIASWARN_2(func,namespace) \
|
|
|
|
|
- extern __typeof__ (func) func
|
|
|
|
|
-# else
|
|
|
|
|
-# define _GL_CXXALIASWARN_2(func,namespace) \
|
|
|
|
|
- _GL_EXTERN_C int _gl_cxxalias_dummy
|
|
|
|
|
-# endif
|
|
|
|
|
-#else
|
|
|
|
|
-# define _GL_CXXALIASWARN(func) \
|
|
|
|
|
- _GL_EXTERN_C int _gl_cxxalias_dummy
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
-/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
|
|
|
|
|
- causes a warning to be emitted when the given overloaded variant of ::func
|
|
|
|
|
- is used but not when GNULIB_NAMESPACE::func is used. */
|
|
|
|
|
-#if defined __cplusplus && defined GNULIB_NAMESPACE
|
|
|
|
|
-# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
|
|
|
|
|
- _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
|
|
|
|
|
- GNULIB_NAMESPACE)
|
|
|
|
|
-# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
|
|
|
|
|
- _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
|
|
|
|
|
-/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
|
|
|
|
|
- we enable the warning only when not optimizing. */
|
|
|
|
|
-# if !__OPTIMIZE__
|
|
|
|
|
-# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
|
|
|
|
|
- _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
|
|
|
|
|
- "The symbol ::" #func " refers to the system function. " \
|
|
|
|
|
- "Use " #namespace "::" #func " instead.")
|
|
|
|
|
-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
|
|
|
|
|
-# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
|
|
|
|
|
- extern __typeof__ (func) func
|
|
|
|
|
-# else
|
|
|
|
|
-# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
|
|
|
|
|
- _GL_EXTERN_C int _gl_cxxalias_dummy
|
|
|
|
|
-# endif
|
|
|
|
|
-#else
|
|
|
|
|
-# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
|
|
|
|
|
- _GL_EXTERN_C int _gl_cxxalias_dummy
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
-#endif /* _GL_CXXDEFS_H */
|
|
|
|
|
|
|
|
|
|
/* The definition of _GL_ARG_NONNULL is copied here. */
|
|
/* The definition of _GL_ARG_NONNULL is copied here. */
|
|
|
-/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
|
|
|
|
|
- that the values passed as arguments n, ..., m must be non-NULL pointers.
|
|
|
|
|
- n = 1 stands for the first argument, n = 2 for the second argument etc. */
|
|
|
|
|
-#ifndef _GL_ARG_NONNULL
|
|
|
|
|
-# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
|
|
|
|
|
-# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
|
|
|
|
|
-# else
|
|
|
|
|
-# define _GL_ARG_NONNULL(params)
|
|
|
|
|
-# endif
|
|
|
|
|
-#endif
|
|
|
|
|
|
|
|
|
|
/* The definition of _GL_WARN_ON_USE is copied here. */
|
|
/* The definition of _GL_WARN_ON_USE is copied here. */
|
|
|
-#ifndef _GL_WARN_ON_USE
|
|
|
|
|
-
|
|
|
|
|
-# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
|
|
|
|
|
-/* A compiler attribute is available in gcc versions 4.3.0 and later. */
|
|
|
|
|
-# define _GL_WARN_ON_USE(function, message) \
|
|
|
|
|
-extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
|
|
|
|
|
-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
|
|
|
|
|
-/* Verify the existence of the function. */
|
|
|
|
|
-# define _GL_WARN_ON_USE(function, message) \
|
|
|
|
|
-extern __typeof__ (function) function
|
|
|
|
|
-# else /* Unsupported. */
|
|
|
|
|
-# define _GL_WARN_ON_USE(function, message) \
|
|
|
|
|
-_GL_WARN_EXTERN_C int _gl_warn_on_use
|
|
|
|
|
-# endif
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
-/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
|
|
|
|
|
- is like _GL_WARN_ON_USE (function, "string"), except that the function is
|
|
|
|
|
- declared with the given prototype, consisting of return type, parameters,
|
|
|
|
|
- and attributes.
|
|
|
|
|
- This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
|
|
|
|
|
- not work in this case. */
|
|
|
|
|
-#ifndef _GL_WARN_ON_USE_CXX
|
|
|
|
|
-# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
|
|
|
|
|
-# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
|
|
|
|
|
-extern rettype function parameters_and_attributes \
|
|
|
|
|
- __attribute__ ((__warning__ (msg)))
|
|
|
|
|
-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
|
|
|
|
|
-/* Verify the existence of the function. */
|
|
|
|
|
-# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
|
|
|
|
|
-extern rettype function parameters_and_attributes
|
|
|
|
|
-# else /* Unsupported. */
|
|
|
|
|
-# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
|
|
|
|
|
-_GL_WARN_EXTERN_C int _gl_warn_on_use
|
|
|
|
|
-# endif
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
-/* _GL_WARN_EXTERN_C declaration;
|
|
|
|
|
- performs the declaration with C linkage. */
|
|
|
|
|
-#ifndef _GL_WARN_EXTERN_C
|
|
|
|
|
-# if defined __cplusplus
|
|
|
|
|
-# define _GL_WARN_EXTERN_C extern "C"
|
|
|
|
|
-# else
|
|
|
|
|
-# define _GL_WARN_EXTERN_C extern
|
|
|
|
|
-# endif
|
|
|
|
|
-#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Return the first instance of C within N bytes of S, or NULL. */
|
|
/* Return the first instance of C within N bytes of S, or NULL. */
|
|
|
-#if 1
|
|
|
|
|
-# if 0
|
|
|
|
|
|
|
+#if @GNULIB_MEMCHR@
|
|
|
|
|
+# if @REPLACE_MEMCHR@
|
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
|
# define memchr rpl_memchr
|
|
# define memchr rpl_memchr
|
|
|
# endif
|
|
# endif
|
|
@@ -382,7 +70,7 @@ _GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n)
|
|
|
_GL_ARG_NONNULL ((1)));
|
|
_GL_ARG_NONNULL ((1)));
|
|
|
_GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n));
|
|
_GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n));
|
|
|
# else
|
|
# else
|
|
|
-# if ! 1
|
|
|
|
|
|
|
+# if ! @HAVE_MEMCHR@
|
|
|
_GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n)
|
|
_GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n)
|
|
|
_GL_ATTRIBUTE_PURE
|
|
_GL_ATTRIBUTE_PURE
|
|
|
_GL_ARG_NONNULL ((1)));
|
|
_GL_ARG_NONNULL ((1)));
|
|
@@ -410,8 +98,8 @@ _GL_WARN_ON_USE (memchr, "memchr has platform-specific bugs - "
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
/* Return the first occurrence of NEEDLE in HAYSTACK. */
|
|
/* Return the first occurrence of NEEDLE in HAYSTACK. */
|
|
|
-#if 1
|
|
|
|
|
-# if 0
|
|
|
|
|
|
|
+#if @GNULIB_MEMMEM@
|
|
|
|
|
+# if @REPLACE_MEMMEM@
|
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
|
# define memmem rpl_memmem
|
|
# define memmem rpl_memmem
|
|
|
# endif
|
|
# endif
|
|
@@ -424,7 +112,7 @@ _GL_CXXALIAS_RPL (memmem, void *,
|
|
|
(void const *__haystack, size_t __haystack_len,
|
|
(void const *__haystack, size_t __haystack_len,
|
|
|
void const *__needle, size_t __needle_len));
|
|
void const *__needle, size_t __needle_len));
|
|
|
# else
|
|
# else
|
|
|
-# if ! 0
|
|
|
|
|
|
|
+# if ! @HAVE_DECL_MEMMEM@
|
|
|
_GL_FUNCDECL_SYS (memmem, void *,
|
|
_GL_FUNCDECL_SYS (memmem, void *,
|
|
|
(void const *__haystack, size_t __haystack_len,
|
|
(void const *__haystack, size_t __haystack_len,
|
|
|
void const *__needle, size_t __needle_len)
|
|
void const *__needle, size_t __needle_len)
|
|
@@ -447,8 +135,8 @@ _GL_WARN_ON_USE (memmem, "memmem is unportable and often quadratic - "
|
|
|
|
|
|
|
|
/* Copy N bytes of SRC to DEST, return pointer to bytes after the
|
|
/* Copy N bytes of SRC to DEST, return pointer to bytes after the
|
|
|
last written byte. */
|
|
last written byte. */
|
|
|
-#if 0
|
|
|
|
|
-# if ! 1
|
|
|
|
|
|
|
+#if @GNULIB_MEMPCPY@
|
|
|
|
|
+# if ! @HAVE_MEMPCPY@
|
|
|
_GL_FUNCDECL_SYS (mempcpy, void *,
|
|
_GL_FUNCDECL_SYS (mempcpy, void *,
|
|
|
(void *restrict __dest, void const *restrict __src,
|
|
(void *restrict __dest, void const *restrict __src,
|
|
|
size_t __n)
|
|
size_t __n)
|
|
@@ -467,8 +155,8 @@ _GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - "
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
/* Search backwards through a block for a byte (specified as an int). */
|
|
/* Search backwards through a block for a byte (specified as an int). */
|
|
|
-#if 0
|
|
|
|
|
-# if ! 1
|
|
|
|
|
|
|
+#if @GNULIB_MEMRCHR@
|
|
|
|
|
+# if ! @HAVE_DECL_MEMRCHR@
|
|
|
_GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t)
|
|
_GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t)
|
|
|
_GL_ATTRIBUTE_PURE
|
|
_GL_ATTRIBUTE_PURE
|
|
|
_GL_ARG_NONNULL ((1)));
|
|
_GL_ARG_NONNULL ((1)));
|
|
@@ -497,8 +185,8 @@ _GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
|
|
|
/* Find the first occurrence of C in S. More efficient than
|
|
/* Find the first occurrence of C in S. More efficient than
|
|
|
memchr(S,C,N), at the expense of undefined behavior if C does not
|
|
memchr(S,C,N), at the expense of undefined behavior if C does not
|
|
|
occur within N bytes. */
|
|
occur within N bytes. */
|
|
|
-#if 0
|
|
|
|
|
-# if ! 1
|
|
|
|
|
|
|
+#if @GNULIB_RAWMEMCHR@
|
|
|
|
|
+# if ! @HAVE_RAWMEMCHR@
|
|
|
_GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in)
|
|
_GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in)
|
|
|
_GL_ATTRIBUTE_PURE
|
|
_GL_ATTRIBUTE_PURE
|
|
|
_GL_ARG_NONNULL ((1)));
|
|
_GL_ARG_NONNULL ((1)));
|
|
@@ -525,8 +213,8 @@ _GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - "
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
/* Copy SRC to DST, returning the address of the terminating '\0' in DST. */
|
|
/* Copy SRC to DST, returning the address of the terminating '\0' in DST. */
|
|
|
-#if 0
|
|
|
|
|
-# if ! 1
|
|
|
|
|
|
|
+#if @GNULIB_STPCPY@
|
|
|
|
|
+# if ! @HAVE_STPCPY@
|
|
|
_GL_FUNCDECL_SYS (stpcpy, char *,
|
|
_GL_FUNCDECL_SYS (stpcpy, char *,
|
|
|
(char *restrict __dst, char const *restrict __src)
|
|
(char *restrict __dst, char const *restrict __src)
|
|
|
_GL_ARG_NONNULL ((1, 2)));
|
|
_GL_ARG_NONNULL ((1, 2)));
|
|
@@ -544,8 +232,8 @@ _GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - "
|
|
|
|
|
|
|
|
/* Copy no more than N bytes of SRC to DST, returning a pointer past the
|
|
/* Copy no more than N bytes of SRC to DST, returning a pointer past the
|
|
|
last non-NUL byte written into DST. */
|
|
last non-NUL byte written into DST. */
|
|
|
-#if 0
|
|
|
|
|
-# if 0
|
|
|
|
|
|
|
+#if @GNULIB_STPNCPY@
|
|
|
|
|
+# if @REPLACE_STPNCPY@
|
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
|
# undef stpncpy
|
|
# undef stpncpy
|
|
|
# define stpncpy rpl_stpncpy
|
|
# define stpncpy rpl_stpncpy
|
|
@@ -558,7 +246,7 @@ _GL_CXXALIAS_RPL (stpncpy, char *,
|
|
|
(char *restrict __dst, char const *restrict __src,
|
|
(char *restrict __dst, char const *restrict __src,
|
|
|
size_t __n));
|
|
size_t __n));
|
|
|
# else
|
|
# else
|
|
|
-# if ! 1
|
|
|
|
|
|
|
+# if ! @HAVE_STPNCPY@
|
|
|
_GL_FUNCDECL_SYS (stpncpy, char *,
|
|
_GL_FUNCDECL_SYS (stpncpy, char *,
|
|
|
(char *restrict __dst, char const *restrict __src,
|
|
(char *restrict __dst, char const *restrict __src,
|
|
|
size_t __n)
|
|
size_t __n)
|
|
@@ -588,8 +276,8 @@ _GL_WARN_ON_USE (strchr, "strchr cannot work correctly on character strings "
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
/* Find the first occurrence of C in S or the final NUL byte. */
|
|
/* Find the first occurrence of C in S or the final NUL byte. */
|
|
|
-#if 0
|
|
|
|
|
-# if 0
|
|
|
|
|
|
|
+#if @GNULIB_STRCHRNUL@
|
|
|
|
|
+# if @REPLACE_STRCHRNUL@
|
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
|
# define strchrnul rpl_strchrnul
|
|
# define strchrnul rpl_strchrnul
|
|
|
# endif
|
|
# endif
|
|
@@ -599,7 +287,7 @@ _GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in)
|
|
|
_GL_CXXALIAS_RPL (strchrnul, char *,
|
|
_GL_CXXALIAS_RPL (strchrnul, char *,
|
|
|
(const char *str, int ch));
|
|
(const char *str, int ch));
|
|
|
# else
|
|
# else
|
|
|
-# if ! 1
|
|
|
|
|
|
|
+# if ! @HAVE_STRCHRNUL@
|
|
|
_GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in)
|
|
_GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in)
|
|
|
_GL_ATTRIBUTE_PURE
|
|
_GL_ATTRIBUTE_PURE
|
|
|
_GL_ARG_NONNULL ((1)));
|
|
_GL_ARG_NONNULL ((1)));
|
|
@@ -627,8 +315,8 @@ _GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - "
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
/* Duplicate S, returning an identical malloc'd string. */
|
|
/* Duplicate S, returning an identical malloc'd string. */
|
|
|
-#if 0
|
|
|
|
|
-# if 0
|
|
|
|
|
|
|
+#if @GNULIB_STRDUP@
|
|
|
|
|
+# if @REPLACE_STRDUP@
|
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
|
# undef strdup
|
|
# undef strdup
|
|
|
# define strdup rpl_strdup
|
|
# define strdup rpl_strdup
|
|
@@ -640,7 +328,7 @@ _GL_CXXALIAS_RPL (strdup, char *, (char const *__s));
|
|
|
/* strdup exists as a function and as a macro. Get rid of the macro. */
|
|
/* strdup exists as a function and as a macro. Get rid of the macro. */
|
|
|
# undef strdup
|
|
# undef strdup
|
|
|
# endif
|
|
# endif
|
|
|
-# if !(1 || defined strdup)
|
|
|
|
|
|
|
+# if !(@HAVE_DECL_STRDUP@ || defined strdup)
|
|
|
_GL_FUNCDECL_SYS (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
|
|
_GL_FUNCDECL_SYS (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
|
|
|
# endif
|
|
# endif
|
|
|
_GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
|
|
_GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
|
|
@@ -655,8 +343,8 @@ _GL_WARN_ON_USE (strdup, "strdup is unportable - "
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
/* Append no more than N characters from SRC onto DEST. */
|
|
/* Append no more than N characters from SRC onto DEST. */
|
|
|
-#if 0
|
|
|
|
|
-# if 0
|
|
|
|
|
|
|
+#if @GNULIB_STRNCAT@
|
|
|
|
|
+# if @REPLACE_STRNCAT@
|
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
|
# undef strncat
|
|
# undef strncat
|
|
|
# define strncat rpl_strncat
|
|
# define strncat rpl_strncat
|
|
@@ -677,8 +365,8 @@ _GL_WARN_ON_USE (strncat, "strncat is unportable - "
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
/* Return a newly allocated copy of at most N bytes of STRING. */
|
|
/* Return a newly allocated copy of at most N bytes of STRING. */
|
|
|
-#if 0
|
|
|
|
|
-# if 0
|
|
|
|
|
|
|
+#if @GNULIB_STRNDUP@
|
|
|
|
|
+# if @REPLACE_STRNDUP@
|
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
|
# undef strndup
|
|
# undef strndup
|
|
|
# define strndup rpl_strndup
|
|
# define strndup rpl_strndup
|
|
@@ -687,7 +375,7 @@ _GL_FUNCDECL_RPL (strndup, char *, (char const *__string, size_t __n)
|
|
|
_GL_ARG_NONNULL ((1)));
|
|
_GL_ARG_NONNULL ((1)));
|
|
|
_GL_CXXALIAS_RPL (strndup, char *, (char const *__string, size_t __n));
|
|
_GL_CXXALIAS_RPL (strndup, char *, (char const *__string, size_t __n));
|
|
|
# else
|
|
# else
|
|
|
-# if ! 1
|
|
|
|
|
|
|
+# if ! @HAVE_DECL_STRNDUP@
|
|
|
_GL_FUNCDECL_SYS (strndup, char *, (char const *__string, size_t __n)
|
|
_GL_FUNCDECL_SYS (strndup, char *, (char const *__string, size_t __n)
|
|
|
_GL_ARG_NONNULL ((1)));
|
|
_GL_ARG_NONNULL ((1)));
|
|
|
# endif
|
|
# endif
|
|
@@ -705,8 +393,8 @@ _GL_WARN_ON_USE (strndup, "strndup is unportable - "
|
|
|
/* Find the length (number of bytes) of STRING, but scan at most
|
|
/* Find the length (number of bytes) of STRING, but scan at most
|
|
|
MAXLEN bytes. If no '\0' terminator is found in that many bytes,
|
|
MAXLEN bytes. If no '\0' terminator is found in that many bytes,
|
|
|
return MAXLEN. */
|
|
return MAXLEN. */
|
|
|
-#if 0
|
|
|
|
|
-# if 0
|
|
|
|
|
|
|
+#if @GNULIB_STRNLEN@
|
|
|
|
|
+# if @REPLACE_STRNLEN@
|
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
|
# undef strnlen
|
|
# undef strnlen
|
|
|
# define strnlen rpl_strnlen
|
|
# define strnlen rpl_strnlen
|
|
@@ -716,7 +404,7 @@ _GL_FUNCDECL_RPL (strnlen, size_t, (char const *__string, size_t __maxlen)
|
|
|
_GL_ARG_NONNULL ((1)));
|
|
_GL_ARG_NONNULL ((1)));
|
|
|
_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__string, size_t __maxlen));
|
|
_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__string, size_t __maxlen));
|
|
|
# else
|
|
# else
|
|
|
-# if ! 1
|
|
|
|
|
|
|
+# if ! @HAVE_DECL_STRNLEN@
|
|
|
_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__string, size_t __maxlen)
|
|
_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__string, size_t __maxlen)
|
|
|
_GL_ATTRIBUTE_PURE
|
|
_GL_ATTRIBUTE_PURE
|
|
|
_GL_ARG_NONNULL ((1)));
|
|
_GL_ARG_NONNULL ((1)));
|
|
@@ -745,8 +433,8 @@ _GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings "
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
/* Find the first occurrence in S of any character in ACCEPT. */
|
|
/* Find the first occurrence in S of any character in ACCEPT. */
|
|
|
-#if 0
|
|
|
|
|
-# if ! 1
|
|
|
|
|
|
|
+#if @GNULIB_STRPBRK@
|
|
|
|
|
+# if ! @HAVE_STRPBRK@
|
|
|
_GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept)
|
|
_GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept)
|
|
|
_GL_ATTRIBUTE_PURE
|
|
_GL_ATTRIBUTE_PURE
|
|
|
_GL_ARG_NONNULL ((1, 2)));
|
|
_GL_ARG_NONNULL ((1, 2)));
|
|
@@ -819,8 +507,8 @@ _GL_WARN_ON_USE (strrchr, "strrchr cannot work correctly on character strings "
|
|
|
characters are ASCII characters < 0x30.
|
|
characters are ASCII characters < 0x30.
|
|
|
|
|
|
|
|
See also strtok_r(). */
|
|
See also strtok_r(). */
|
|
|
-#if 0
|
|
|
|
|
-# if ! 1
|
|
|
|
|
|
|
+#if @GNULIB_STRSEP@
|
|
|
|
|
+# if ! @HAVE_STRSEP@
|
|
|
_GL_FUNCDECL_SYS (strsep, char *,
|
|
_GL_FUNCDECL_SYS (strsep, char *,
|
|
|
(char **restrict __stringp, char const *restrict __delim)
|
|
(char **restrict __stringp, char const *restrict __delim)
|
|
|
_GL_ARG_NONNULL ((1, 2)));
|
|
_GL_ARG_NONNULL ((1, 2)));
|
|
@@ -842,8 +530,8 @@ _GL_WARN_ON_USE (strsep, "strsep is unportable - "
|
|
|
# endif
|
|
# endif
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#if 0
|
|
|
|
|
-# if 0
|
|
|
|
|
|
|
+#if @GNULIB_STRSTR@
|
|
|
|
|
+# if @REPLACE_STRSTR@
|
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
|
# define strstr rpl_strstr
|
|
# define strstr rpl_strstr
|
|
|
# endif
|
|
# endif
|
|
@@ -883,8 +571,8 @@ _GL_WARN_ON_USE (strstr, "strstr is quadratic on many systems, and cannot "
|
|
|
|
|
|
|
|
/* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive
|
|
/* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive
|
|
|
comparison. */
|
|
comparison. */
|
|
|
-#if 0
|
|
|
|
|
-# if 0
|
|
|
|
|
|
|
+#if @GNULIB_STRCASESTR@
|
|
|
|
|
+# if @REPLACE_STRCASESTR@
|
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
|
# define strcasestr rpl_strcasestr
|
|
# define strcasestr rpl_strcasestr
|
|
|
# endif
|
|
# endif
|
|
@@ -895,7 +583,7 @@ _GL_FUNCDECL_RPL (strcasestr, char *,
|
|
|
_GL_CXXALIAS_RPL (strcasestr, char *,
|
|
_GL_CXXALIAS_RPL (strcasestr, char *,
|
|
|
(const char *haystack, const char *needle));
|
|
(const char *haystack, const char *needle));
|
|
|
# else
|
|
# else
|
|
|
-# if ! 1
|
|
|
|
|
|
|
+# if ! @HAVE_STRCASESTR@
|
|
|
_GL_FUNCDECL_SYS (strcasestr, char *,
|
|
_GL_FUNCDECL_SYS (strcasestr, char *,
|
|
|
(const char *haystack, const char *needle)
|
|
(const char *haystack, const char *needle)
|
|
|
_GL_ATTRIBUTE_PURE
|
|
_GL_ATTRIBUTE_PURE
|
|
@@ -952,8 +640,8 @@ _GL_WARN_ON_USE (strcasestr, "strcasestr does work correctly on character "
|
|
|
characters are ASCII characters < 0x30.
|
|
characters are ASCII characters < 0x30.
|
|
|
|
|
|
|
|
See also strsep(). */
|
|
See also strsep(). */
|
|
|
-#if 0
|
|
|
|
|
-# if 0
|
|
|
|
|
|
|
+#if @GNULIB_STRTOK_R@
|
|
|
|
|
+# if @REPLACE_STRTOK_R@
|
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
|
# undef strtok_r
|
|
# undef strtok_r
|
|
|
# define strtok_r rpl_strtok_r
|
|
# define strtok_r rpl_strtok_r
|
|
@@ -966,10 +654,10 @@ _GL_CXXALIAS_RPL (strtok_r, char *,
|
|
|
(char *restrict s, char const *restrict delim,
|
|
(char *restrict s, char const *restrict delim,
|
|
|
char **restrict save_ptr));
|
|
char **restrict save_ptr));
|
|
|
# else
|
|
# else
|
|
|
-# if 0 || defined GNULIB_POSIXCHECK
|
|
|
|
|
|
|
+# if @UNDEFINE_STRTOK_R@ || defined GNULIB_POSIXCHECK
|
|
|
# undef strtok_r
|
|
# undef strtok_r
|
|
|
# endif
|
|
# endif
|
|
|
-# if ! 1
|
|
|
|
|
|
|
+# if ! @HAVE_DECL_STRTOK_R@
|
|
|
_GL_FUNCDECL_SYS (strtok_r, char *,
|
|
_GL_FUNCDECL_SYS (strtok_r, char *,
|
|
|
(char *restrict s, char const *restrict delim,
|
|
(char *restrict s, char const *restrict delim,
|
|
|
char **restrict save_ptr)
|
|
char **restrict save_ptr)
|
|
@@ -997,13 +685,13 @@ _GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - "
|
|
|
/* The following functions are not specified by POSIX. They are gnulib
|
|
/* The following functions are not specified by POSIX. They are gnulib
|
|
|
extensions. */
|
|
extensions. */
|
|
|
|
|
|
|
|
-#if 0
|
|
|
|
|
|
|
+#if @GNULIB_MBSLEN@
|
|
|
/* Return the number of multibyte characters in the character string STRING.
|
|
/* Return the number of multibyte characters in the character string STRING.
|
|
|
This considers multibyte characters, unlike strlen, which counts bytes. */
|
|
This considers multibyte characters, unlike strlen, which counts bytes. */
|
|
|
# ifdef __MirBSD__ /* MirBSD defines mbslen as a macro. Override it. */
|
|
# ifdef __MirBSD__ /* MirBSD defines mbslen as a macro. Override it. */
|
|
|
# undef mbslen
|
|
# undef mbslen
|
|
|
# endif
|
|
# endif
|
|
|
-# if 0 /* AIX, OSF/1, MirBSD define mbslen already in libc. */
|
|
|
|
|
|
|
+# if @HAVE_MBSLEN@ /* AIX, OSF/1, MirBSD define mbslen already in libc. */
|
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
|
# define mbslen rpl_mbslen
|
|
# define mbslen rpl_mbslen
|
|
|
# endif
|
|
# endif
|
|
@@ -1016,14 +704,14 @@ _GL_CXXALIAS_SYS (mbslen, size_t, (const char *string));
|
|
|
_GL_CXXALIASWARN (mbslen);
|
|
_GL_CXXALIASWARN (mbslen);
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#if 0
|
|
|
|
|
|
|
+#if @GNULIB_MBSNLEN@
|
|
|
/* Return the number of multibyte characters in the character string starting
|
|
/* Return the number of multibyte characters in the character string starting
|
|
|
at STRING and ending at STRING + LEN. */
|
|
at STRING and ending at STRING + LEN. */
|
|
|
_GL_EXTERN_C size_t mbsnlen (const char *string, size_t len)
|
|
_GL_EXTERN_C size_t mbsnlen (const char *string, size_t len)
|
|
|
_GL_ARG_NONNULL ((1));
|
|
_GL_ARG_NONNULL ((1));
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#if 0
|
|
|
|
|
|
|
+#if @GNULIB_MBSCHR@
|
|
|
/* Locate the first single-byte character C in the character string STRING,
|
|
/* Locate the first single-byte character C in the character string STRING,
|
|
|
and return a pointer to it. Return NULL if C is not found in STRING.
|
|
and return a pointer to it. Return NULL if C is not found in STRING.
|
|
|
Unlike strchr(), this function works correctly in multibyte locales with
|
|
Unlike strchr(), this function works correctly in multibyte locales with
|
|
@@ -1043,7 +731,7 @@ _GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c));
|
|
|
_GL_CXXALIASWARN (mbschr);
|
|
_GL_CXXALIASWARN (mbschr);
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#if 0
|
|
|
|
|
|
|
+#if @GNULIB_MBSRCHR@
|
|
|
/* Locate the last single-byte character C in the character string STRING,
|
|
/* Locate the last single-byte character C in the character string STRING,
|
|
|
and return a pointer to it. Return NULL if C is not found in STRING.
|
|
and return a pointer to it. Return NULL if C is not found in STRING.
|
|
|
Unlike strrchr(), this function works correctly in multibyte locales with
|
|
Unlike strrchr(), this function works correctly in multibyte locales with
|
|
@@ -1063,7 +751,7 @@ _GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c));
|
|
|
_GL_CXXALIASWARN (mbsrchr);
|
|
_GL_CXXALIASWARN (mbsrchr);
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#if 0
|
|
|
|
|
|
|
+#if @GNULIB_MBSSTR@
|
|
|
/* Find the first occurrence of the character string NEEDLE in the character
|
|
/* Find the first occurrence of the character string NEEDLE in the character
|
|
|
string HAYSTACK. Return NULL if NEEDLE is not found in HAYSTACK.
|
|
string HAYSTACK. Return NULL if NEEDLE is not found in HAYSTACK.
|
|
|
Unlike strstr(), this function works correctly in multibyte locales with
|
|
Unlike strstr(), this function works correctly in multibyte locales with
|
|
@@ -1072,7 +760,7 @@ _GL_EXTERN_C char * mbsstr (const char *haystack, const char *needle)
|
|
|
_GL_ARG_NONNULL ((1, 2));
|
|
_GL_ARG_NONNULL ((1, 2));
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#if 0
|
|
|
|
|
|
|
+#if @GNULIB_MBSCASECMP@
|
|
|
/* Compare the character strings S1 and S2, ignoring case, returning less than,
|
|
/* Compare the character strings S1 and S2, ignoring case, returning less than,
|
|
|
equal to or greater than zero if S1 is lexicographically less than, equal to
|
|
equal to or greater than zero if S1 is lexicographically less than, equal to
|
|
|
or greater than S2.
|
|
or greater than S2.
|
|
@@ -1083,7 +771,7 @@ _GL_EXTERN_C int mbscasecmp (const char *s1, const char *s2)
|
|
|
_GL_ARG_NONNULL ((1, 2));
|
|
_GL_ARG_NONNULL ((1, 2));
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#if 0
|
|
|
|
|
|
|
+#if @GNULIB_MBSNCASECMP@
|
|
|
/* Compare the initial segment of the character string S1 consisting of at most
|
|
/* Compare the initial segment of the character string S1 consisting of at most
|
|
|
N characters with the initial segment of the character string S2 consisting
|
|
N characters with the initial segment of the character string S2 consisting
|
|
|
of at most N characters, ignoring case, returning less than, equal to or
|
|
of at most N characters, ignoring case, returning less than, equal to or
|
|
@@ -1097,7 +785,7 @@ _GL_EXTERN_C int mbsncasecmp (const char *s1, const char *s2, size_t n)
|
|
|
_GL_ARG_NONNULL ((1, 2));
|
|
_GL_ARG_NONNULL ((1, 2));
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#if 0
|
|
|
|
|
|
|
+#if @GNULIB_MBSPCASECMP@
|
|
|
/* Compare the initial segment of the character string STRING consisting of
|
|
/* Compare the initial segment of the character string STRING consisting of
|
|
|
at most mbslen (PREFIX) characters with the character string PREFIX,
|
|
at most mbslen (PREFIX) characters with the character string PREFIX,
|
|
|
ignoring case. If the two match, return a pointer to the first byte
|
|
ignoring case. If the two match, return a pointer to the first byte
|
|
@@ -1110,7 +798,7 @@ _GL_EXTERN_C char * mbspcasecmp (const char *string, const char *prefix)
|
|
|
_GL_ARG_NONNULL ((1, 2));
|
|
_GL_ARG_NONNULL ((1, 2));
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#if 0
|
|
|
|
|
|
|
+#if @GNULIB_MBSCASESTR@
|
|
|
/* Find the first occurrence of the character string NEEDLE in the character
|
|
/* Find the first occurrence of the character string NEEDLE in the character
|
|
|
string HAYSTACK, using case-insensitive comparison.
|
|
string HAYSTACK, using case-insensitive comparison.
|
|
|
Note: This function may, in multibyte locales, return success even if
|
|
Note: This function may, in multibyte locales, return success even if
|
|
@@ -1120,7 +808,7 @@ _GL_EXTERN_C char * mbscasestr (const char *haystack, const char *needle)
|
|
|
_GL_ARG_NONNULL ((1, 2));
|
|
_GL_ARG_NONNULL ((1, 2));
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#if 0
|
|
|
|
|
|
|
+#if @GNULIB_MBSCSPN@
|
|
|
/* Find the first occurrence in the character string STRING of any character
|
|
/* Find the first occurrence in the character string STRING of any character
|
|
|
in the character string ACCEPT. Return the number of bytes from the
|
|
in the character string ACCEPT. Return the number of bytes from the
|
|
|
beginning of the string to this occurrence, or to the end of the string
|
|
beginning of the string to this occurrence, or to the end of the string
|
|
@@ -1130,7 +818,7 @@ _GL_EXTERN_C size_t mbscspn (const char *string, const char *accept)
|
|
|
_GL_ARG_NONNULL ((1, 2));
|
|
_GL_ARG_NONNULL ((1, 2));
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#if 0
|
|
|
|
|
|
|
+#if @GNULIB_MBSPBRK@
|
|
|
/* Find the first occurrence in the character string STRING of any character
|
|
/* Find the first occurrence in the character string STRING of any character
|
|
|
in the character string ACCEPT. Return the pointer to it, or NULL if none
|
|
in the character string ACCEPT. Return the pointer to it, or NULL if none
|
|
|
exists.
|
|
exists.
|
|
@@ -1150,7 +838,7 @@ _GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept));
|
|
|
_GL_CXXALIASWARN (mbspbrk);
|
|
_GL_CXXALIASWARN (mbspbrk);
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#if 0
|
|
|
|
|
|
|
+#if @GNULIB_MBSSPN@
|
|
|
/* Find the first occurrence in the character string STRING of any character
|
|
/* Find the first occurrence in the character string STRING of any character
|
|
|
not in the character string REJECT. Return the number of bytes from the
|
|
not in the character string REJECT. Return the number of bytes from the
|
|
|
beginning of the string to this occurrence, or to the end of the string
|
|
beginning of the string to this occurrence, or to the end of the string
|
|
@@ -1160,7 +848,7 @@ _GL_EXTERN_C size_t mbsspn (const char *string, const char *reject)
|
|
|
_GL_ARG_NONNULL ((1, 2));
|
|
_GL_ARG_NONNULL ((1, 2));
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#if 0
|
|
|
|
|
|
|
+#if @GNULIB_MBSSEP@
|
|
|
/* Search the next delimiter (multibyte character listed in the character
|
|
/* Search the next delimiter (multibyte character listed in the character
|
|
|
string DELIM) starting at the character string *STRINGP.
|
|
string DELIM) starting at the character string *STRINGP.
|
|
|
If one is found, overwrite it with a NUL, and advance *STRINGP to point
|
|
If one is found, overwrite it with a NUL, and advance *STRINGP to point
|
|
@@ -1179,7 +867,7 @@ _GL_EXTERN_C char * mbssep (char **stringp, const char *delim)
|
|
|
_GL_ARG_NONNULL ((1, 2));
|
|
_GL_ARG_NONNULL ((1, 2));
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#if 0
|
|
|
|
|
|
|
+#if @GNULIB_MBSTOK_R@
|
|
|
/* Parse the character string STRING into tokens separated by characters in
|
|
/* Parse the character string STRING into tokens separated by characters in
|
|
|
the character string DELIM.
|
|
the character string DELIM.
|
|
|
If STRING is NULL, the saved pointer in SAVE_PTR is used as
|
|
If STRING is NULL, the saved pointer in SAVE_PTR is used as
|
|
@@ -1201,8 +889,8 @@ _GL_EXTERN_C char * mbstok_r (char *string, const char *delim, char **save_ptr)
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
/* Map any int, typically from errno, into an error message. */
|
|
/* Map any int, typically from errno, into an error message. */
|
|
|
-#if 0
|
|
|
|
|
-# if 0
|
|
|
|
|
|
|
+#if @GNULIB_STRERROR@
|
|
|
|
|
+# if @REPLACE_STRERROR@
|
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
|
# undef strerror
|
|
# undef strerror
|
|
|
# define strerror rpl_strerror
|
|
# define strerror rpl_strerror
|
|
@@ -1222,8 +910,8 @@ _GL_WARN_ON_USE (strerror, "strerror is unportable - "
|
|
|
|
|
|
|
|
/* Map any int, typically from errno, into an error message. Multithread-safe.
|
|
/* Map any int, typically from errno, into an error message. Multithread-safe.
|
|
|
Uses the POSIX declaration, not the glibc declaration. */
|
|
Uses the POSIX declaration, not the glibc declaration. */
|
|
|
-#if 0
|
|
|
|
|
-# if 0
|
|
|
|
|
|
|
+#if @GNULIB_STRERROR_R@
|
|
|
|
|
+# if @REPLACE_STRERROR_R@
|
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
|
# undef strerror_r
|
|
# undef strerror_r
|
|
|
# define strerror_r rpl_strerror_r
|
|
# define strerror_r rpl_strerror_r
|
|
@@ -1232,13 +920,13 @@ _GL_FUNCDECL_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen)
|
|
|
_GL_ARG_NONNULL ((2)));
|
|
_GL_ARG_NONNULL ((2)));
|
|
|
_GL_CXXALIAS_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen));
|
|
_GL_CXXALIAS_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen));
|
|
|
# else
|
|
# else
|
|
|
-# if !1
|
|
|
|
|
|
|
+# if !@HAVE_DECL_STRERROR_R@
|
|
|
_GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen)
|
|
_GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen)
|
|
|
_GL_ARG_NONNULL ((2)));
|
|
_GL_ARG_NONNULL ((2)));
|
|
|
# endif
|
|
# endif
|
|
|
_GL_CXXALIAS_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen));
|
|
_GL_CXXALIAS_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen));
|
|
|
# endif
|
|
# endif
|
|
|
-# if 1
|
|
|
|
|
|
|
+# if @HAVE_DECL_STRERROR_R@
|
|
|
_GL_CXXALIASWARN (strerror_r);
|
|
_GL_CXXALIASWARN (strerror_r);
|
|
|
# endif
|
|
# endif
|
|
|
#elif defined GNULIB_POSIXCHECK
|
|
#elif defined GNULIB_POSIXCHECK
|
|
@@ -1249,15 +937,15 @@ _GL_WARN_ON_USE (strerror_r, "strerror_r is unportable - "
|
|
|
# endif
|
|
# endif
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#if 0
|
|
|
|
|
-# if 0
|
|
|
|
|
|
|
+#if @GNULIB_STRSIGNAL@
|
|
|
|
|
+# if @REPLACE_STRSIGNAL@
|
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
|
# define strsignal rpl_strsignal
|
|
# define strsignal rpl_strsignal
|
|
|
# endif
|
|
# endif
|
|
|
_GL_FUNCDECL_RPL (strsignal, char *, (int __sig));
|
|
_GL_FUNCDECL_RPL (strsignal, char *, (int __sig));
|
|
|
_GL_CXXALIAS_RPL (strsignal, char *, (int __sig));
|
|
_GL_CXXALIAS_RPL (strsignal, char *, (int __sig));
|
|
|
# else
|
|
# else
|
|
|
-# if ! 1
|
|
|
|
|
|
|
+# if ! @HAVE_DECL_STRSIGNAL@
|
|
|
_GL_FUNCDECL_SYS (strsignal, char *, (int __sig));
|
|
_GL_FUNCDECL_SYS (strsignal, char *, (int __sig));
|
|
|
# endif
|
|
# endif
|
|
|
/* Need to cast, because on Cygwin 1.5.x systems, the return type is
|
|
/* Need to cast, because on Cygwin 1.5.x systems, the return type is
|
|
@@ -1273,8 +961,8 @@ _GL_WARN_ON_USE (strsignal, "strsignal is unportable - "
|
|
|
# endif
|
|
# endif
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#if 0
|
|
|
|
|
-# if !1
|
|
|
|
|
|
|
+#if @GNULIB_STRVERSCMP@
|
|
|
|
|
+# if !@HAVE_STRVERSCMP@
|
|
|
_GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *)
|
|
_GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *)
|
|
|
_GL_ARG_NONNULL ((1, 2)));
|
|
_GL_ARG_NONNULL ((1, 2)));
|
|
|
# endif
|
|
# endif
|
|
@@ -1289,5 +977,5 @@ _GL_WARN_ON_USE (strverscmp, "strverscmp is unportable - "
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
-#endif /* _GL_STRING_H */
|
|
|
|
|
-#endif /* _GL_STRING_H */
|
|
|
|
|
|
|
+#endif /* _@GUARD_PREFIX@_STRING_H */
|
|
|
|
|
+#endif /* _@GUARD_PREFIX@_STRING_H */
|