1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Update Gnulib; use the `func' module.

Update Gnulib to v0.0-3575-g128e4b8.

* m4/gnulib-cache.m4: Add `func'.
This commit is contained in:
Ludovic Courtès 2010-03-18 20:34:01 +01:00
parent 54eb59cf49
commit f4c79b3c08
31 changed files with 3025 additions and 1026 deletions

233
build-aux/c++defs.h Normal file
View file

@ -0,0 +1,233 @@
/* C++ compatible function declaration macros.
Copyright (C) 2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#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_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)
# define _GL_CXXALIASWARN_2(func,namespace) \
_GL_WARN_ON_USE (func, \
"The symbol ::" #func " refers to the system function. " \
"Use " #namespace "::" #func " instead.")
#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)
# 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.")
#else
# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
_GL_EXTERN_C int _gl_cxxalias_dummy
#endif
#endif /* _GL_CXXDEFS_H */

View file

@ -2,7 +2,7 @@
# List version-controlled file names. # List version-controlled file names.
# Print a version string. # Print a version string.
scriptversion=2009-07-21.16; # UTC scriptversion=2010-02-21.13; # UTC
# Copyright (C) 2006-2010 Free Software Foundation, Inc. # Copyright (C) 2006-2010 Free Software Foundation, Inc.
@ -85,7 +85,7 @@ elif test -d .hg; then
eval exec hg locate '"$dir/*"' $postprocess eval exec hg locate '"$dir/*"' $postprocess
elif test -d .bzr; then elif test -d .bzr; then
test "$postprocess" = '' && postprocess="| sed 's|^\./||'" test "$postprocess" = '' && postprocess="| sed 's|^\./||'"
eval exec bzr ls --versioned '"$dir"' $postprocess eval exec bzr ls -R --versioned '"$dir"' $postprocess
elif test -d CVS; then elif test -d CVS; then
test "$postprocess" = '' && postprocess="| sed 's|^\./||'" test "$postprocess" = '' && postprocess="| sed 's|^\./||'"
if test -x build-aux/cvsu; then if test -x build-aux/cvsu; then

View file

@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* _GL_WARN_ON_USE(function, "literal string") issues a declaration /* _GL_WARN_ON_USE (function, "literal string") issues a declaration
for FUNCTION which will then trigger a compiler warning containing for FUNCTION which will then trigger a compiler warning containing
the text of "literal string" anywhere that function is called, if the text of "literal string" anywhere that function is called, if
supported by the compiler. If the compiler does not support this supported by the compiler. If the compiler does not support this
@ -73,3 +73,20 @@ extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
extern int _gl_warn_on_use extern int _gl_warn_on_use
# endif # endif
#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)))
# else /* Unsupported. */
# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
extern int _gl_warn_on_use
# endif
#endif

View file

@ -9,7 +9,7 @@
# the same distribution terms as the rest of that program. # the same distribution terms as the rest of that program.
# #
# Generated by gnulib-tool. # Generated by gnulib-tool.
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --libtool --macro-prefix=gl --no-vc-files alignof alloca-opt announce-gen autobuild byteswap canonicalize-lgpl duplocale environ extensions flock fpieee full-read full-write gendocs getaddrinfo gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton lib-symbol-versions lib-symbol-visibility libunistring locale maintainer-makefile putenv stdlib strcase strftime striconveh string sys_stat verify version-etc-fsf vsnprintf warnings # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --libtool --macro-prefix=gl --no-vc-files alignof alloca-opt announce-gen autobuild byteswap canonicalize-lgpl duplocale environ extensions flock fpieee full-read full-write func gendocs getaddrinfo gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton lib-symbol-versions lib-symbol-visibility libunistring locale maintainer-makefile putenv stdlib strcase strftime striconveh string sys_stat verify version-etc-fsf vsnprintf warnings
AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects
@ -141,6 +141,30 @@ EXTRA_DIST += byteswap.in.h
## end gnulib module byteswap ## end gnulib module byteswap
## begin gnulib module c++defs
# The BUILT_SOURCES created by this Makefile snippet are not used via #include
# statements but through direct file reference. Therefore this snippet must be
# present in all Makefile.am that need it. This is ensured by the applicability
# 'all' defined above.
BUILT_SOURCES += c++defs.h
# The c++defs.h that gets inserted into generated .h files is the same as
# build-aux/c++defs.h, except that it has the copyright header cut off.
c++defs.h: $(top_srcdir)/build-aux/c++defs.h
$(AM_V_GEN)rm -f $@-t $@ && \
sed -n -e '/_GL_CXXDEFS/,$$p' \
< $(top_srcdir)/build-aux/c++defs.h \
> $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += c++defs.h c++defs.h-t
CXXDEFS_H=c++defs.h
EXTRA_DIST += $(top_srcdir)/build-aux/c++defs.h
## end gnulib module c++defs
## begin gnulib module c-ctype ## begin gnulib module c-ctype
libgnu_la_SOURCES += c-ctype.h c-ctype.c libgnu_la_SOURCES += c-ctype.h c-ctype.c
@ -374,13 +398,13 @@ EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath
## end gnulib module havelib ## end gnulib module havelib
## begin gnulib module iconv_open ## begin gnulib module iconv-h
BUILT_SOURCES += $(ICONV_H) BUILT_SOURCES += $(ICONV_H)
# We need the following in order to create <iconv.h> when the system # We need the following in order to create <iconv.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
iconv.h: iconv.in.h $(ARG_NONNULL_H) iconv.h: iconv.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@ -390,12 +414,20 @@ iconv.h: iconv.in.h $(ARG_NONNULL_H)
-e 's|@''REPLACE_ICONV''@|$(REPLACE_ICONV)|g' \ -e 's|@''REPLACE_ICONV''@|$(REPLACE_ICONV)|g' \
-e 's|@''REPLACE_ICONV_OPEN''@|$(REPLACE_ICONV_OPEN)|g' \ -e 's|@''REPLACE_ICONV_OPEN''@|$(REPLACE_ICONV_OPEN)|g' \
-e 's|@''REPLACE_ICONV_UTF''@|$(REPLACE_ICONV_UTF)|g' \ -e 's|@''REPLACE_ICONV_UTF''@|$(REPLACE_ICONV_UTF)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/iconv.in.h; \ < $(srcdir)/iconv.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@
MOSTLYCLEANFILES += iconv.h iconv.h-t MOSTLYCLEANFILES += iconv.h iconv.h-t
EXTRA_DIST += iconv.in.h
## end gnulib module iconv-h
## begin gnulib module iconv_open
iconv_open-aix.h: iconv_open-aix.gperf iconv_open-aix.h: iconv_open-aix.gperf
$(GPERF) -m 10 $(srcdir)/iconv_open-aix.gperf > $(srcdir)/iconv_open-aix.h-t $(GPERF) -m 10 $(srcdir)/iconv_open-aix.gperf > $(srcdir)/iconv_open-aix.h-t
mv $(srcdir)/iconv_open-aix.h-t $(srcdir)/iconv_open-aix.h mv $(srcdir)/iconv_open-aix.h-t $(srcdir)/iconv_open-aix.h
@ -416,7 +448,7 @@ MOSTLYCLEANFILES += iconv_open-aix.h-t iconv_open-hpux.h-t iconv_open-irix.h
MAINTAINERCLEANFILES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h MAINTAINERCLEANFILES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h
EXTRA_DIST += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h EXTRA_DIST += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h
EXTRA_DIST += iconv.in.h iconv_open-aix.gperf iconv_open-hpux.gperf iconv_open-irix.gperf iconv_open-osf.gperf iconv_open-solaris.gperf iconv_open.c EXTRA_DIST += iconv_open-aix.gperf iconv_open-hpux.gperf iconv_open-irix.gperf iconv_open-osf.gperf iconv_open-solaris.gperf iconv_open.c
EXTRA_libgnu_la_SOURCES += iconv_open.c EXTRA_libgnu_la_SOURCES += iconv_open.c
@ -539,15 +571,17 @@ BUILT_SOURCES += locale.h
# We need the following in order to create <locale.h> when the system # We need the following in order to create <locale.h> when the system
# doesn't have one that provides all definitions. # doesn't have one that provides all definitions.
locale.h: locale.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H) locale.h: locale.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_LOCALE_H''@|$(NEXT_LOCALE_H)|g' \ -e 's|@''NEXT_LOCALE_H''@|$(NEXT_LOCALE_H)|g' \
-e 's|@''GNULIB_DUPLOCALE''@|$(GNULIB_DUPLOCALE)|g' \ -e 's|@''GNULIB_DUPLOCALE''@|$(GNULIB_DUPLOCALE)|g' \
-e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|g' \
-e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \ -e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \
-e 's|@''REPLACE_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \ -e 's|@''REPLACE_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/locale.in.h; \ < $(srcdir)/locale.in.h; \
@ -857,7 +891,7 @@ BUILT_SOURCES += stdio.h
# We need the following in order to create <stdio.h> when the system # We need the following in order to create <stdio.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
stdio.h: stdio.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H) stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@ -943,6 +977,7 @@ stdio.h: stdio.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
-e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \ -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
-e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \ -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
-e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \ -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
} > $@-t && \ } > $@-t && \
@ -961,7 +996,7 @@ BUILT_SOURCES += stdlib.h
# We need the following in order to create <stdlib.h> when the system # We need the following in order to create <stdlib.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
stdlib.h: stdlib.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H) stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@ -1017,6 +1052,7 @@ stdlib.h: stdlib.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
-e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
-e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
-e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/stdlib.in.h; \ < $(srcdir)/stdlib.in.h; \
@ -1070,7 +1106,7 @@ BUILT_SOURCES += string.h
# We need the following in order to create <string.h> when the system # We need the following in order to create <string.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
string.h: string.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H) string.h: string.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@ -1138,6 +1174,7 @@ string.h: string.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
-e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
-e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \ -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
-e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \ -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
< $(srcdir)/string.in.h; \ < $(srcdir)/string.in.h; \
@ -1207,7 +1244,7 @@ BUILT_SOURCES += sys/socket.h
# We need the following in order to create <sys/socket.h> when the system # We need the following in order to create <sys/socket.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
sys/socket.h: sys_socket.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H) sys/socket.h: sys_socket.in.h $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
$(AM_V_at)$(MKDIR_P) sys $(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
@ -1236,6 +1273,7 @@ sys/socket.h: sys_socket.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
-e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \ -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \
-e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \ -e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \
-e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \ -e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/sys_socket.in.h; \ < $(srcdir)/sys_socket.in.h; \
@ -1254,7 +1292,7 @@ BUILT_SOURCES += sys/stat.h
# We need the following in order to create <sys/stat.h> when the system # We need the following in order to create <sys/stat.h> when the system
# has one that is incomplete. # has one that is incomplete.
sys/stat.h: sys_stat.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H) sys/stat.h: sys_stat.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_at)$(MKDIR_P) sys $(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
@ -1293,6 +1331,7 @@ sys/stat.h: sys_stat.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
-e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \ -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \
-e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \ -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \
-e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \ -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/sys_stat.in.h; \ < $(srcdir)/sys_stat.in.h; \
@ -1311,20 +1350,27 @@ BUILT_SOURCES += time.h
# We need the following in order to create <time.h> when the system # We need the following in order to create <time.h> when the system
# doesn't have one that works with the given compiler. # doesn't have one that works with the given compiler.
time.h: time.in.h $(ARG_NONNULL_H) time.h: time.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \ -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
-e 's|@REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ -e 's|@''GNULIB_MKTIME''@|$(GNULIB_MKTIME)|g' \
-e 's|@REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \ -e 's|@''GNULIB_NANOSLEEP''@|$(GNULIB_NANOSLEEP)|g' \
-e 's|@REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ -e 's|@''GNULIB_STRPTIME''@|$(GNULIB_STRPTIME)|g' \
-e 's|@REPLACE_STRPTIME''@|$(REPLACE_STRPTIME)|g' \ -e 's|@''GNULIB_TIMEGM''@|$(GNULIB_TIMEGM)|g' \
-e 's|@REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \ -e 's|@''GNULIB_TIME_R''@|$(GNULIB_TIME_R)|g' \
-e 's|@SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
-e 's|@TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
-e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
-e 's|@''REPLACE_STRPTIME''@|$(REPLACE_STRPTIME)|g' \
-e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
-e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/time.in.h; \ < $(srcdir)/time.in.h; \
} > $@-t && \ } > $@-t && \
mv $@-t $@ mv $@-t $@
@ -1349,7 +1395,7 @@ BUILT_SOURCES += unistd.h
# We need the following in order to create an empty placeholder for # We need the following in order to create an empty placeholder for
# <unistd.h> when the system doesn't have one. # <unistd.h> when the system doesn't have one.
unistd.h: unistd.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H) unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
@ -1450,6 +1496,7 @@ unistd.h: unistd.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
-e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \ -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
-e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
-e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
} > $@-t && \ } > $@-t && \
@ -1604,7 +1651,7 @@ BUILT_SOURCES += wchar.h
# We need the following in order to create <wchar.h> when the system # We need the following in order to create <wchar.h> when the system
# version does not work standalone. # version does not work standalone.
wchar.h: wchar.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H) wchar.h: wchar.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \ $(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@ -1646,6 +1693,7 @@ wchar.h: wchar.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
-e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \ -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
-e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \ -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
-e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/wchar.in.h; \ < $(srcdir)/wchar.in.h; \

View file

@ -28,20 +28,29 @@
#ifndef _GL_ICONV_H #ifndef _GL_ICONV_H
#define _GL_ICONV_H #define _GL_ICONV_H
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */ /* The definition of _GL_ARG_NONNULL is copied here. */
#ifdef __cplusplus /* The definition of _GL_WARN_ON_USE is copied here. */
extern "C" {
#endif
#if @REPLACE_ICONV_OPEN@ #if @REPLACE_ICONV_OPEN@
/* An iconv_open wrapper that supports the IANA standardized encoding names /* An iconv_open wrapper that supports the IANA standardized encoding names
("ISO-8859-1" etc.) as far as possible. */ ("ISO-8859-1" etc.) as far as possible. */
# define iconv_open rpl_iconv_open # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
extern iconv_t iconv_open (const char *tocode, const char *fromcode) # define iconv_open rpl_iconv_open
_GL_ARG_NONNULL ((1, 2)); # endif
_GL_FUNCDECL_RPL (iconv_open, iconv_t,
(const char *tocode, const char *fromcode)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (iconv_open, iconv_t,
(const char *tocode, const char *fromcode));
#else
_GL_CXXALIAS_SYS (iconv_open, iconv_t,
(const char *tocode, const char *fromcode));
#endif #endif
_GL_CXXALIASWARN (iconv_open);
#if @REPLACE_ICONV_UTF@ #if @REPLACE_ICONV_UTF@
/* Special constants for supporting UTF-{16,32}{BE,LE} encodings. /* Special constants for supporting UTF-{16,32}{BE,LE} encodings.
@ -57,18 +66,36 @@ extern iconv_t iconv_open (const char *tocode, const char *fromcode)
#endif #endif
#if @REPLACE_ICONV@ #if @REPLACE_ICONV@
# define iconv rpl_iconv # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
extern size_t iconv (iconv_t cd, # define iconv rpl_iconv
@ICONV_CONST@ char **inbuf, size_t *inbytesleft, # endif
char **outbuf, size_t *outbytesleft); _GL_FUNCDECL_RPL (iconv, size_t,
# define iconv_close rpl_iconv_close (iconv_t cd,
extern int iconv_close (iconv_t cd); @ICONV_CONST@ char **inbuf, size_t *inbytesleft,
char **outbuf, size_t *outbytesleft));
_GL_CXXALIAS_RPL (iconv, size_t,
(iconv_t cd,
@ICONV_CONST@ char **inbuf, size_t *inbytesleft,
char **outbuf, size_t *outbytesleft));
#else
_GL_CXXALIAS_SYS (iconv, size_t,
(iconv_t cd,
@ICONV_CONST@ char **inbuf, size_t *inbytesleft,
char **outbuf, size_t *outbytesleft));
#endif #endif
_GL_CXXALIASWARN (iconv);
#if @REPLACE_ICONV@
#ifdef __cplusplus # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
} # define iconv_close rpl_iconv_close
# endif
_GL_FUNCDECL_RPL (iconv_close, int, (iconv_t cd));
_GL_CXXALIAS_RPL (iconv_close, int, (iconv_t cd));
#else
_GL_CXXALIAS_SYS (iconv_close, int, (iconv_t cd));
#endif #endif
_GL_CXXALIASWARN (iconv_close);
#endif /* _GL_ICONV_H */ #endif /* _GL_ICONV_H */
#endif /* _GL_ICONV_H */ #endif /* _GL_ICONV_H */

View file

@ -34,6 +34,8 @@
# include <xlocale.h> # include <xlocale.h>
#endif #endif
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */ /* The definition of _GL_ARG_NONNULL is copied here. */
/* The definition of _GL_WARN_ON_USE is copied here. */ /* The definition of _GL_WARN_ON_USE is copied here. */
@ -46,10 +48,18 @@
#if @GNULIB_DUPLOCALE@ #if @GNULIB_DUPLOCALE@
# if @REPLACE_DUPLOCALE@ # if @REPLACE_DUPLOCALE@
# undef duplocale # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define duplocale rpl_duplocale # undef duplocale
extern locale_t duplocale (locale_t locale) _GL_ARG_NONNULL ((1)); # define duplocale rpl_duplocale
# endif
_GL_FUNCDECL_RPL (duplocale, locale_t, (locale_t locale) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (duplocale, locale_t, (locale_t locale));
# else
# if @HAVE_DUPLOCALE@
_GL_CXXALIAS_SYS (duplocale, locale_t, (locale_t locale));
# endif
# endif # endif
_GL_CXXALIASWARN (duplocale);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef duplocale # undef duplocale
# if HAVE_RAW_DECL_DUPLOCALE # if HAVE_RAW_DECL_DUPLOCALE

File diff suppressed because it is too large Load diff

View file

@ -74,6 +74,8 @@ struct random_data
# include <unistd.h> # include <unistd.h>
#endif #endif
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */ /* The definition of _GL_ARG_NONNULL is copied here. */
/* The definition of _GL_WARN_ON_USE is copied here. */ /* The definition of _GL_WARN_ON_USE is copied here. */
@ -93,16 +95,14 @@ struct random_data
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
#if @GNULIB_ATOLL@ #if @GNULIB_ATOLL@
# if !@HAVE_ATOLL@
/* Parse a signed decimal integer. /* Parse a signed decimal integer.
Returns the value of the integer. Errors are not detected. */ Returns the value of the integer. Errors are not detected. */
extern long long atoll (const char *string) _GL_ARG_NONNULL ((1)); # if !@HAVE_ATOLL@
_GL_FUNCDECL_SYS (atoll, long long, (const char *string) _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (atoll, long long, (const char *string));
_GL_CXXALIASWARN (atoll);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef atoll # undef atoll
# if HAVE_RAW_DECL_ATOLL # if HAVE_RAW_DECL_ATOLL
@ -113,10 +113,16 @@ _GL_WARN_ON_USE (atoll, "atoll is unportable - "
#if @GNULIB_CALLOC_POSIX@ #if @GNULIB_CALLOC_POSIX@
# if !@HAVE_CALLOC_POSIX@ # if !@HAVE_CALLOC_POSIX@
# undef calloc # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define calloc rpl_calloc # undef calloc
extern void * calloc (size_t nmemb, size_t size); # define calloc rpl_calloc
# endif
_GL_FUNCDECL_RPL (calloc, void *, (size_t nmemb, size_t size));
_GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
# else
_GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
# endif # endif
_GL_CXXALIASWARN (calloc);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef calloc # undef calloc
/* Assume calloc is always declared. */ /* Assume calloc is always declared. */
@ -126,11 +132,20 @@ _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
#if @GNULIB_CANONICALIZE_FILE_NAME@ #if @GNULIB_CANONICALIZE_FILE_NAME@
# if @REPLACE_CANONICALIZE_FILE_NAME@ # if @REPLACE_CANONICALIZE_FILE_NAME@
# define canonicalize_file_name rpl_canonicalize_file_name # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# endif # define canonicalize_file_name rpl_canonicalize_file_name
# if !@HAVE_CANONICALIZE_FILE_NAME@ || @REPLACE_CANONICALIZE_FILE_NAME@ # endif
extern char *canonicalize_file_name (const char *name) _GL_ARG_NONNULL ((1)); _GL_FUNCDECL_RPL (canonicalize_file_name, char *, (const char *name)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
# else
# if !@HAVE_CANONICALIZE_FILE_NAME@
_GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name)
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
# endif # endif
_GL_CXXALIASWARN (canonicalize_file_name);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef canonicalize_file_name # undef canonicalize_file_name
# if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME # if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
@ -140,13 +155,16 @@ _GL_WARN_ON_USE (canonicalize_file_name, "canonicalize_file_name is unportable -
#endif #endif
#if @GNULIB_GETLOADAVG@ #if @GNULIB_GETLOADAVG@
# if !@HAVE_DECL_GETLOADAVG@
/* Store max(NELEM,3) load average numbers in LOADAVG[]. /* Store max(NELEM,3) load average numbers in LOADAVG[].
The three numbers are the load average of the last 1 minute, the last 5 The three numbers are the load average of the last 1 minute, the last 5
minutes, and the last 15 minutes, respectively. minutes, and the last 15 minutes, respectively.
LOADAVG is an array of NELEM numbers. */ LOADAVG is an array of NELEM numbers. */
extern int getloadavg (double loadavg[], int nelem) _GL_ARG_NONNULL ((1)); # if !@HAVE_DECL_GETLOADAVG@
_GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem)
_GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
_GL_CXXALIASWARN (getloadavg);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef getloadavg # undef getloadavg
# if HAVE_RAW_DECL_GETLOADAVG # if HAVE_RAW_DECL_GETLOADAVG
@ -168,9 +186,13 @@ _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
For more details see the POSIX:2001 specification. For more details see the POSIX:2001 specification.
http://www.opengroup.org/susv3xsh/getsubopt.html */ http://www.opengroup.org/susv3xsh/getsubopt.html */
# if !@HAVE_GETSUBOPT@ # if !@HAVE_GETSUBOPT@
extern int getsubopt (char **optionp, char *const *tokens, char **valuep) _GL_FUNCDECL_SYS (getsubopt, int,
_GL_ARG_NONNULL ((1, 2, 3)); (char **optionp, char *const *tokens, char **valuep)
_GL_ARG_NONNULL ((1, 2, 3)));
# endif # endif
_GL_CXXALIAS_SYS (getsubopt, int,
(char **optionp, char *const *tokens, char **valuep));
_GL_CXXALIASWARN (getsubopt);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef getsubopt # undef getsubopt
# if HAVE_RAW_DECL_GETSUBOPT # if HAVE_RAW_DECL_GETSUBOPT
@ -181,10 +203,16 @@ _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
#if @GNULIB_MALLOC_POSIX@ #if @GNULIB_MALLOC_POSIX@
# if !@HAVE_MALLOC_POSIX@ # if !@HAVE_MALLOC_POSIX@
# undef malloc # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define malloc rpl_malloc # undef malloc
extern void * malloc (size_t size); # define malloc rpl_malloc
# endif
_GL_FUNCDECL_RPL (malloc, void *, (size_t size));
_GL_CXXALIAS_RPL (malloc, void *, (size_t size));
# else
_GL_CXXALIAS_SYS (malloc, void *, (size_t size));
# endif # endif
_GL_CXXALIASWARN (malloc);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef malloc # undef malloc
/* Assume malloc is always declared. */ /* Assume malloc is always declared. */
@ -193,14 +221,16 @@ _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
#endif #endif
#if @GNULIB_MKDTEMP@ #if @GNULIB_MKDTEMP@
# if !@HAVE_MKDTEMP@
/* Create a unique temporary directory from TEMPLATE. /* Create a unique temporary directory from TEMPLATE.
The last six characters of TEMPLATE must be "XXXXXX"; The last six characters of TEMPLATE must be "XXXXXX";
they are replaced with a string that makes the directory name unique. they are replaced with a string that makes the directory name unique.
Returns TEMPLATE, or a null pointer if it cannot get a unique name. Returns TEMPLATE, or a null pointer if it cannot get a unique name.
The directory is created mode 700. */ The directory is created mode 700. */
extern char * mkdtemp (char * /*template*/) _GL_ARG_NONNULL ((1)); # if !@HAVE_MKDTEMP@
_GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
_GL_CXXALIASWARN (mkdtemp);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mkdtemp # undef mkdtemp
# if HAVE_RAW_DECL_MKDTEMP # if HAVE_RAW_DECL_MKDTEMP
@ -210,7 +240,6 @@ _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
#endif #endif
#if @GNULIB_MKOSTEMP@ #if @GNULIB_MKOSTEMP@
# if !@HAVE_MKOSTEMP@
/* Create a unique temporary file from TEMPLATE. /* Create a unique temporary file from TEMPLATE.
The last six characters of TEMPLATE must be "XXXXXX"; The last six characters of TEMPLATE must be "XXXXXX";
they are replaced with a string that makes the file name unique. they are replaced with a string that makes the file name unique.
@ -223,8 +252,12 @@ _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
implementation. implementation.
Returns the open file descriptor if successful, otherwise -1 and errno Returns the open file descriptor if successful, otherwise -1 and errno
set. */ set. */
extern int mkostemp (char * /*template*/, int /*flags*/) _GL_ARG_NONNULL ((1)); # if !@HAVE_MKOSTEMP@
_GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
_GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
_GL_CXXALIASWARN (mkostemp);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mkostemp # undef mkostemp
# if HAVE_RAW_DECL_MKOSTEMP # if HAVE_RAW_DECL_MKOSTEMP
@ -234,7 +267,6 @@ _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
#endif #endif
#if @GNULIB_MKOSTEMPS@ #if @GNULIB_MKOSTEMPS@
# if !@HAVE_MKOSTEMPS@
/* Create a unique temporary file from TEMPLATE. /* Create a unique temporary file from TEMPLATE.
The last six characters of TEMPLATE before a suffix of length The last six characters of TEMPLATE before a suffix of length
SUFFIXLEN must be "XXXXXX"; SUFFIXLEN must be "XXXXXX";
@ -248,9 +280,14 @@ _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
implementation. implementation.
Returns the open file descriptor if successful, otherwise -1 and errno Returns the open file descriptor if successful, otherwise -1 and errno
set. */ set. */
extern int mkostemps (char * /*template*/, int /*suffixlen*/, int /*flags*/) # if !@HAVE_MKOSTEMPS@
_GL_ARG_NONNULL ((1)); _GL_FUNCDECL_SYS (mkostemps, int,
(char * /*template*/, int /*suffixlen*/, int /*flags*/)
_GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (mkostemps, int,
(char * /*template*/, int /*suffixlen*/, int /*flags*/));
_GL_CXXALIASWARN (mkostemps);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mkostemps # undef mkostemps
# if HAVE_RAW_DECL_MKOSTEMPS # if HAVE_RAW_DECL_MKOSTEMPS
@ -260,7 +297,6 @@ _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
#endif #endif
#if @GNULIB_MKSTEMP@ #if @GNULIB_MKSTEMP@
# if @REPLACE_MKSTEMP@
/* Create a unique temporary file from TEMPLATE. /* Create a unique temporary file from TEMPLATE.
The last six characters of TEMPLATE must be "XXXXXX"; The last six characters of TEMPLATE must be "XXXXXX";
they are replaced with a string that makes the file name unique. they are replaced with a string that makes the file name unique.
@ -270,9 +306,16 @@ _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
implementation. implementation.
Returns the open file descriptor if successful, otherwise -1 and errno Returns the open file descriptor if successful, otherwise -1 and errno
set. */ set. */
# define mkstemp rpl_mkstemp # if @REPLACE_MKSTEMP@
extern int mkstemp (char * /*template*/) _GL_ARG_NONNULL ((1)); # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mkstemp rpl_mkstemp
# endif
_GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
# else
_GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
# endif # endif
_GL_CXXALIASWARN (mkstemp);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mkstemp # undef mkstemp
# if HAVE_RAW_DECL_MKSTEMP # if HAVE_RAW_DECL_MKSTEMP
@ -282,7 +325,6 @@ _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
#endif #endif
#if @GNULIB_MKSTEMPS@ #if @GNULIB_MKSTEMPS@
# if !@HAVE_MKSTEMPS@
/* Create a unique temporary file from TEMPLATE. /* Create a unique temporary file from TEMPLATE.
The last six characters of TEMPLATE prior to a suffix of length The last six characters of TEMPLATE prior to a suffix of length
SUFFIXLEN must be "XXXXXX"; SUFFIXLEN must be "XXXXXX";
@ -293,9 +335,12 @@ _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
implementation. implementation.
Returns the open file descriptor if successful, otherwise -1 and errno Returns the open file descriptor if successful, otherwise -1 and errno
set. */ set. */
extern int mkstemps (char * /*template*/, int /*suffixlen*/) # if !@HAVE_MKSTEMPS@
_GL_ARG_NONNULL ((1)); _GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)
_GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
_GL_CXXALIASWARN (mkstemps);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mkstemps # undef mkstemps
# if HAVE_RAW_DECL_MKSTEMPS # if HAVE_RAW_DECL_MKSTEMPS
@ -306,45 +351,88 @@ _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
#if @GNULIB_PUTENV@ #if @GNULIB_PUTENV@
# if @REPLACE_PUTENV@ # if @REPLACE_PUTENV@
# undef putenv # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define putenv rpl_putenv # undef putenv
extern int putenv (char *string) _GL_ARG_NONNULL ((1)); # define putenv rpl_putenv
# endif
_GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (putenv, int, (char *string));
# else
_GL_CXXALIAS_SYS (putenv, int, (char *string));
# endif
_GL_CXXALIASWARN (putenv);
#endif
#if @GNULIB_RANDOM_R@
# if !@HAVE_RANDOM_R@
# ifndef RAND_MAX
# define RAND_MAX 2147483647
# endif
# endif # endif
#endif #endif
#if @GNULIB_RANDOM_R@ #if @GNULIB_RANDOM_R@
# if !@HAVE_RANDOM_R@ # if !@HAVE_RANDOM_R@
_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
# ifndef RAND_MAX _GL_ARG_NONNULL ((1, 2)));
# define RAND_MAX 2147483647
# endif
int srandom_r (unsigned int seed, struct random_data *rand_state)
_GL_ARG_NONNULL ((2));
int initstate_r (unsigned int seed, char *buf, size_t buf_size,
struct random_data *rand_state)
_GL_ARG_NONNULL ((2, 4));
int setstate_r (char *arg_state, struct random_data *rand_state)
_GL_ARG_NONNULL ((1, 2));
int random_r (struct random_data *buf, int32_t *result)
_GL_ARG_NONNULL ((1, 2));
# endif # endif
_GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
_GL_CXXALIASWARN (random_r);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef random_r # undef random_r
# if HAVE_RAW_DECL_RANDOM_R # if HAVE_RAW_DECL_RANDOM_R
_GL_WARN_ON_USE (random_r, "random_r is unportable - " _GL_WARN_ON_USE (random_r, "random_r is unportable - "
"use gnulib module random_r for portability"); "use gnulib module random_r for portability");
# endif # endif
# undef initstate_r #endif
# if HAVE_RAW_DECL_INITSTATE_R
_GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - " #if @GNULIB_RANDOM_R@
"use gnulib module random_r for portability"); # if !@HAVE_RANDOM_R@
_GL_FUNCDECL_SYS (srandom_r, int,
(unsigned int seed, struct random_data *rand_state)
_GL_ARG_NONNULL ((2)));
# endif # endif
_GL_CXXALIAS_SYS (srandom_r, int,
(unsigned int seed, struct random_data *rand_state));
_GL_CXXALIASWARN (srandom_r);
#elif defined GNULIB_POSIXCHECK
# undef srandom_r # undef srandom_r
# if HAVE_RAW_DECL_SRANDOM_R # if HAVE_RAW_DECL_SRANDOM_R
_GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - " _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
"use gnulib module random_r for portability"); "use gnulib module random_r for portability");
# endif # endif
#endif
#if @GNULIB_RANDOM_R@
# if !@HAVE_RANDOM_R@
_GL_FUNCDECL_SYS (initstate_r, int,
(unsigned int seed, char *buf, size_t buf_size,
struct random_data *rand_state)
_GL_ARG_NONNULL ((2, 4)));
# endif
_GL_CXXALIAS_SYS (initstate_r, int,
(unsigned int seed, char *buf, size_t buf_size,
struct random_data *rand_state));
_GL_CXXALIASWARN (initstate_r);
#elif defined GNULIB_POSIXCHECK
# undef initstate_r
# if HAVE_RAW_DECL_INITSTATE_R
_GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
"use gnulib module random_r for portability");
# endif
#endif
#if @GNULIB_RANDOM_R@
# if !@HAVE_RANDOM_R@
_GL_FUNCDECL_SYS (setstate_r, int,
(char *arg_state, struct random_data *rand_state)
_GL_ARG_NONNULL ((1, 2)));
# endif
_GL_CXXALIAS_SYS (setstate_r, int,
(char *arg_state, struct random_data *rand_state));
_GL_CXXALIASWARN (setstate_r);
#elif defined GNULIB_POSIXCHECK
# undef setstate_r # undef setstate_r
# if HAVE_RAW_DECL_SETSTATE_R # if HAVE_RAW_DECL_SETSTATE_R
_GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - " _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
@ -352,12 +440,19 @@ _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
# endif # endif
#endif #endif
#if @GNULIB_REALLOC_POSIX@ #if @GNULIB_REALLOC_POSIX@
# if !@HAVE_REALLOC_POSIX@ # if !@HAVE_REALLOC_POSIX@
# undef realloc # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define realloc rpl_realloc # undef realloc
extern void * realloc (void *ptr, size_t size); # define realloc rpl_realloc
# endif
_GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size));
_GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
# else
_GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
# endif # endif
_GL_CXXALIASWARN (realloc);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef realloc # undef realloc
/* Assume realloc is always declared. */ /* Assume realloc is always declared. */
@ -367,11 +462,20 @@ _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
#if @GNULIB_REALPATH@ #if @GNULIB_REALPATH@
# if @REPLACE_REALPATH@ # if @REPLACE_REALPATH@
# define realpath rpl_realpath # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# endif # define realpath rpl_realpath
# if !@HAVE_REALPATH@ || @REPLACE_REALPATH@ # endif
extern char *realpath (const char *name, char *resolved) _GL_ARG_NONNULL ((1)); _GL_FUNCDECL_RPL (realpath, char *, (const char *name, char *resolved)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (realpath, char *, (const char *name, char *resolved));
# else
# if !@HAVE_REALPATH@
_GL_FUNCDECL_SYS (realpath, char *, (const char *name, char *resolved)
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (realpath, char *, (const char *name, char *resolved));
# endif # endif
_GL_CXXALIASWARN (realpath);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef realpath # undef realpath
# if HAVE_RAW_DECL_REALPATH # if HAVE_RAW_DECL_REALPATH
@ -381,11 +485,13 @@ _GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
#endif #endif
#if @GNULIB_RPMATCH@ #if @GNULIB_RPMATCH@
# if !@HAVE_RPMATCH@
/* Test a user response to a question. /* Test a user response to a question.
Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */ Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */
extern int rpmatch (const char *response) _GL_ARG_NONNULL ((1)); # if !@HAVE_RPMATCH@
_GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
_GL_CXXALIASWARN (rpmatch);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef rpmatch # undef rpmatch
# if HAVE_RAW_DECL_RPMATCH # if HAVE_RAW_DECL_RPMATCH
@ -395,16 +501,28 @@ _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
#endif #endif
#if @GNULIB_SETENV@ #if @GNULIB_SETENV@
# if @REPLACE_SETENV@
# undef setenv
# define setenv rpl_setenv
# endif
# if !@HAVE_SETENV@ || @REPLACE_SETENV@
/* Set NAME to VALUE in the environment. /* Set NAME to VALUE in the environment.
If REPLACE is nonzero, overwrite an existing value. */ If REPLACE is nonzero, overwrite an existing value. */
extern int setenv (const char *name, const char *value, int replace) # if @REPLACE_SETENV@
_GL_ARG_NONNULL ((1)); # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef setenv
# define setenv rpl_setenv
# endif
_GL_FUNCDECL_RPL (setenv, int,
(const char *name, const char *value, int replace)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (setenv, int,
(const char *name, const char *value, int replace));
# else
# if !@HAVE_SETENV@
_GL_FUNCDECL_SYS (setenv, int,
(const char *name, const char *value, int replace)
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (setenv, int,
(const char *name, const char *value, int replace));
# endif # endif
_GL_CXXALIASWARN (setenv);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef setenv # undef setenv
# if HAVE_RAW_DECL_SETENV # if HAVE_RAW_DECL_SETENV
@ -414,13 +532,22 @@ _GL_WARN_ON_USE (setenv, "setenv is unportable - "
#endif #endif
#if @GNULIB_STRTOD@ #if @GNULIB_STRTOD@
# if @REPLACE_STRTOD@
# define strtod rpl_strtod
# endif
# if !@HAVE_STRTOD@ || @REPLACE_STRTOD@
/* Parse a double from STRING, updating ENDP if appropriate. */ /* Parse a double from STRING, updating ENDP if appropriate. */
extern double strtod (const char *str, char **endp) _GL_ARG_NONNULL ((1)); # if @REPLACE_STRTOD@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define strtod rpl_strtod
# endif
_GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp));
# else
# if !@HAVE_STRTOD@
_GL_FUNCDECL_SYS (strtod, double, (const char *str, char **endp)
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strtod, double, (const char *str, char **endp));
# endif # endif
_GL_CXXALIASWARN (strtod);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strtod # undef strtod
# if HAVE_RAW_DECL_STRTOD # if HAVE_RAW_DECL_STRTOD
@ -430,7 +557,6 @@ _GL_WARN_ON_USE (strtod, "strtod is unportable - "
#endif #endif
#if @GNULIB_STRTOLL@ #if @GNULIB_STRTOLL@
# if !@HAVE_STRTOLL@
/* Parse a signed integer whose textual representation starts at STRING. /* Parse a signed integer whose textual representation starts at STRING.
The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
it may be decimal or octal (with prefix "0") or hexadecimal (with prefix it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
@ -439,9 +565,14 @@ _GL_WARN_ON_USE (strtod, "strtod is unportable - "
stored in *ENDPTR. stored in *ENDPTR.
Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
to ERANGE. */ to ERANGE. */
extern long long strtoll (const char *string, char **endptr, int base) # if !@HAVE_STRTOLL@
_GL_ARG_NONNULL ((1)); _GL_FUNCDECL_SYS (strtoll, long long,
(const char *string, char **endptr, int base)
_GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (strtoll, long long,
(const char *string, char **endptr, int base));
_GL_CXXALIASWARN (strtoll);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strtoll # undef strtoll
# if HAVE_RAW_DECL_STRTOLL # if HAVE_RAW_DECL_STRTOLL
@ -451,7 +582,6 @@ _GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
#endif #endif
#if @GNULIB_STRTOULL@ #if @GNULIB_STRTOULL@
# if !@HAVE_STRTOULL@
/* Parse an unsigned integer whose textual representation starts at STRING. /* Parse an unsigned integer whose textual representation starts at STRING.
The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
it may be decimal or octal (with prefix "0") or hexadecimal (with prefix it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
@ -460,9 +590,14 @@ _GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
stored in *ENDPTR. stored in *ENDPTR.
Upon overflow, the return value is ULLONG_MAX, and errno is set to Upon overflow, the return value is ULLONG_MAX, and errno is set to
ERANGE. */ ERANGE. */
extern unsigned long long strtoull (const char *string, char **endptr, int base) # if !@HAVE_STRTOULL@
_GL_ARG_NONNULL ((1)); _GL_FUNCDECL_SYS (strtoull, unsigned long long,
(const char *string, char **endptr, int base)
_GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (strtoull, unsigned long long,
(const char *string, char **endptr, int base));
_GL_CXXALIASWARN (strtoull);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strtoull # undef strtoull
# if HAVE_RAW_DECL_STRTOULL # if HAVE_RAW_DECL_STRTOULL
@ -472,14 +607,21 @@ _GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
#endif #endif
#if @GNULIB_UNSETENV@ #if @GNULIB_UNSETENV@
# if @REPLACE_UNSETENV@
# undef unsetenv
# define unsetenv rpl_unsetenv
# endif
# if !@HAVE_UNSETENV@ || @REPLACE_UNSETENV@
/* Remove the variable NAME from the environment. */ /* Remove the variable NAME from the environment. */
extern int unsetenv (const char *name) _GL_ARG_NONNULL ((1)); # if @REPLACE_UNSETENV@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef unsetenv
# define unsetenv rpl_unsetenv
# endif
_GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
# else
# if !@HAVE_UNSETENV@
_GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
# endif # endif
_GL_CXXALIASWARN (unsetenv);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef unsetenv # undef unsetenv
# if HAVE_RAW_DECL_UNSETENV # if HAVE_RAW_DECL_UNSETENV
@ -488,9 +630,6 @@ _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
# endif # endif
#endif #endif
#ifdef __cplusplus
}
#endif
#endif /* _GL_STDLIB_H */ #endif /* _GL_STDLIB_H */
#endif /* _GL_STDLIB_H */ #endif /* _GL_STDLIB_H */

View file

@ -48,22 +48,38 @@
#endif #endif
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */ /* The definition of _GL_ARG_NONNULL is copied here. */
/* The definition of _GL_WARN_ON_USE is copied here. */ /* The definition of _GL_WARN_ON_USE is copied here. */
#ifdef __cplusplus
extern "C" {
#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 @GNULIB_MEMCHR@ #if @GNULIB_MEMCHR@
# if @REPLACE_MEMCHR@ # if @REPLACE_MEMCHR@
# define memchr rpl_memchr # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
extern void *memchr (void const *__s, int __c, size_t __n) # define memchr rpl_memchr
__attribute__ ((__pure__)) _GL_ARG_NONNULL ((1)); # endif
_GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n)
__attribute__ ((__pure__))
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n));
# else
/* On some systems, this function is defined as an overloaded function:
extern "C" { const void * std::memchr (const void *, int, size_t); }
extern "C++" { void * std::memchr (void *, int, size_t); } */
_GL_CXXALIAS_SYS_CAST2 (memchr,
void *, (void const *__s, int __c, size_t __n),
void const *, (void const *__s, int __c, size_t __n));
# endif
# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
&& (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
_GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n));
_GL_CXXALIASWARN1 (memchr, void const *,
(void const *__s, int __c, size_t __n));
# else
_GL_CXXALIASWARN (memchr);
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef memchr # undef memchr
@ -75,13 +91,28 @@ _GL_WARN_ON_USE (memchr, "memchr has platform-specific bugs - "
/* Return the first occurrence of NEEDLE in HAYSTACK. */ /* Return the first occurrence of NEEDLE in HAYSTACK. */
#if @GNULIB_MEMMEM@ #if @GNULIB_MEMMEM@
# if @REPLACE_MEMMEM@ # if @REPLACE_MEMMEM@
# define memmem rpl_memmem # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# endif # define memmem rpl_memmem
# if ! @HAVE_DECL_MEMMEM@ || @REPLACE_MEMMEM@ # endif
extern void *memmem (void const *__haystack, size_t __haystack_len, _GL_FUNCDECL_RPL (memmem, void *,
void const *__needle, size_t __needle_len) (void const *__haystack, size_t __haystack_len,
__attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 3)); void const *__needle, size_t __needle_len)
__attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 3)));
_GL_CXXALIAS_RPL (memmem, void *,
(void const *__haystack, size_t __haystack_len,
void const *__needle, size_t __needle_len));
# else
# if ! @HAVE_DECL_MEMMEM@
_GL_FUNCDECL_SYS (memmem, void *,
(void const *__haystack, size_t __haystack_len,
void const *__needle, size_t __needle_len)
__attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 3)));
# endif
_GL_CXXALIAS_SYS (memmem, void *,
(void const *__haystack, size_t __haystack_len,
void const *__needle, size_t __needle_len));
# endif # endif
_GL_CXXALIASWARN (memmem);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef memmem # undef memmem
# if HAVE_RAW_DECL_MEMMEM # if HAVE_RAW_DECL_MEMMEM
@ -95,10 +126,15 @@ _GL_WARN_ON_USE (memmem, "memmem is unportable and often quadratic - "
last written byte. */ last written byte. */
#if @GNULIB_MEMPCPY@ #if @GNULIB_MEMPCPY@
# if ! @HAVE_MEMPCPY@ # if ! @HAVE_MEMPCPY@
extern void *mempcpy (void *restrict __dest, void const *restrict __src, _GL_FUNCDECL_SYS (mempcpy, void *,
size_t __n) (void *restrict __dest, void const *restrict __src,
_GL_ARG_NONNULL ((1, 2)); size_t __n)
_GL_ARG_NONNULL ((1, 2)));
# endif # endif
_GL_CXXALIAS_SYS (mempcpy, void *,
(void *restrict __dest, void const *restrict __src,
size_t __n));
_GL_CXXALIASWARN (mempcpy);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mempcpy # undef mempcpy
# if HAVE_RAW_DECL_MEMPCPY # if HAVE_RAW_DECL_MEMPCPY
@ -110,8 +146,22 @@ _GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - "
/* 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 @GNULIB_MEMRCHR@ #if @GNULIB_MEMRCHR@
# if ! @HAVE_DECL_MEMRCHR@ # if ! @HAVE_DECL_MEMRCHR@
extern void *memrchr (void const *, int, size_t) _GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t)
__attribute__ ((__pure__)) _GL_ARG_NONNULL ((1)); __attribute__ ((__pure__))
_GL_ARG_NONNULL ((1)));
# endif
/* On some systems, this function is defined as an overloaded function:
extern "C++" { const void * std::memrchr (const void *, int, size_t); }
extern "C++" { void * std::memrchr (void *, int, size_t); } */
_GL_CXXALIAS_SYS_CAST2 (memrchr,
void *, (void const *, int, size_t),
void const *, (void const *, int, size_t));
# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
&& (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
_GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t));
_GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t));
# else
_GL_CXXALIASWARN (memrchr);
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef memrchr # undef memrchr
@ -126,8 +176,22 @@ _GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
occur within N bytes. */ occur within N bytes. */
#if @GNULIB_RAWMEMCHR@ #if @GNULIB_RAWMEMCHR@
# if ! @HAVE_RAWMEMCHR@ # if ! @HAVE_RAWMEMCHR@
extern void *rawmemchr (void const *__s, int __c_in) _GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in)
__attribute__ ((__pure__)) _GL_ARG_NONNULL ((1)); __attribute__ ((__pure__))
_GL_ARG_NONNULL ((1)));
# endif
/* On some systems, this function is defined as an overloaded function:
extern "C++" { const void * std::rawmemchr (const void *, int); }
extern "C++" { void * std::rawmemchr (void *, int); } */
_GL_CXXALIAS_SYS_CAST2 (rawmemchr,
void *, (void const *__s, int __c_in),
void const *, (void const *__s, int __c_in));
# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
&& (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
_GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in));
_GL_CXXALIASWARN1 (rawmemchr, void const *, (void const *__s, int __c_in));
# else
_GL_CXXALIASWARN (rawmemchr);
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef rawmemchr # undef rawmemchr
@ -140,9 +204,13 @@ _GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - "
/* 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 @GNULIB_STPCPY@ #if @GNULIB_STPCPY@
# if ! @HAVE_STPCPY@ # if ! @HAVE_STPCPY@
extern char *stpcpy (char *restrict __dst, char const *restrict __src) _GL_FUNCDECL_SYS (stpcpy, char *,
_GL_ARG_NONNULL ((1, 2)); (char *restrict __dst, char const *restrict __src)
_GL_ARG_NONNULL ((1, 2)));
# endif # endif
_GL_CXXALIAS_SYS (stpcpy, char *,
(char *restrict __dst, char const *restrict __src));
_GL_CXXALIASWARN (stpcpy);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef stpcpy # undef stpcpy
# if HAVE_RAW_DECL_STPCPY # if HAVE_RAW_DECL_STPCPY
@ -155,11 +223,22 @@ _GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - "
last non-NUL byte written into DST. */ last non-NUL byte written into DST. */
#if @GNULIB_STPNCPY@ #if @GNULIB_STPNCPY@
# if ! @HAVE_STPNCPY@ # if ! @HAVE_STPNCPY@
# define stpncpy gnu_stpncpy # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
extern char *stpncpy (char *restrict __dst, char const *restrict __src, # define stpncpy rpl_stpncpy
size_t __n) # endif
_GL_ARG_NONNULL ((1, 2)); _GL_FUNCDECL_RPL (stpncpy, char *,
(char *restrict __dst, char const *restrict __src,
size_t __n)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (stpncpy, char *,
(char *restrict __dst, char const *restrict __src,
size_t __n));
# else
_GL_CXXALIAS_SYS (stpncpy, char *,
(char *restrict __dst, char const *restrict __src,
size_t __n));
# endif # endif
_GL_CXXALIASWARN (stpncpy);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef stpncpy # undef stpncpy
# if HAVE_RAW_DECL_STPNCPY # if HAVE_RAW_DECL_STPNCPY
@ -181,8 +260,22 @@ _GL_WARN_ON_USE (strchr, "strchr cannot work correctly on character strings "
/* 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 @GNULIB_STRCHRNUL@ #if @GNULIB_STRCHRNUL@
# if ! @HAVE_STRCHRNUL@ # if ! @HAVE_STRCHRNUL@
extern char *strchrnul (char const *__s, int __c_in) _GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in)
__attribute__ ((__pure__)) _GL_ARG_NONNULL ((1)); __attribute__ ((__pure__))
_GL_ARG_NONNULL ((1)));
# endif
/* On some systems, this function is defined as an overloaded function:
extern "C++" { const char * std::strchrnul (const char *, int); }
extern "C++" { char * std::strchrnul (char *, int); } */
_GL_CXXALIAS_SYS_CAST2 (strchrnul,
char *, (char const *__s, int __c_in),
char const *, (char const *__s, int __c_in));
# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
&& (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
_GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in));
_GL_CXXALIASWARN1 (strchrnul, char const *, (char const *__s, int __c_in));
# else
_GL_CXXALIASWARN (strchrnul);
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strchrnul # undef strchrnul
@ -195,12 +288,19 @@ _GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - "
/* Duplicate S, returning an identical malloc'd string. */ /* Duplicate S, returning an identical malloc'd string. */
#if @GNULIB_STRDUP@ #if @GNULIB_STRDUP@
# if @REPLACE_STRDUP@ # if @REPLACE_STRDUP@
# undef strdup # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define strdup rpl_strdup # undef strdup
# endif # define strdup rpl_strdup
# if !(@HAVE_DECL_STRDUP@ || defined strdup) || @REPLACE_STRDUP@ # endif
extern char *strdup (char const *__s) _GL_ARG_NONNULL ((1)); _GL_FUNCDECL_RPL (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strdup, char *, (char const *__s));
# else
# if !(@HAVE_DECL_STRDUP@ || defined strdup)
_GL_FUNCDECL_SYS (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
# endif # endif
_GL_CXXALIASWARN (strdup);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strdup # undef strdup
# if HAVE_RAW_DECL_STRDUP # if HAVE_RAW_DECL_STRDUP
@ -212,12 +312,21 @@ _GL_WARN_ON_USE (strdup, "strdup is unportable - "
/* 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 @GNULIB_STRNDUP@ #if @GNULIB_STRNDUP@
# if @REPLACE_STRNDUP@ # if @REPLACE_STRNDUP@
# undef strndup # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define strndup rpl_strndup # undef strndup
# endif # define strndup rpl_strndup
# if @REPLACE_STRNDUP@ || ! @HAVE_DECL_STRNDUP@ # endif
extern char *strndup (char const *__string, size_t __n) _GL_ARG_NONNULL ((1)); _GL_FUNCDECL_RPL (strndup, char *, (char const *__string, size_t __n)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (strndup, char *, (char const *__string, size_t __n));
# else
# if ! @HAVE_DECL_STRNDUP@
_GL_FUNCDECL_SYS (strndup, char *, (char const *__string, size_t __n)
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (strndup, char *, (char const *__string, size_t __n));
# endif # endif
_GL_CXXALIASWARN (strndup);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strndup # undef strndup
# if HAVE_RAW_DECL_STRNDUP # if HAVE_RAW_DECL_STRNDUP
@ -231,9 +340,12 @@ _GL_WARN_ON_USE (strndup, "strndup is unportable - "
return MAXLEN. */ return MAXLEN. */
#if @GNULIB_STRNLEN@ #if @GNULIB_STRNLEN@
# if ! @HAVE_DECL_STRNLEN@ # if ! @HAVE_DECL_STRNLEN@
extern size_t strnlen (char const *__string, size_t __maxlen) _GL_FUNCDECL_SYS (strnlen, size_t, (char const *__string, size_t __maxlen)
__attribute__ ((__pure__)) _GL_ARG_NONNULL ((1)); __attribute__ ((__pure__))
_GL_ARG_NONNULL ((1)));
# endif # endif
_GL_CXXALIAS_SYS (strnlen, size_t, (char const *__string, size_t __maxlen));
_GL_CXXALIASWARN (strnlen);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strnlen # undef strnlen
# if HAVE_RAW_DECL_STRNLEN # if HAVE_RAW_DECL_STRNLEN
@ -257,8 +369,23 @@ _GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings "
/* Find the first occurrence in S of any character in ACCEPT. */ /* Find the first occurrence in S of any character in ACCEPT. */
#if @GNULIB_STRPBRK@ #if @GNULIB_STRPBRK@
# if ! @HAVE_STRPBRK@ # if ! @HAVE_STRPBRK@
extern char *strpbrk (char const *__s, char const *__accept) _GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept)
__attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2)); __attribute__ ((__pure__))
_GL_ARG_NONNULL ((1, 2)));
# endif
/* On some systems, this function is defined as an overloaded function:
extern "C" { const char * strpbrk (const char *, const char *); }
extern "C++" { char * strpbrk (char *, const char *); } */
_GL_CXXALIAS_SYS_CAST2 (strpbrk,
char *, (char const *__s, char const *__accept),
const char *, (char const *__s, char const *__accept));
# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
&& (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
_GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept));
_GL_CXXALIASWARN1 (strpbrk, char const *,
(char const *__s, char const *__accept));
# else
_GL_CXXALIASWARN (strpbrk);
# endif # endif
# if defined GNULIB_POSIXCHECK # if defined GNULIB_POSIXCHECK
/* strpbrk() assumes the second argument is a list of single-byte characters. /* strpbrk() assumes the second argument is a list of single-byte characters.
@ -316,9 +443,13 @@ _GL_WARN_ON_USE (strrchr, "strrchr cannot work correctly on character strings "
See also strtok_r(). */ See also strtok_r(). */
#if @GNULIB_STRSEP@ #if @GNULIB_STRSEP@
# if ! @HAVE_STRSEP@ # if ! @HAVE_STRSEP@
extern char *strsep (char **restrict __stringp, char const *restrict __delim) _GL_FUNCDECL_SYS (strsep, char *,
_GL_ARG_NONNULL ((1, 2)); (char **restrict __stringp, char const *restrict __delim)
_GL_ARG_NONNULL ((1, 2)));
# endif # endif
_GL_CXXALIAS_SYS (strsep, char *,
(char **restrict __stringp, char const *restrict __delim));
_GL_CXXALIASWARN (strsep);
# if defined GNULIB_POSIXCHECK # if defined GNULIB_POSIXCHECK
# undef strsep # undef strsep
_GL_WARN_ON_USE (strsep, "strsep cannot work correctly on character strings " _GL_WARN_ON_USE (strsep, "strsep cannot work correctly on character strings "
@ -335,9 +466,28 @@ _GL_WARN_ON_USE (strsep, "strsep is unportable - "
#if @GNULIB_STRSTR@ #if @GNULIB_STRSTR@
# if @REPLACE_STRSTR@ # if @REPLACE_STRSTR@
# define strstr rpl_strstr # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
extern char *strstr (const char *haystack, const char *needle) # define strstr rpl_strstr
__attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2)); # endif
_GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle)
__attribute__ ((__pure__))
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle));
# else
/* On some systems, this function is defined as an overloaded function:
extern "C++" { const char * strstr (const char *, const char *); }
extern "C++" { char * strstr (char *, const char *); } */
_GL_CXXALIAS_SYS_CAST2 (strstr,
char *, (const char *haystack, const char *needle),
const char *, (const char *haystack, const char *needle));
# endif
# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
&& (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
_GL_CXXALIASWARN1 (strstr, char *, (char *haystack, const char *needle));
_GL_CXXALIASWARN1 (strstr, const char *,
(const char *haystack, const char *needle));
# else
_GL_CXXALIASWARN (strstr);
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
/* strstr() does not work with multibyte strings if the locale encoding is /* strstr() does not work with multibyte strings if the locale encoding is
@ -357,11 +507,34 @@ _GL_WARN_ON_USE (strstr, "strstr is quadratic on many systems, and cannot "
comparison. */ comparison. */
#if @GNULIB_STRCASESTR@ #if @GNULIB_STRCASESTR@
# if @REPLACE_STRCASESTR@ # if @REPLACE_STRCASESTR@
# define strcasestr rpl_strcasestr # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define strcasestr rpl_strcasestr
# endif
_GL_FUNCDECL_RPL (strcasestr, char *,
(const char *haystack, const char *needle)
__attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (strcasestr, char *,
(const char *haystack, const char *needle));
# else
# if ! @HAVE_STRCASESTR@
_GL_FUNCDECL_SYS (strcasestr, char *,
(const char *haystack, const char *needle)
__attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2)));
# endif
/* On some systems, this function is defined as an overloaded function:
extern "C++" { const char * strcasestr (const char *, const char *); }
extern "C++" { char * strcasestr (char *, const char *); } */
_GL_CXXALIAS_SYS_CAST2 (strcasestr,
char *, (const char *haystack, const char *needle),
const char *, (const char *haystack, const char *needle));
# endif # endif
# if ! @HAVE_STRCASESTR@ || @REPLACE_STRCASESTR@ # if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 10 \
extern char *strcasestr (const char *haystack, const char *needle) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
__attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2)); _GL_CXXALIASWARN1 (strcasestr, char *, (char *haystack, const char *needle));
_GL_CXXALIASWARN1 (strcasestr, const char *,
(const char *haystack, const char *needle));
# else
_GL_CXXALIASWARN (strcasestr);
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
/* strcasestr() does not work with multibyte strings: /* strcasestr() does not work with multibyte strings:
@ -401,16 +574,32 @@ _GL_WARN_ON_USE (strcasestr, "strcasestr does work correctly on character "
See also strsep(). */ See also strsep(). */
#if @GNULIB_STRTOK_R@ #if @GNULIB_STRTOK_R@
# if @REPLACE_STRTOK_R@ # if @REPLACE_STRTOK_R@
# undef strtok_r # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define strtok_r rpl_strtok_r # undef strtok_r
# elif @UNDEFINE_STRTOK_R@ || defined GNULIB_POSIXCHECK # define strtok_r rpl_strtok_r
# undef strtok_r # endif
# endif _GL_FUNCDECL_RPL (strtok_r, char *,
# if ! @HAVE_DECL_STRTOK_R@ || @REPLACE_STRTOK_R@ (char *restrict s, char const *restrict delim,
extern char *strtok_r (char *restrict s, char const *restrict delim, char **restrict save_ptr)
char **restrict save_ptr) _GL_ARG_NONNULL ((2, 3)));
_GL_ARG_NONNULL ((2, 3)); _GL_CXXALIAS_RPL (strtok_r, char *,
(char *restrict s, char const *restrict delim,
char **restrict save_ptr));
# else
# if @UNDEFINE_STRTOK_R@ || defined GNULIB_POSIXCHECK
# undef strtok_r
# endif
# if ! @HAVE_DECL_STRTOK_R@
_GL_FUNCDECL_SYS (strtok_r, char *,
(char *restrict s, char const *restrict delim,
char **restrict save_ptr)
_GL_ARG_NONNULL ((2, 3)));
# endif
_GL_CXXALIAS_SYS (strtok_r, char *,
(char *restrict s, char const *restrict delim,
char **restrict save_ptr));
# endif # endif
_GL_CXXALIASWARN (strtok_r);
# if defined GNULIB_POSIXCHECK # if defined GNULIB_POSIXCHECK
_GL_WARN_ON_USE (strtok_r, "strtok_r cannot work correctly on character " _GL_WARN_ON_USE (strtok_r, "strtok_r cannot work correctly on character "
"strings in multibyte locales - " "strings in multibyte locales - "
@ -435,15 +624,23 @@ _GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - "
# undef mbslen # undef mbslen
# endif # endif
# if @HAVE_MBSLEN@ /* AIX, OSF/1, MirBSD define mbslen already in libc. */ # if @HAVE_MBSLEN@ /* AIX, OSF/1, MirBSD define mbslen already in libc. */
# define mbslen rpl_mbslen # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbslen rpl_mbslen
# endif
_GL_FUNCDECL_RPL (mbslen, size_t, (const char *string) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mbslen, size_t, (const char *string));
# else
_GL_FUNCDECL_SYS (mbslen, size_t, (const char *string) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_SYS (mbslen, size_t, (const char *string));
# endif # endif
extern size_t mbslen (const char *string) _GL_ARG_NONNULL ((1)); _GL_CXXALIASWARN (mbslen);
#endif #endif
#if @GNULIB_MBSNLEN@ #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. */
extern size_t mbsnlen (const char *string, size_t len) _GL_ARG_NONNULL ((1)); _GL_EXTERN_C size_t mbsnlen (const char *string, size_t len)
_GL_ARG_NONNULL ((1));
#endif #endif
#if @GNULIB_MBSCHR@ #if @GNULIB_MBSCHR@
@ -451,8 +648,19 @@ extern size_t mbsnlen (const char *string, size_t len) _GL_ARG_NONNULL ((1));
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
encodings such as GB18030. */ encodings such as GB18030. */
# define mbschr rpl_mbschr /* avoid collision with HP-UX function */ # if defined __hpux
extern char * mbschr (const char *string, int c) _GL_ARG_NONNULL ((1)); # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbschr rpl_mbschr /* avoid collision with HP-UX function */
# endif
_GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mbschr, char *, (const char *string, int c));
# else
_GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c));
# endif
_GL_CXXALIASWARN (mbschr);
#endif #endif
#if @GNULIB_MBSRCHR@ #if @GNULIB_MBSRCHR@
@ -460,8 +668,19 @@ extern char * mbschr (const char *string, int c) _GL_ARG_NONNULL ((1));
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
encodings such as GB18030. */ encodings such as GB18030. */
# define mbsrchr rpl_mbsrchr /* avoid collision with HP-UX function */ # if defined __hpux
extern char * mbsrchr (const char *string, int c) _GL_ARG_NONNULL ((1)); # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbsrchr rpl_mbsrchr /* avoid collision with HP-UX function */
# endif
_GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mbsrchr, char *, (const char *string, int c));
# else
_GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c));
# endif
_GL_CXXALIASWARN (mbsrchr);
#endif #endif
#if @GNULIB_MBSSTR@ #if @GNULIB_MBSSTR@
@ -469,7 +688,7 @@ extern char * mbsrchr (const char *string, int c) _GL_ARG_NONNULL ((1));
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
encodings different from UTF-8. */ encodings different from UTF-8. */
extern char * mbsstr (const char *haystack, const char *needle) _GL_EXTERN_C char * mbsstr (const char *haystack, const char *needle)
_GL_ARG_NONNULL ((1, 2)); _GL_ARG_NONNULL ((1, 2));
#endif #endif
@ -480,7 +699,7 @@ extern char * mbsstr (const char *haystack, const char *needle)
Note: This function may, in multibyte locales, return 0 for strings of Note: This function may, in multibyte locales, return 0 for strings of
different lengths! different lengths!
Unlike strcasecmp(), this function works correctly in multibyte locales. */ Unlike strcasecmp(), this function works correctly in multibyte locales. */
extern int mbscasecmp (const char *s1, const char *s2) _GL_EXTERN_C int mbscasecmp (const char *s1, const char *s2)
_GL_ARG_NONNULL ((1, 2)); _GL_ARG_NONNULL ((1, 2));
#endif #endif
@ -494,7 +713,7 @@ extern int mbscasecmp (const char *s1, const char *s2)
of different lengths! of different lengths!
Unlike strncasecmp(), this function works correctly in multibyte locales. Unlike strncasecmp(), this function works correctly in multibyte locales.
But beware that N is not a byte count but a character count! */ But beware that N is not a byte count but a character count! */
extern int mbsncasecmp (const char *s1, const char *s2, size_t n) _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
@ -508,7 +727,7 @@ extern int mbsncasecmp (const char *s1, const char *s2, size_t n)
smaller length than PREFIX! smaller length than PREFIX!
Unlike strncasecmp(), this function works correctly in multibyte Unlike strncasecmp(), this function works correctly in multibyte
locales. */ locales. */
extern char * mbspcasecmp (const char *string, const char *prefix) _GL_EXTERN_C char * mbspcasecmp (const char *string, const char *prefix)
_GL_ARG_NONNULL ((1, 2)); _GL_ARG_NONNULL ((1, 2));
#endif #endif
@ -518,7 +737,7 @@ extern char * mbspcasecmp (const char *string, const char *prefix)
Note: This function may, in multibyte locales, return success even if Note: This function may, in multibyte locales, return success even if
strlen (haystack) < strlen (needle) ! strlen (haystack) < strlen (needle) !
Unlike strcasestr(), this function works correctly in multibyte locales. */ Unlike strcasestr(), this function works correctly in multibyte locales. */
extern char * mbscasestr (const char *haystack, const char *needle) _GL_EXTERN_C char * mbscasestr (const char *haystack, const char *needle)
_GL_ARG_NONNULL ((1, 2)); _GL_ARG_NONNULL ((1, 2));
#endif #endif
@ -528,7 +747,7 @@ extern char * mbscasestr (const char *haystack, const char *needle)
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
if none exists. if none exists.
Unlike strcspn(), this function works correctly in multibyte locales. */ Unlike strcspn(), this function works correctly in multibyte locales. */
extern size_t mbscspn (const char *string, const char *accept) _GL_EXTERN_C size_t mbscspn (const char *string, const char *accept)
_GL_ARG_NONNULL ((1, 2)); _GL_ARG_NONNULL ((1, 2));
#endif #endif
@ -537,9 +756,19 @@ extern size_t mbscspn (const char *string, const char *accept)
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.
Unlike strpbrk(), this function works correctly in multibyte locales. */ Unlike strpbrk(), this function works correctly in multibyte locales. */
# define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */ # if defined __hpux
extern char * mbspbrk (const char *string, const char *accept) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
_GL_ARG_NONNULL ((1, 2)); # define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */
# endif
_GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (mbspbrk, char *, (const char *string, const char *accept));
# else
_GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept));
# endif
_GL_CXXALIASWARN (mbspbrk);
#endif #endif
#if @GNULIB_MBSSPN@ #if @GNULIB_MBSSPN@
@ -548,7 +777,7 @@ extern char * mbspbrk (const char *string, const char *accept)
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
if none exists. if none exists.
Unlike strspn(), this function works correctly in multibyte locales. */ Unlike strspn(), this function works correctly in multibyte locales. */
extern size_t mbsspn (const char *string, const char *reject) _GL_EXTERN_C size_t mbsspn (const char *string, const char *reject)
_GL_ARG_NONNULL ((1, 2)); _GL_ARG_NONNULL ((1, 2));
#endif #endif
@ -567,7 +796,7 @@ extern size_t mbsspn (const char *string, const char *reject)
Caveat: The identity of the delimiting character is lost. Caveat: The identity of the delimiting character is lost.
See also mbstok_r(). */ See also mbstok_r(). */
extern char * mbssep (char **stringp, const char *delim) _GL_EXTERN_C char * mbssep (char **stringp, const char *delim)
_GL_ARG_NONNULL ((1, 2)); _GL_ARG_NONNULL ((1, 2));
#endif #endif
@ -588,17 +817,23 @@ extern char * mbssep (char **stringp, const char *delim)
Caveat: The identity of the delimiting character is lost. Caveat: The identity of the delimiting character is lost.
See also mbssep(). */ See also mbssep(). */
extern char * mbstok_r (char *string, const char *delim, char **save_ptr) _GL_EXTERN_C char * mbstok_r (char *string, const char *delim, char **save_ptr)
_GL_ARG_NONNULL ((2, 3)); _GL_ARG_NONNULL ((2, 3));
#endif #endif
/* Map any int, typically from errno, into an error message. */ /* Map any int, typically from errno, into an error message. */
#if @GNULIB_STRERROR@ #if @GNULIB_STRERROR@
# if @REPLACE_STRERROR@ # if @REPLACE_STRERROR@
# undef strerror # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define strerror rpl_strerror # undef strerror
extern char *strerror (int); # define strerror rpl_strerror
# endif
_GL_FUNCDECL_RPL (strerror, char *, (int));
_GL_CXXALIAS_RPL (strerror, char *, (int));
# else
_GL_CXXALIAS_SYS (strerror, char *, (int));
# endif # endif
_GL_CXXALIASWARN (strerror);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strerror # undef strerror
/* Assume strerror is always declared. */ /* Assume strerror is always declared. */
@ -608,11 +843,20 @@ _GL_WARN_ON_USE (strerror, "strerror is unportable - "
#if @GNULIB_STRSIGNAL@ #if @GNULIB_STRSIGNAL@
# if @REPLACE_STRSIGNAL@ # if @REPLACE_STRSIGNAL@
# define strsignal rpl_strsignal # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# endif # define strsignal rpl_strsignal
# if ! @HAVE_DECL_STRSIGNAL@ || @REPLACE_STRSIGNAL@ # endif
extern char *strsignal (int __sig); _GL_FUNCDECL_RPL (strsignal, char *, (int __sig));
_GL_CXXALIAS_RPL (strsignal, char *, (int __sig));
# else
# if ! @HAVE_DECL_STRSIGNAL@
_GL_FUNCDECL_SYS (strsignal, char *, (int __sig));
# endif
/* Need to cast, because on Cygwin 1.5.x systems, the return type is
'const char *'. */
_GL_CXXALIAS_SYS_CAST (strsignal, char *, (int __sig));
# endif # endif
_GL_CXXALIASWARN (strsignal);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strsignal # undef strsignal
# if HAVE_RAW_DECL_STRSIGNAL # if HAVE_RAW_DECL_STRSIGNAL
@ -623,8 +867,11 @@ _GL_WARN_ON_USE (strsignal, "strsignal is unportable - "
#if @GNULIB_STRVERSCMP@ #if @GNULIB_STRVERSCMP@
# if !@HAVE_STRVERSCMP@ # if !@HAVE_STRVERSCMP@
extern int strverscmp (const char *, const char *) _GL_ARG_NONNULL ((1, 2)); _GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *)
_GL_ARG_NONNULL ((1, 2)));
# endif # endif
_GL_CXXALIAS_SYS (strverscmp, int, (const char *, const char *));
_GL_CXXALIASWARN (strverscmp);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef strverscmp # undef strverscmp
# if HAVE_RAW_DECL_STRVERSCMP # if HAVE_RAW_DECL_STRVERSCMP
@ -634,9 +881,5 @@ _GL_WARN_ON_USE (strverscmp, "strverscmp is unportable - "
#endif #endif
#ifdef __cplusplus
}
#endif
#endif /* _GL_STRING_H */ #endif /* _GL_STRING_H */
#endif /* _GL_STRING_H */ #endif /* _GL_STRING_H */

View file

@ -23,10 +23,24 @@
It is intended to provide definitions and prototypes needed by an It is intended to provide definitions and prototypes needed by an
application. */ application. */
#if defined _GL_ALREADY_INCLUDING_SYS_SOCKET_H
/* Special invocation convention:
- On Cygwin 1.5.x we have a sequence of nested includes
<sys/socket.h> -> <cygwin/socket.h> -> <asm/socket.h> -> <cygwin/if.h>,
and the latter includes <sys/socket.h>. In this situation, the functions
are not yet declared, therefore we cannot provide the C++ aliases. */
#@INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
#else
/* Normal invocation convention. */
#ifndef _GL_SYS_SOCKET_H #ifndef _GL_SYS_SOCKET_H
#if @HAVE_SYS_SOCKET_H@ #if @HAVE_SYS_SOCKET_H@
# define _GL_ALREADY_INCLUDING_SYS_SOCKET_H
# if __GNUC__ >= 3 # if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@ @PRAGMA_SYSTEM_HEADER@
# endif # endif
@ -38,13 +52,19 @@
/* The include_next requires a split double-inclusion guard. */ /* The include_next requires a split double-inclusion guard. */
# @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@ # @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
# undef _GL_ALREADY_INCLUDING_SYS_SOCKET_H
#endif #endif
#ifndef _GL_SYS_SOCKET_H #ifndef _GL_SYS_SOCKET_H
#define _GL_SYS_SOCKET_H #define _GL_SYS_SOCKET_H
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */ /* The definition of _GL_ARG_NONNULL is copied here. */
/* The definition of _GL_WARN_ON_USE is copied here. */
#if !@HAVE_SA_FAMILY_T@ #if !@HAVE_SA_FAMILY_T@
typedef unsigned short sa_family_t; typedef unsigned short sa_family_t;
#endif #endif
@ -126,8 +146,6 @@ struct sockaddr_storage
# define SHUT_RDWR SD_BOTH # define SHUT_RDWR SD_BOTH
# endif # endif
/* The definition of _GL_WARN_ON_USE is copied here. */
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
/* Include headers needed by the emulation code. */ /* Include headers needed by the emulation code. */
# include <sys/types.h> # include <sys/types.h>
@ -137,11 +155,9 @@ typedef int socklen_t;
# endif # endif
# ifdef __cplusplus #endif
extern "C" {
# endif
# if @HAVE_WINSOCK2_H@ #if @HAVE_WINSOCK2_H@
/* Re-define FD_ISSET to avoid a WSA call while we are not using /* Re-define FD_ISSET to avoid a WSA call while we are not using
network sockets. */ network sockets. */
@ -159,280 +175,404 @@ rpl_fd_isset (SOCKET fd, fd_set * set)
return 0; return 0;
} }
# undef FD_ISSET # undef FD_ISSET
# define FD_ISSET(fd, set) rpl_fd_isset(fd, set) # define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
# endif #endif
/* Wrap everything else to use libc file descriptors for sockets. */ /* Wrap everything else to use libc file descriptors for sockets. */
# if @HAVE_WINSOCK2_H@ && !defined _GL_UNISTD_H #if @HAVE_WINSOCK2_H@ && !defined _GL_UNISTD_H
# undef close # undef close
# define close close_used_without_including_unistd_h # define close close_used_without_including_unistd_h
# endif #endif
# if @HAVE_WINSOCK2_H@ && !defined _GL_UNISTD_H #if @HAVE_WINSOCK2_H@ && !defined _GL_UNISTD_H
# undef gethostname # undef gethostname
# define gethostname gethostname_used_without_including_unistd_h # define gethostname gethostname_used_without_including_unistd_h
# endif #endif
# if @GNULIB_SOCKET@ #if @GNULIB_SOCKET@
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef socket # undef socket
# define socket rpl_socket # define socket rpl_socket
extern int rpl_socket (int, int, int protocol);
# endif # endif
# elif @HAVE_WINSOCK2_H@ _GL_FUNCDECL_RPL (socket, int, (int domain, int type, int protocol));
# undef socket _GL_CXXALIAS_RPL (socket, int, (int domain, int type, int protocol));
# define socket socket_used_without_requesting_gnulib_module_socket # else
# elif defined GNULIB_POSIXCHECK _GL_CXXALIAS_SYS (socket, int, (int domain, int type, int protocol));
# undef socket # endif
# if HAVE_RAW_DECL_SOCKET _GL_CXXALIASWARN (socket);
#elif @HAVE_WINSOCK2_H@
# undef socket
# define socket socket_used_without_requesting_gnulib_module_socket
#elif defined GNULIB_POSIXCHECK
# undef socket
# if HAVE_RAW_DECL_SOCKET
_GL_WARN_ON_USE (socket, "socket is not always POSIX compliant - " _GL_WARN_ON_USE (socket, "socket is not always POSIX compliant - "
"use gnulib module socket for portability"); "use gnulib module socket for portability");
# endif
# endif # endif
#endif
# if @GNULIB_CONNECT@ #if @GNULIB_CONNECT@
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef connect # undef connect
# define connect rpl_connect # define connect rpl_connect
extern int rpl_connect (int, struct sockaddr *, int) _GL_ARG_NONNULL ((2));
# endif # endif
# elif @HAVE_WINSOCK2_H@ _GL_FUNCDECL_RPL (connect, int,
# undef connect (int fd, const struct sockaddr *addr, socklen_t addrlen)
# define connect socket_used_without_requesting_gnulib_module_connect _GL_ARG_NONNULL ((2)));
# elif defined GNULIB_POSIXCHECK _GL_CXXALIAS_RPL (connect, int,
# undef connect (int fd, const struct sockaddr *addr, socklen_t addrlen));
# if HAVE_RAW_DECL_CONNECT # else
_GL_CXXALIAS_SYS (connect, int,
(int fd, const struct sockaddr *addr, socklen_t addrlen));
# endif
_GL_CXXALIASWARN (connect);
#elif @HAVE_WINSOCK2_H@
# undef connect
# define connect socket_used_without_requesting_gnulib_module_connect
#elif defined GNULIB_POSIXCHECK
# undef connect
# if HAVE_RAW_DECL_CONNECT
_GL_WARN_ON_USE (connect, "connect is not always POSIX compliant - " _GL_WARN_ON_USE (connect, "connect is not always POSIX compliant - "
"use gnulib module connect for portability"); "use gnulib module connect for portability");
# endif
# endif # endif
#endif
# if @GNULIB_ACCEPT@ #if @GNULIB_ACCEPT@
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef accept # undef accept
# define accept rpl_accept # define accept rpl_accept
extern int rpl_accept (int, struct sockaddr *, int *);
# endif # endif
# elif @HAVE_WINSOCK2_H@ _GL_FUNCDECL_RPL (accept, int,
# undef accept (int fd, struct sockaddr *addr, socklen_t *addrlen));
# define accept accept_used_without_requesting_gnulib_module_accept _GL_CXXALIAS_RPL (accept, int,
# elif defined GNULIB_POSIXCHECK (int fd, struct sockaddr *addr, socklen_t *addrlen));
# undef accept # else
/* Need to cast, because on Solaris 10 systems, the third parameter is
void *addrlen. */
_GL_CXXALIAS_SYS_CAST (accept, int,
(int fd, struct sockaddr *addr, socklen_t *addrlen));
# endif
_GL_CXXALIASWARN (accept);
#elif @HAVE_WINSOCK2_H@
# undef accept
# define accept accept_used_without_requesting_gnulib_module_accept
#elif defined GNULIB_POSIXCHECK
# undef accept
# if HAVE_RAW_DECL_ACCEPT # if HAVE_RAW_DECL_ACCEPT
_GL_WARN_ON_USE (accept, "accept is not always POSIX compliant - " _GL_WARN_ON_USE (accept, "accept is not always POSIX compliant - "
"use gnulib module accept for portability"); "use gnulib module accept for portability");
# endif
# endif # endif
#endif
# if @GNULIB_BIND@ #if @GNULIB_BIND@
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef bind # undef bind
# define bind rpl_bind # define bind rpl_bind
extern int rpl_bind (int, struct sockaddr *, int) _GL_ARG_NONNULL ((2));
# endif # endif
# elif @HAVE_WINSOCK2_H@ _GL_FUNCDECL_RPL (bind, int,
# undef bind (int fd, const struct sockaddr *addr, socklen_t addrlen)
# define bind bind_used_without_requesting_gnulib_module_bind _GL_ARG_NONNULL ((2)));
# elif defined GNULIB_POSIXCHECK _GL_CXXALIAS_RPL (bind, int,
# undef bind (int fd, const struct sockaddr *addr, socklen_t addrlen));
# if HAVE_RAW_DECL_BIND # else
_GL_CXXALIAS_SYS (bind, int,
(int fd, const struct sockaddr *addr, socklen_t addrlen));
# endif
_GL_CXXALIASWARN (bind);
#elif @HAVE_WINSOCK2_H@
# undef bind
# define bind bind_used_without_requesting_gnulib_module_bind
#elif defined GNULIB_POSIXCHECK
# undef bind
# if HAVE_RAW_DECL_BIND
_GL_WARN_ON_USE (bind, "bind is not always POSIX compliant - " _GL_WARN_ON_USE (bind, "bind is not always POSIX compliant - "
"use gnulib module bind for portability"); "use gnulib module bind for portability");
# endif
# endif # endif
#endif
# if @GNULIB_GETPEERNAME@ #if @GNULIB_GETPEERNAME@
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef getpeername # undef getpeername
# define getpeername rpl_getpeername # define getpeername rpl_getpeername
extern int rpl_getpeername (int, struct sockaddr *, int *)
_GL_ARG_NONNULL ((2, 3));
# endif # endif
# elif @HAVE_WINSOCK2_H@ _GL_FUNCDECL_RPL (getpeername, int,
# undef getpeername (int fd, struct sockaddr *addr, socklen_t *addrlen)
# define getpeername getpeername_used_without_requesting_gnulib_module_getpeername _GL_ARG_NONNULL ((2, 3)));
# elif defined GNULIB_POSIXCHECK _GL_CXXALIAS_RPL (getpeername, int,
# undef getpeername (int fd, struct sockaddr *addr, socklen_t *addrlen));
# if HAVE_RAW_DECL_GETPEERNAME # else
/* Need to cast, because on Solaris 10 systems, the third parameter is
void *addrlen. */
_GL_CXXALIAS_SYS_CAST (getpeername, int,
(int fd, struct sockaddr *addr, socklen_t *addrlen));
# endif
_GL_CXXALIASWARN (getpeername);
#elif @HAVE_WINSOCK2_H@
# undef getpeername
# define getpeername getpeername_used_without_requesting_gnulib_module_getpeername
#elif defined GNULIB_POSIXCHECK
# undef getpeername
# if HAVE_RAW_DECL_GETPEERNAME
_GL_WARN_ON_USE (getpeername, "getpeername is not always POSIX compliant - " _GL_WARN_ON_USE (getpeername, "getpeername is not always POSIX compliant - "
"use gnulib module getpeername for portability"); "use gnulib module getpeername for portability");
# endif
# endif # endif
#endif
# if @GNULIB_GETSOCKNAME@ #if @GNULIB_GETSOCKNAME@
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef getsockname # undef getsockname
# define getsockname rpl_getsockname # define getsockname rpl_getsockname
extern int rpl_getsockname (int, struct sockaddr *, int *)
_GL_ARG_NONNULL ((2, 3));
# endif # endif
# elif @HAVE_WINSOCK2_H@ _GL_FUNCDECL_RPL (getsockname, int,
# undef getsockname (int fd, struct sockaddr *addr, socklen_t *addrlen)
# define getsockname getsockname_used_without_requesting_gnulib_module_getsockname _GL_ARG_NONNULL ((2, 3)));
# elif defined GNULIB_POSIXCHECK _GL_CXXALIAS_RPL (getsockname, int,
# undef getsockname (int fd, struct sockaddr *addr, socklen_t *addrlen));
# if HAVE_RAW_DECL_GETSOCKNAME # else
/* Need to cast, because on Solaris 10 systems, the third parameter is
void *addrlen. */
_GL_CXXALIAS_SYS_CAST (getsockname, int,
(int fd, struct sockaddr *addr, socklen_t *addrlen));
# endif
_GL_CXXALIASWARN (getsockname);
#elif @HAVE_WINSOCK2_H@
# undef getsockname
# define getsockname getsockname_used_without_requesting_gnulib_module_getsockname
#elif defined GNULIB_POSIXCHECK
# undef getsockname
# if HAVE_RAW_DECL_GETSOCKNAME
_GL_WARN_ON_USE (getsockname, "getsockname is not always POSIX compliant - " _GL_WARN_ON_USE (getsockname, "getsockname is not always POSIX compliant - "
"use gnulib module getsockname for portability"); "use gnulib module getsockname for portability");
# endif
# endif # endif
#endif
# if @GNULIB_GETSOCKOPT@ #if @GNULIB_GETSOCKOPT@
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef getsockopt # undef getsockopt
# define getsockopt rpl_getsockopt # define getsockopt rpl_getsockopt
extern int rpl_getsockopt (int, int, int, void *, socklen_t *)
_GL_ARG_NONNULL ((4, 5));
# endif # endif
# elif @HAVE_WINSOCK2_H@ _GL_FUNCDECL_RPL (getsockopt, int, (int fd, int level, int optname,
# undef getsockopt void *optval, socklen_t *optlen)
# define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt _GL_ARG_NONNULL ((4, 5)));
# elif defined GNULIB_POSIXCHECK _GL_CXXALIAS_RPL (getsockopt, int, (int fd, int level, int optname,
# undef getsockopt void *optval, socklen_t *optlen));
# if HAVE_RAW_DECL_GETSOCKOPT # else
/* Need to cast, because on Solaris 10 systems, the fifth parameter is
void *optlen. */
_GL_CXXALIAS_SYS_CAST (getsockopt, int, (int fd, int level, int optname,
void *optval, socklen_t *optlen));
# endif
_GL_CXXALIASWARN (getsockopt);
#elif @HAVE_WINSOCK2_H@
# undef getsockopt
# define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt
#elif defined GNULIB_POSIXCHECK
# undef getsockopt
# if HAVE_RAW_DECL_GETSOCKOPT
_GL_WARN_ON_USE (getsockopt, "getsockopt is not always POSIX compliant - " _GL_WARN_ON_USE (getsockopt, "getsockopt is not always POSIX compliant - "
"use gnulib module getsockopt for portability"); "use gnulib module getsockopt for portability");
# endif
# endif # endif
#endif
# if @GNULIB_LISTEN@ #if @GNULIB_LISTEN@
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef listen # undef listen
# define listen rpl_listen # define listen rpl_listen
extern int rpl_listen (int, int);
# endif # endif
# elif @HAVE_WINSOCK2_H@ _GL_FUNCDECL_RPL (listen, int, (int fd, int backlog));
# undef listen _GL_CXXALIAS_RPL (listen, int, (int fd, int backlog));
# define listen listen_used_without_requesting_gnulib_module_listen # else
# elif defined GNULIB_POSIXCHECK _GL_CXXALIAS_SYS (listen, int, (int fd, int backlog));
# undef listen # endif
# if HAVE_RAW_DECL_LISTEN _GL_CXXALIASWARN (listen);
#elif @HAVE_WINSOCK2_H@
# undef listen
# define listen listen_used_without_requesting_gnulib_module_listen
#elif defined GNULIB_POSIXCHECK
# undef listen
# if HAVE_RAW_DECL_LISTEN
_GL_WARN_ON_USE (listen, "listen is not always POSIX compliant - " _GL_WARN_ON_USE (listen, "listen is not always POSIX compliant - "
"use gnulib module listen for portability"); "use gnulib module listen for portability");
# endif
# endif # endif
#endif
# if @GNULIB_RECV@ #if @GNULIB_RECV@
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef recv # undef recv
# define recv rpl_recv # define recv rpl_recv
extern int rpl_recv (int, void *, int, int) _GL_ARG_NONNULL ((2));
# endif # endif
# elif @HAVE_WINSOCK2_H@ _GL_FUNCDECL_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags)
# undef recv _GL_ARG_NONNULL ((2)));
# define recv recv_used_without_requesting_gnulib_module_recv _GL_CXXALIAS_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags));
# elif defined GNULIB_POSIXCHECK # else
# undef recv _GL_CXXALIAS_SYS (recv, ssize_t, (int fd, void *buf, size_t len, int flags));
# if HAVE_RAW_DECL_RECV # endif
_GL_CXXALIASWARN (recv);
#elif @HAVE_WINSOCK2_H@
# undef recv
# define recv recv_used_without_requesting_gnulib_module_recv
#elif defined GNULIB_POSIXCHECK
# undef recv
# if HAVE_RAW_DECL_RECV
_GL_WARN_ON_USE (recv, "recv is not always POSIX compliant - " _GL_WARN_ON_USE (recv, "recv is not always POSIX compliant - "
"use gnulib module recv for portability"); "use gnulib module recv for portability");
# endif
# endif # endif
#endif
# if @GNULIB_SEND@ #if @GNULIB_SEND@
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef send # undef send
# define send rpl_send # define send rpl_send
extern int rpl_send (int, const void *, int, int) _GL_ARG_NONNULL ((2));
# endif # endif
# elif @HAVE_WINSOCK2_H@ _GL_FUNCDECL_RPL (send, ssize_t,
# undef send (int fd, const void *buf, size_t len, int flags)
# define send send_used_without_requesting_gnulib_module_send _GL_ARG_NONNULL ((2)));
# elif defined GNULIB_POSIXCHECK _GL_CXXALIAS_RPL (send, ssize_t,
# undef send (int fd, const void *buf, size_t len, int flags));
# if HAVE_RAW_DECL_SEND # else
_GL_CXXALIAS_SYS (send, ssize_t,
(int fd, const void *buf, size_t len, int flags));
# endif
_GL_CXXALIASWARN (send);
#elif @HAVE_WINSOCK2_H@
# undef send
# define send send_used_without_requesting_gnulib_module_send
#elif defined GNULIB_POSIXCHECK
# undef send
# if HAVE_RAW_DECL_SEND
_GL_WARN_ON_USE (send, "send is not always POSIX compliant - " _GL_WARN_ON_USE (send, "send is not always POSIX compliant - "
"use gnulib module send for portability"); "use gnulib module send for portability");
# endif
# endif # endif
#endif
# if @GNULIB_RECVFROM@ #if @GNULIB_RECVFROM@
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef recvfrom # undef recvfrom
# define recvfrom rpl_recvfrom # define recvfrom rpl_recvfrom
extern int rpl_recvfrom (int, void *, int, int, struct sockaddr *, int *)
_GL_ARG_NONNULL ((2));
# endif # endif
# elif @HAVE_WINSOCK2_H@ _GL_FUNCDECL_RPL (recvfrom, ssize_t,
# undef recvfrom (int fd, void *buf, size_t len, int flags,
# define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom struct sockaddr *from, socklen_t *fromlen)
# elif defined GNULIB_POSIXCHECK _GL_ARG_NONNULL ((2)));
# undef recvfrom _GL_CXXALIAS_RPL (recvfrom, ssize_t,
# if HAVE_RAW_DECL_RECVFROM (int fd, void *buf, size_t len, int flags,
struct sockaddr *from, socklen_t *fromlen));
# else
/* Need to cast, because on Solaris 10 systems, the sixth parameter is
void *fromlen. */
_GL_CXXALIAS_SYS_CAST (recvfrom, ssize_t,
(int fd, void *buf, size_t len, int flags,
struct sockaddr *from, socklen_t *fromlen));
# endif
_GL_CXXALIASWARN (recvfrom);
#elif @HAVE_WINSOCK2_H@
# undef recvfrom
# define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom
#elif defined GNULIB_POSIXCHECK
# undef recvfrom
# if HAVE_RAW_DECL_RECVFROM
_GL_WARN_ON_USE (recvfrom, "recvfrom is not always POSIX compliant - " _GL_WARN_ON_USE (recvfrom, "recvfrom is not always POSIX compliant - "
"use gnulib module recvfrom for portability"); "use gnulib module recvfrom for portability");
# endif
# endif # endif
#endif
# if @GNULIB_SENDTO@ #if @GNULIB_SENDTO@
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef sendto # undef sendto
# define sendto rpl_sendto # define sendto rpl_sendto
extern int rpl_sendto (int, const void *, int, int, struct sockaddr *, int)
_GL_ARG_NONNULL ((2));
# endif # endif
# elif @HAVE_WINSOCK2_H@ _GL_FUNCDECL_RPL (sendto, ssize_t,
# undef sendto (int fd, const void *buf, size_t len, int flags,
# define sendto sendto_used_without_requesting_gnulib_module_sendto const struct sockaddr *to, socklen_t tolen)
# elif defined GNULIB_POSIXCHECK _GL_ARG_NONNULL ((2)));
# undef sendto _GL_CXXALIAS_RPL (sendto, ssize_t,
# if HAVE_RAW_DECL_SENDTO (int fd, const void *buf, size_t len, int flags,
const struct sockaddr *to, socklen_t tolen));
# else
_GL_CXXALIAS_SYS (sendto, ssize_t,
(int fd, const void *buf, size_t len, int flags,
const struct sockaddr *to, socklen_t tolen));
# endif
_GL_CXXALIASWARN (sendto);
#elif @HAVE_WINSOCK2_H@
# undef sendto
# define sendto sendto_used_without_requesting_gnulib_module_sendto
#elif defined GNULIB_POSIXCHECK
# undef sendto
# if HAVE_RAW_DECL_SENDTO
_GL_WARN_ON_USE (sendto, "sendto is not always POSIX compliant - " _GL_WARN_ON_USE (sendto, "sendto is not always POSIX compliant - "
"use gnulib module sendto for portability"); "use gnulib module sendto for portability");
# endif
# endif # endif
#endif
# if @GNULIB_SETSOCKOPT@ #if @GNULIB_SETSOCKOPT@
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef setsockopt # undef setsockopt
# define setsockopt rpl_setsockopt # define setsockopt rpl_setsockopt
extern int rpl_setsockopt (int, int, int, const void *, socklen_t)
_GL_ARG_NONNULL ((4));
# endif # endif
# elif @HAVE_WINSOCK2_H@ _GL_FUNCDECL_RPL (setsockopt, int, (int fd, int level, int optname,
# undef setsockopt const void * optval, socklen_t optlen)
# define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt _GL_ARG_NONNULL ((4)));
# elif defined GNULIB_POSIXCHECK _GL_CXXALIAS_RPL (setsockopt, int, (int fd, int level, int optname,
# undef setsockopt const void * optval, socklen_t optlen));
# if HAVE_RAW_DECL_SETSOCKOPT # else
_GL_CXXALIAS_SYS (setsockopt, int, (int fd, int level, int optname,
const void * optval, socklen_t optlen));
# endif
_GL_CXXALIASWARN (setsockopt);
#elif @HAVE_WINSOCK2_H@
# undef setsockopt
# define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt
#elif defined GNULIB_POSIXCHECK
# undef setsockopt
# if HAVE_RAW_DECL_SETSOCKOPT
_GL_WARN_ON_USE (setsockopt, "setsockopt is not always POSIX compliant - " _GL_WARN_ON_USE (setsockopt, "setsockopt is not always POSIX compliant - "
"use gnulib module setsockopt for portability"); "use gnulib module setsockopt for portability");
# endif
# endif # endif
#endif
# if @GNULIB_SHUTDOWN@ #if @GNULIB_SHUTDOWN@
# if @HAVE_WINSOCK2_H@ # if @HAVE_WINSOCK2_H@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef shutdown # undef shutdown
# define shutdown rpl_shutdown # define shutdown rpl_shutdown
extern int rpl_shutdown (int, int);
# endif # endif
# elif @HAVE_WINSOCK2_H@ _GL_FUNCDECL_RPL (shutdown, int, (int fd, int how));
# undef shutdown _GL_CXXALIAS_RPL (shutdown, int, (int fd, int how));
# define shutdown shutdown_used_without_requesting_gnulib_module_shutdown # else
# elif defined GNULIB_POSIXCHECK _GL_CXXALIAS_SYS (shutdown, int, (int fd, int how));
# undef shutdown # endif
# if HAVE_RAW_DECL_SHUTDOWN _GL_CXXALIASWARN (shutdown);
#elif @HAVE_WINSOCK2_H@
# undef shutdown
# define shutdown shutdown_used_without_requesting_gnulib_module_shutdown
#elif defined GNULIB_POSIXCHECK
# undef shutdown
# if HAVE_RAW_DECL_SHUTDOWN
_GL_WARN_ON_USE (shutdown, "shutdown is not always POSIX compliant - " _GL_WARN_ON_USE (shutdown, "shutdown is not always POSIX compliant - "
"use gnulib module shutdown for portability"); "use gnulib module shutdown for portability");
# endif
# endif # endif
#endif
# if @HAVE_WINSOCK2_H@ #if @HAVE_WINSOCK2_H@
# undef select # undef select
# define select select_used_without_including_sys_select_h # define select select_used_without_including_sys_select_h
# endif
# ifdef __cplusplus
}
# endif
#endif /* HAVE_SYS_SOCKET_H */
#ifdef __cplusplus
extern "C" {
#endif #endif
#if @GNULIB_ACCEPT4@ #if @GNULIB_ACCEPT4@
@ -442,10 +582,24 @@ extern "C" {
See also the Linux man page at See also the Linux man page at
<http://www.kernel.org/doc/man-pages/online/pages/man2/accept4.2.html>. */ <http://www.kernel.org/doc/man-pages/online/pages/man2/accept4.2.html>. */
# if @HAVE_ACCEPT4@ # if @HAVE_ACCEPT4@
# define accept4 rpl_accept4 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define accept4 rpl_accept4
# endif
_GL_FUNCDECL_RPL (accept4, int,
(int sockfd, struct sockaddr *addr, socklen_t *addrlen,
int flags));
_GL_CXXALIAS_RPL (accept4, int,
(int sockfd, struct sockaddr *addr, socklen_t *addrlen,
int flags));
# else
_GL_FUNCDECL_SYS (accept4, int,
(int sockfd, struct sockaddr *addr, socklen_t *addrlen,
int flags));
_GL_CXXALIAS_SYS (accept4, int,
(int sockfd, struct sockaddr *addr, socklen_t *addrlen,
int flags));
# endif # endif
extern int accept4 (int sockfd, struct sockaddr *addr, socklen_t *addrlen, _GL_CXXALIASWARN (accept4);
int flags);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef accept4 # undef accept4
# if HAVE_RAW_DECL_ACCEPT4 # if HAVE_RAW_DECL_ACCEPT4
@ -454,9 +608,6 @@ _GL_WARN_ON_USE (accept4, "accept4 is unportable - "
# endif # endif
#endif #endif
#ifdef __cplusplus #endif /* _GL_SYS_SOCKET_H */
} #endif /* _GL_SYS_SOCKET_H */
#endif #endif
#endif /* _GL_SYS_SOCKET_H */
#endif /* _GL_SYS_SOCKET_H */

View file

@ -47,6 +47,8 @@
#ifndef _GL_SYS_STAT_H #ifndef _GL_SYS_STAT_H
#define _GL_SYS_STAT_H #define _GL_SYS_STAT_H
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */ /* The definition of _GL_ARG_NONNULL is copied here. */
/* The definition of _GL_WARN_ON_USE is copied here. */ /* The definition of _GL_WARN_ON_USE is copied here. */
@ -290,16 +292,15 @@
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
#if @GNULIB_FCHMODAT@ #if @GNULIB_FCHMODAT@
# if !@HAVE_FCHMODAT@ # if !@HAVE_FCHMODAT@
extern int fchmodat (int fd, char const *file, mode_t mode, int flag) _GL_FUNCDECL_SYS (fchmodat, int,
_GL_ARG_NONNULL ((2)); (int fd, char const *file, mode_t mode, int flag)
_GL_ARG_NONNULL ((2)));
# endif # endif
_GL_CXXALIAS_SYS (fchmodat, int,
(int fd, char const *file, mode_t mode, int flag));
_GL_CXXALIASWARN (fchmodat);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef fchmodat # undef fchmodat
# if HAVE_RAW_DECL_FCHMODAT # if HAVE_RAW_DECL_FCHMODAT
@ -310,20 +311,38 @@ _GL_WARN_ON_USE (fchmodat, "fchmodat is not portable - "
#if @REPLACE_FSTAT@ #if @REPLACE_FSTAT@
# define fstat rpl_fstat # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
extern int fstat (int fd, struct stat *buf) _GL_ARG_NONNULL ((2)); # define fstat rpl_fstat
# endif
_GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf) _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf));
#else
_GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf));
#endif #endif
_GL_CXXALIASWARN (fstat);
#if @GNULIB_FSTATAT@ #if @GNULIB_FSTATAT@
# if @REPLACE_FSTATAT@ # if @REPLACE_FSTATAT@
# undef fstatat # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define fstatat rpl_fstatat # undef fstatat
# endif # define fstatat rpl_fstatat
# if !@HAVE_FSTATAT@ || @REPLACE_FSTATAT@ # endif
extern int fstatat (int fd, char const *name, struct stat *st, int flags) _GL_FUNCDECL_RPL (fstatat, int,
_GL_ARG_NONNULL ((2, 3)); (int fd, char const *name, struct stat *st, int flags)
_GL_ARG_NONNULL ((2, 3)));
_GL_CXXALIAS_RPL (fstatat, int,
(int fd, char const *name, struct stat *st, int flags));
# else
# if !@HAVE_FSTATAT@
_GL_FUNCDECL_SYS (fstatat, int,
(int fd, char const *name, struct stat *st, int flags)
_GL_ARG_NONNULL ((2, 3)));
# endif
_GL_CXXALIAS_SYS (fstatat, int,
(int fd, char const *name, struct stat *st, int flags));
# endif # endif
_GL_CXXALIASWARN (fstatat);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef fstatat # undef fstatat
# if HAVE_RAW_DECL_FSTATAT # if HAVE_RAW_DECL_FSTATAT
@ -335,12 +354,19 @@ _GL_WARN_ON_USE (fstatat, "fstatat is not portable - "
#if @GNULIB_FUTIMENS@ #if @GNULIB_FUTIMENS@
# if @REPLACE_FUTIMENS@ # if @REPLACE_FUTIMENS@
# undef futimens # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define futimens rpl_futimens # undef futimens
# endif # define futimens rpl_futimens
# if !@HAVE_FUTIMENS@ || @REPLACE_FUTIMENS@ # endif
extern int futimens (int fd, struct timespec const times[2]); _GL_FUNCDECL_RPL (futimens, int, (int fd, struct timespec const times[2]));
_GL_CXXALIAS_RPL (futimens, int, (int fd, struct timespec const times[2]));
# else
# if !@HAVE_FUTIMENS@
_GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2]));
# endif
_GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2]));
# endif # endif
_GL_CXXALIASWARN (futimens);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef futimens # undef futimens
# if HAVE_RAW_DECL_FUTIMENS # if HAVE_RAW_DECL_FUTIMENS
@ -361,11 +387,18 @@ _GL_WARN_ON_USE (futimens, "futimens is not portable - "
invocation of lchmod, but we know of no workarounds that are invocation of lchmod, but we know of no workarounds that are
reliable in general. You might try requesting support for lchmod reliable in general. You might try requesting support for lchmod
from your operating system supplier. */ from your operating system supplier. */
# define lchmod chmod # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# endif # define lchmod chmod
# if 0 /* assume already declared */ # endif
extern int lchmod (const char *filename, mode_t mode) _GL_ARG_NONNULL ((1)); _GL_CXXALIAS_RPL_1 (lchmod, chmod, int, (const char *filename, mode_t mode));
# else
# if 0 /* assume already declared */
_GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode)
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode));
# endif # endif
_GL_CXXALIASWARN (lchmod);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef lchmod # undef lchmod
# if HAVE_RAW_DECL_LCHMOD # if HAVE_RAW_DECL_LCHMOD
@ -379,13 +412,22 @@ _GL_WARN_ON_USE (lchmod, "lchmod is unportable - "
# if ! @HAVE_LSTAT@ # if ! @HAVE_LSTAT@
/* mingw does not support symlinks, therefore it does not have lstat. But /* mingw does not support symlinks, therefore it does not have lstat. But
without links, stat does just fine. */ without links, stat does just fine. */
# define lstat stat # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define lstat stat
# endif
_GL_CXXALIAS_RPL_1 (lstat, stat, int, (const char *name, struct stat *buf));
# elif @REPLACE_LSTAT@ # elif @REPLACE_LSTAT@
# undef lstat # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define lstat rpl_lstat # undef lstat
extern int rpl_lstat (const char *name, struct stat *buf) # define lstat rpl_lstat
_GL_ARG_NONNULL ((1, 2)); # endif
_GL_FUNCDECL_RPL (lstat, int, (const char *name, struct stat *buf)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (lstat, int, (const char *name, struct stat *buf));
# else
_GL_CXXALIAS_SYS (lstat, int, (const char *name, struct stat *buf));
# endif # endif
_GL_CXXALIASWARN (lstat);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef lstat # undef lstat
# if HAVE_RAW_DECL_LSTAT # if HAVE_RAW_DECL_LSTAT
@ -396,9 +438,13 @@ _GL_WARN_ON_USE (lstat, "lstat is unportable - "
#if @REPLACE_MKDIR@ #if @REPLACE_MKDIR@
# undef mkdir # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mkdir rpl_mkdir # undef mkdir
extern int mkdir (char const *name, mode_t mode) _GL_ARG_NONNULL ((1)); # define mkdir rpl_mkdir
# endif
_GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
#else #else
/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments. /* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
Additionally, it declares _mkdir (and depending on compile flags, an Additionally, it declares _mkdir (and depending on compile flags, an
@ -411,16 +457,24 @@ rpl_mkdir (char const *name, mode_t mode)
return _mkdir (name); return _mkdir (name);
} }
# define mkdir rpl_mkdir # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mkdir rpl_mkdir
# endif
_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
# else
_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
# endif # endif
#endif #endif
_GL_CXXALIASWARN (mkdir);
#if @GNULIB_MKDIRAT@ #if @GNULIB_MKDIRAT@
# if !@HAVE_MKDIRAT@ # if !@HAVE_MKDIRAT@
extern int mkdirat (int fd, char const *file, mode_t mode) _GL_FUNCDECL_SYS (mkdirat, int, (int fd, char const *file, mode_t mode)
_GL_ARG_NONNULL ((2)); _GL_ARG_NONNULL ((2)));
# endif # endif
_GL_CXXALIAS_SYS (mkdirat, int, (int fd, char const *file, mode_t mode));
_GL_CXXALIASWARN (mkdirat);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mkdirat # undef mkdirat
# if HAVE_RAW_DECL_MKDIRAT # if HAVE_RAW_DECL_MKDIRAT
@ -432,12 +486,21 @@ _GL_WARN_ON_USE (mkdirat, "mkdirat is not portable - "
#if @GNULIB_MKFIFO@ #if @GNULIB_MKFIFO@
# if @REPLACE_MKFIFO@ # if @REPLACE_MKFIFO@
# undef mkfifo # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mkfifo rpl_mkfifo # undef mkfifo
# endif # define mkfifo rpl_mkfifo
# if !@HAVE_MKFIFO@ || @REPLACE_MKFIFO@ # endif
extern int mkfifo (char const *file, mode_t mode) _GL_ARG_NONNULL ((1)); _GL_FUNCDECL_RPL (mkfifo, int, (char const *file, mode_t mode)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mkfifo, int, (char const *file, mode_t mode));
# else
# if !@HAVE_MKFIFO@
_GL_FUNCDECL_SYS (mkfifo, int, (char const *file, mode_t mode)
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (mkfifo, int, (char const *file, mode_t mode));
# endif # endif
_GL_CXXALIASWARN (mkfifo);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mkfifo # undef mkfifo
# if HAVE_RAW_DECL_MKFIFO # if HAVE_RAW_DECL_MKFIFO
@ -449,9 +512,11 @@ _GL_WARN_ON_USE (mkfifo, "mkfifo is not portable - "
#if @GNULIB_MKFIFOAT@ #if @GNULIB_MKFIFOAT@
# if !@HAVE_MKFIFOAT@ # if !@HAVE_MKFIFOAT@
extern int mkfifoat (int fd, char const *file, mode_t mode) _GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)
_GL_ARG_NONNULL ((2)); _GL_ARG_NONNULL ((2)));
# endif # endif
_GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode));
_GL_CXXALIASWARN (mkfifoat);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mkfifoat # undef mkfifoat
# if HAVE_RAW_DECL_MKFIFOAT # if HAVE_RAW_DECL_MKFIFOAT
@ -463,13 +528,21 @@ _GL_WARN_ON_USE (mkfifoat, "mkfifoat is not portable - "
#if @GNULIB_MKNOD@ #if @GNULIB_MKNOD@
# if @REPLACE_MKNOD@ # if @REPLACE_MKNOD@
# undef mknod # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mknod rpl_mknod # undef mknod
# endif # define mknod rpl_mknod
# if !@HAVE_MKNOD@ || @REPLACE_MKNOD@ # endif
extern int mknod (char const *file, mode_t mode, dev_t dev) _GL_FUNCDECL_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev)
_GL_ARG_NONNULL ((1)); _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev));
# else
# if !@HAVE_MKNOD@
_GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev)
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev));
# endif # endif
_GL_CXXALIASWARN (mknod);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mknod # undef mknod
# if HAVE_RAW_DECL_MKNOD # if HAVE_RAW_DECL_MKNOD
@ -481,9 +554,13 @@ _GL_WARN_ON_USE (mknod, "mknod is not portable - "
#if @GNULIB_MKNODAT@ #if @GNULIB_MKNODAT@
# if !@HAVE_MKNODAT@ # if !@HAVE_MKNODAT@
extern int mknodat (int fd, char const *file, mode_t mode, dev_t dev) _GL_FUNCDECL_SYS (mknodat, int,
_GL_ARG_NONNULL ((2)); (int fd, char const *file, mode_t mode, dev_t dev)
_GL_ARG_NONNULL ((2)));
# endif # endif
_GL_CXXALIAS_SYS (mknodat, int,
(int fd, char const *file, mode_t mode, dev_t dev));
_GL_CXXALIASWARN (mknodat);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mknodat # undef mknodat
# if HAVE_RAW_DECL_MKNODAT # if HAVE_RAW_DECL_MKNODAT
@ -508,7 +585,7 @@ _GL_WARN_ON_USE (mknodat, "mknodat is not portable - "
# else /* !_LARGE_FILES */ # else /* !_LARGE_FILES */
# define stat(name, st) rpl_stat (name, st) # define stat(name, st) rpl_stat (name, st)
# endif /* !_LARGE_FILES */ # endif /* !_LARGE_FILES */
extern int stat (const char *name, struct stat *buf) _GL_ARG_NONNULL ((1, 2)); _GL_EXTERN_C int stat (const char *name, struct stat *buf) _GL_ARG_NONNULL ((1, 2));
# endif # endif
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef stat # undef stat
@ -521,14 +598,25 @@ _GL_WARN_ON_USE (stat, "stat is unportable - "
#if @GNULIB_UTIMENSAT@ #if @GNULIB_UTIMENSAT@
# if @REPLACE_UTIMENSAT@ # if @REPLACE_UTIMENSAT@
# undef utimensat # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define utimensat rpl_utimensat # undef utimensat
# endif # define utimensat rpl_utimensat
# if !@HAVE_UTIMENSAT@ || @REPLACE_UTIMENSAT@ # endif
extern int utimensat (int fd, char const *name, _GL_FUNCDECL_RPL (utimensat, int, (int fd, char const *name,
struct timespec const times[2], int flag) struct timespec const times[2], int flag)
_GL_ARG_NONNULL ((2)); _GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (utimensat, int, (int fd, char const *name,
struct timespec const times[2], int flag));
# else
# if !@HAVE_UTIMENSAT@
_GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name,
struct timespec const times[2], int flag)
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name,
struct timespec const times[2], int flag));
# endif # endif
_GL_CXXALIASWARN (utimensat);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef utimensat # undef utimensat
# if HAVE_RAW_DECL_UTIMENSAT # if HAVE_RAW_DECL_UTIMENSAT
@ -538,11 +626,6 @@ _GL_WARN_ON_USE (utimensat, "utimensat is not portable - "
#endif #endif
#ifdef __cplusplus
}
#endif
#endif /* _GL_SYS_STAT_H */ #endif /* _GL_SYS_STAT_H */
#endif /* _GL_SYS_STAT_H */ #endif /* _GL_SYS_STAT_H */
#endif #endif

View file

@ -40,8 +40,12 @@
/* NetBSD 5.0 mis-defines NULL. */ /* NetBSD 5.0 mis-defines NULL. */
#include <stddef.h> #include <stddef.h>
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */ /* The definition of _GL_ARG_NONNULL is copied here. */
/* The definition of _GL_WARN_ON_USE is copied here. */
# ifdef __cplusplus # ifdef __cplusplus
extern "C" { extern "C" {
# endif # endif
@ -63,54 +67,117 @@ struct timespec
# endif # endif
# endif # endif
# ifdef __cplusplus
}
# endif
/* Sleep for at least RQTP seconds unless interrupted, If interrupted, /* Sleep for at least RQTP seconds unless interrupted, If interrupted,
return -1 and store the remaining time into RMTP. See return -1 and store the remaining time into RMTP. See
<http://www.opengroup.org/susv3xsh/nanosleep.html>. */ <http://www.opengroup.org/susv3xsh/nanosleep.html>. */
# if @REPLACE_NANOSLEEP@ # if @GNULIB_NANOSLEEP@
# define nanosleep rpl_nanosleep # if @REPLACE_NANOSLEEP@
extern int nanosleep (struct timespec const *__rqtp, struct timespec *__rmtp) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
_GL_ARG_NONNULL ((1)); # define nanosleep rpl_nanosleep
# endif
_GL_FUNCDECL_RPL (nanosleep, int,
(struct timespec const *__rqtp, struct timespec *__rmtp)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (nanosleep, int,
(struct timespec const *__rqtp, struct timespec *__rmtp));
# else
_GL_CXXALIAS_SYS (nanosleep, int,
(struct timespec const *__rqtp, struct timespec *__rmtp));
# endif
_GL_CXXALIASWARN (nanosleep);
# endif # endif
/* Return the 'time_t' representation of TP and normalize TP. */ /* Return the 'time_t' representation of TP and normalize TP. */
# if @REPLACE_MKTIME@ # if @GNULIB_MKTIME@
# define mktime rpl_mktime # if @REPLACE_MKTIME@
extern time_t mktime (struct tm *__tp) _GL_ARG_NONNULL ((1)); # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mktime rpl_mktime
# endif
_GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp));
# else
_GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp));
# endif
_GL_CXXALIASWARN (mktime);
# endif # endif
/* Convert TIMER to RESULT, assuming local time and UTC respectively. See /* Convert TIMER to RESULT, assuming local time and UTC respectively. See
<http://www.opengroup.org/susv3xsh/localtime_r.html> and <http://www.opengroup.org/susv3xsh/localtime_r.html> and
<http://www.opengroup.org/susv3xsh/gmtime_r.html>. */ <http://www.opengroup.org/susv3xsh/gmtime_r.html>. */
# if @REPLACE_LOCALTIME_R@ # if @GNULIB_TIME_R@
# undef localtime_r # if @REPLACE_LOCALTIME_R@
# define localtime_r rpl_localtime_r # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef gmtime_r # undef localtime_r
# define gmtime_r rpl_gmtime_r # define localtime_r rpl_localtime_r
extern struct tm *localtime_r (time_t const *restrict __timer, # endif
struct tm *restrict __result) _GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
_GL_ARG_NONNULL ((1, 2)); struct tm *restrict __result)
extern struct tm *gmtime_r (time_t const *restrict __timer, _GL_ARG_NONNULL ((1, 2)));
struct tm *restrict __result) _GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
_GL_ARG_NONNULL ((1, 2)); struct tm *restrict __result));
# else
_GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result));
# endif
_GL_CXXALIASWARN (localtime_r);
# if @REPLACE_LOCALTIME_R@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef gmtime_r
# define gmtime_r rpl_gmtime_r
# endif
_GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result));
# else
_GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
struct tm *restrict __result));
# endif
_GL_CXXALIASWARN (gmtime_r);
# endif # endif
/* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store /* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
the resulting broken-down time into TM. See the resulting broken-down time into TM. See
<http://www.opengroup.org/susv3xsh/strptime.html>. */ <http://www.opengroup.org/susv3xsh/strptime.html>. */
# if @REPLACE_STRPTIME@ # if @GNULIB_STRPTIME@
# undef strptime # if @REPLACE_STRPTIME@
# define strptime rpl_strptime # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
extern char *strptime (char const *restrict __buf, # undef strptime
char const *restrict __format, # define strptime rpl_strptime
struct tm *restrict __tm) # endif
_GL_ARG_NONNULL ((1, 2, 3)); _GL_FUNCDECL_RPL (strptime, char *, (char const *restrict __buf,
char const *restrict __format,
struct tm *restrict __tm)
_GL_ARG_NONNULL ((1, 2, 3)));
_GL_CXXALIAS_RPL (strptime, char *, (char const *restrict __buf,
char const *restrict __format,
struct tm *restrict __tm));
# else
_GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf,
char const *restrict __format,
struct tm *restrict __tm));
# endif
_GL_CXXALIASWARN (strptime);
# endif # endif
/* Convert TM to a time_t value, assuming UTC. */ /* Convert TM to a time_t value, assuming UTC. */
# if @REPLACE_TIMEGM@ # if @GNULIB_TIMEGM@
# undef timegm # if @REPLACE_TIMEGM@
# define timegm rpl_timegm # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
extern time_t timegm (struct tm *__tm) _GL_ARG_NONNULL ((1)); # undef timegm
# define timegm rpl_timegm
# endif
_GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm));
# else
_GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm));
# endif
_GL_CXXALIASWARN (timegm);
# endif # endif
/* Encourage applications to avoid unsafe functions that can overrun /* Encourage applications to avoid unsafe functions that can overrun
@ -127,8 +194,4 @@ extern time_t timegm (struct tm *__tm) _GL_ARG_NONNULL ((1));
# define ctime_r eschew_ctime_r # define ctime_r eschew_ctime_r
# endif # endif
# ifdef __cplusplus
}
# endif
#endif #endif

File diff suppressed because it is too large Load diff

View file

@ -75,14 +75,12 @@
#ifndef _GL_WCHAR_H #ifndef _GL_WCHAR_H
#define _GL_WCHAR_H #define _GL_WCHAR_H
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */ /* The definition of _GL_ARG_NONNULL is copied here. */
/* The definition of _GL_WARN_ON_USE is copied here. */ /* The definition of _GL_WARN_ON_USE is copied here. */
#ifdef __cplusplus
extern "C" {
#endif
/* Define wint_t. (Also done in wctype.in.h.) */ /* Define wint_t. (Also done in wctype.in.h.) */
#if !@HAVE_WINT_T@ && !defined wint_t #if !@HAVE_WINT_T@ && !defined wint_t
@ -107,12 +105,19 @@ typedef int rpl_mbstate_t;
/* Convert a single-byte character to a wide character. */ /* Convert a single-byte character to a wide character. */
#if @GNULIB_BTOWC@ #if @GNULIB_BTOWC@
# if @REPLACE_BTOWC@ # if @REPLACE_BTOWC@
# undef btowc # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define btowc rpl_btowc # undef btowc
# endif # define btowc rpl_btowc
# if !@HAVE_BTOWC@ || @REPLACE_BTOWC@ # endif
extern wint_t btowc (int c); _GL_FUNCDECL_RPL (btowc, wint_t, (int c));
_GL_CXXALIAS_RPL (btowc, wint_t, (int c));
# else
# if !@HAVE_BTOWC@
_GL_FUNCDECL_SYS (btowc, wint_t, (int c));
# endif
_GL_CXXALIAS_SYS (btowc, wint_t, (int c));
# endif # endif
_GL_CXXALIASWARN (btowc);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef btowc # undef btowc
# if HAVE_RAW_DECL_BTOWC # if HAVE_RAW_DECL_BTOWC
@ -125,13 +130,20 @@ _GL_WARN_ON_USE (btowc, "btowc is unportable - "
/* Convert a wide character to a single-byte character. */ /* Convert a wide character to a single-byte character. */
#if @GNULIB_WCTOB@ #if @GNULIB_WCTOB@
# if @REPLACE_WCTOB@ # if @REPLACE_WCTOB@
# undef wctob # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define wctob rpl_wctob # undef wctob
# endif # define wctob rpl_wctob
# if (!defined wctob && !@HAVE_DECL_WCTOB@) || @REPLACE_WCTOB@ # endif
_GL_FUNCDECL_RPL (wctob, int, (wint_t wc));
_GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
# else
# if !defined wctob && !@HAVE_DECL_WCTOB@
/* wctob is provided by gnulib, or wctob exists but is not declared. */ /* wctob is provided by gnulib, or wctob exists but is not declared. */
extern int wctob (wint_t wc); _GL_FUNCDECL_SYS (wctob, int, (wint_t wc));
# endif
_GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
# endif # endif
_GL_CXXALIASWARN (wctob);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef wctob # undef wctob
# if HAVE_RAW_DECL_WCTOB # if HAVE_RAW_DECL_WCTOB
@ -144,12 +156,19 @@ _GL_WARN_ON_USE (wctob, "wctob is unportable - "
/* Test whether *PS is in the initial state. */ /* Test whether *PS is in the initial state. */
#if @GNULIB_MBSINIT@ #if @GNULIB_MBSINIT@
# if @REPLACE_MBSINIT@ # if @REPLACE_MBSINIT@
# undef mbsinit # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbsinit rpl_mbsinit # undef mbsinit
# endif # define mbsinit rpl_mbsinit
# if !@HAVE_MBSINIT@ || @REPLACE_MBSINIT@ # endif
extern int mbsinit (const mbstate_t *ps); _GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
_GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
# else
# if !@HAVE_MBSINIT@
_GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
# endif
_GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
# endif # endif
_GL_CXXALIASWARN (mbsinit);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mbsinit # undef mbsinit
# if HAVE_RAW_DECL_MBSINIT # if HAVE_RAW_DECL_MBSINIT
@ -162,12 +181,23 @@ _GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
/* Convert a multibyte character to a wide character. */ /* Convert a multibyte character to a wide character. */
#if @GNULIB_MBRTOWC@ #if @GNULIB_MBRTOWC@
# if @REPLACE_MBRTOWC@ # if @REPLACE_MBRTOWC@
# undef mbrtowc # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbrtowc rpl_mbrtowc # undef mbrtowc
# endif # define mbrtowc rpl_mbrtowc
# if !@HAVE_MBRTOWC@ || @REPLACE_MBRTOWC@ # endif
extern size_t mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps); _GL_FUNCDECL_RPL (mbrtowc, size_t,
(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
_GL_CXXALIAS_RPL (mbrtowc, size_t,
(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
# else
# if !@HAVE_MBRTOWC@
_GL_FUNCDECL_SYS (mbrtowc, size_t,
(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
# endif
_GL_CXXALIAS_SYS (mbrtowc, size_t,
(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
# endif # endif
_GL_CXXALIASWARN (mbrtowc);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mbrtowc # undef mbrtowc
# if HAVE_RAW_DECL_MBRTOWC # if HAVE_RAW_DECL_MBRTOWC
@ -180,12 +210,19 @@ _GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
/* Recognize a multibyte character. */ /* Recognize a multibyte character. */
#if @GNULIB_MBRLEN@ #if @GNULIB_MBRLEN@
# if @REPLACE_MBRLEN@ # if @REPLACE_MBRLEN@
# undef mbrlen # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbrlen rpl_mbrlen # undef mbrlen
# endif # define mbrlen rpl_mbrlen
# if !@HAVE_MBRLEN@ || @REPLACE_MBRLEN@ # endif
extern size_t mbrlen (const char *s, size_t n, mbstate_t *ps); _GL_FUNCDECL_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
_GL_CXXALIAS_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
# else
# if !@HAVE_MBRLEN@
_GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
# endif
_GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
# endif # endif
_GL_CXXALIASWARN (mbrlen);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mbrlen # undef mbrlen
# if HAVE_RAW_DECL_MBRLEN # if HAVE_RAW_DECL_MBRLEN
@ -198,13 +235,27 @@ _GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
/* Convert a string to a wide string. */ /* Convert a string to a wide string. */
#if @GNULIB_MBSRTOWCS@ #if @GNULIB_MBSRTOWCS@
# if @REPLACE_MBSRTOWCS@ # if @REPLACE_MBSRTOWCS@
# undef mbsrtowcs # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbsrtowcs rpl_mbsrtowcs # undef mbsrtowcs
# endif # define mbsrtowcs rpl_mbsrtowcs
# if !@HAVE_MBSRTOWCS@ || @REPLACE_MBSRTOWCS@ # endif
extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps) _GL_FUNCDECL_RPL (mbsrtowcs, size_t,
_GL_ARG_NONNULL ((2)); (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (mbsrtowcs, size_t,
(wchar_t *dest, const char **srcp, size_t len,
mbstate_t *ps));
# else
# if !@HAVE_MBSRTOWCS@
_GL_FUNCDECL_SYS (mbsrtowcs, size_t,
(wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (mbsrtowcs, size_t,
(wchar_t *dest, const char **srcp, size_t len,
mbstate_t *ps));
# endif # endif
_GL_CXXALIASWARN (mbsrtowcs);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mbsrtowcs # undef mbsrtowcs
# if HAVE_RAW_DECL_MBSRTOWCS # if HAVE_RAW_DECL_MBSRTOWCS
@ -217,13 +268,29 @@ _GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
/* Convert a string to a wide string. */ /* Convert a string to a wide string. */
#if @GNULIB_MBSNRTOWCS@ #if @GNULIB_MBSNRTOWCS@
# if @REPLACE_MBSNRTOWCS@ # if @REPLACE_MBSNRTOWCS@
# undef mbsnrtowcs # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mbsnrtowcs rpl_mbsnrtowcs # undef mbsnrtowcs
# endif # define mbsnrtowcs rpl_mbsnrtowcs
# if !@HAVE_MBSNRTOWCS@ || @REPLACE_MBSNRTOWCS@ # endif
extern size_t mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, size_t len, mbstate_t *ps) _GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
_GL_ARG_NONNULL ((2)); (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
mbstate_t *ps)
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
(wchar_t *dest, const char **srcp, size_t srclen, size_t len,
mbstate_t *ps));
# else
# if !@HAVE_MBSNRTOWCS@
_GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
(wchar_t *dest, const char **srcp, size_t srclen, size_t len,
mbstate_t *ps)
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
(wchar_t *dest, const char **srcp, size_t srclen, size_t len,
mbstate_t *ps));
# endif # endif
_GL_CXXALIASWARN (mbsnrtowcs);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef mbsnrtowcs # undef mbsnrtowcs
# if HAVE_RAW_DECL_MBSNRTOWCS # if HAVE_RAW_DECL_MBSNRTOWCS
@ -236,12 +303,19 @@ _GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
/* Convert a wide character to a multibyte character. */ /* Convert a wide character to a multibyte character. */
#if @GNULIB_WCRTOMB@ #if @GNULIB_WCRTOMB@
# if @REPLACE_WCRTOMB@ # if @REPLACE_WCRTOMB@
# undef wcrtomb # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define wcrtomb rpl_wcrtomb # undef wcrtomb
# endif # define wcrtomb rpl_wcrtomb
# if !@HAVE_WCRTOMB@ || @REPLACE_WCRTOMB@ # endif
extern size_t wcrtomb (char *s, wchar_t wc, mbstate_t *ps); _GL_FUNCDECL_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
_GL_CXXALIAS_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
# else
# if !@HAVE_WCRTOMB@
_GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
# endif
_GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
# endif # endif
_GL_CXXALIASWARN (wcrtomb);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef wcrtomb # undef wcrtomb
# if HAVE_RAW_DECL_WCRTOMB # if HAVE_RAW_DECL_WCRTOMB
@ -254,13 +328,27 @@ _GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
/* Convert a wide string to a string. */ /* Convert a wide string to a string. */
#if @GNULIB_WCSRTOMBS@ #if @GNULIB_WCSRTOMBS@
# if @REPLACE_WCSRTOMBS@ # if @REPLACE_WCSRTOMBS@
# undef wcsrtombs # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define wcsrtombs rpl_wcsrtombs # undef wcsrtombs
# endif # define wcsrtombs rpl_wcsrtombs
# if !@HAVE_WCSRTOMBS@ || @REPLACE_WCSRTOMBS@ # endif
extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps) _GL_FUNCDECL_RPL (wcsrtombs, size_t,
_GL_ARG_NONNULL ((2)); (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (wcsrtombs, size_t,
(char *dest, const wchar_t **srcp, size_t len,
mbstate_t *ps));
# else
# if !@HAVE_WCSRTOMBS@
_GL_FUNCDECL_SYS (wcsrtombs, size_t,
(char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (wcsrtombs, size_t,
(char *dest, const wchar_t **srcp, size_t len,
mbstate_t *ps));
# endif # endif
_GL_CXXALIASWARN (wcsrtombs);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef wcsrtombs # undef wcsrtombs
# if HAVE_RAW_DECL_WCSRTOMBS # if HAVE_RAW_DECL_WCSRTOMBS
@ -273,13 +361,29 @@ _GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
/* Convert a wide string to a string. */ /* Convert a wide string to a string. */
#if @GNULIB_WCSNRTOMBS@ #if @GNULIB_WCSNRTOMBS@
# if @REPLACE_WCSNRTOMBS@ # if @REPLACE_WCSNRTOMBS@
# undef wcsnrtombs # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define wcsnrtombs rpl_wcsnrtombs # undef wcsnrtombs
# endif # define wcsnrtombs rpl_wcsnrtombs
# if !@HAVE_WCSNRTOMBS@ || @REPLACE_WCSNRTOMBS@ # endif
extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, size_t len, mbstate_t *ps) _GL_FUNCDECL_RPL (wcsnrtombs, size_t,
_GL_ARG_NONNULL ((2)); (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
mbstate_t *ps)
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_RPL (wcsnrtombs, size_t,
(char *dest, const wchar_t **srcp, size_t srclen, size_t len,
mbstate_t *ps));
# else
# if !@HAVE_WCSNRTOMBS@
_GL_FUNCDECL_SYS (wcsnrtombs, size_t,
(char *dest, const wchar_t **srcp, size_t srclen, size_t len,
mbstate_t *ps)
_GL_ARG_NONNULL ((2)));
# endif
_GL_CXXALIAS_SYS (wcsnrtombs, size_t,
(char *dest, const wchar_t **srcp, size_t srclen, size_t len,
mbstate_t *ps));
# endif # endif
_GL_CXXALIASWARN (wcsnrtombs);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef wcsnrtombs # undef wcsnrtombs
# if HAVE_RAW_DECL_WCSNRTOMBS # if HAVE_RAW_DECL_WCSNRTOMBS
@ -292,15 +396,20 @@ _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
/* Return the number of screen columns needed for WC. */ /* Return the number of screen columns needed for WC. */
#if @GNULIB_WCWIDTH@ #if @GNULIB_WCWIDTH@
# if @REPLACE_WCWIDTH@ # if @REPLACE_WCWIDTH@
# undef wcwidth # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define wcwidth rpl_wcwidth # undef wcwidth
extern int wcwidth (wchar_t); # define wcwidth rpl_wcwidth
# endif
_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t));
_GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
# else # else
# if !defined wcwidth && !@HAVE_DECL_WCWIDTH@ # if !defined wcwidth && !@HAVE_DECL_WCWIDTH@
/* wcwidth exists but is not declared. */ /* wcwidth exists but is not declared. */
extern int wcwidth (int /* actually wchar_t */); _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t));
# endif # endif
_GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
# endif # endif
_GL_CXXALIASWARN (wcwidth);
#elif defined GNULIB_POSIXCHECK #elif defined GNULIB_POSIXCHECK
# undef wcwidth # undef wcwidth
# if HAVE_RAW_DECL_WCWIDTH # if HAVE_RAW_DECL_WCWIDTH
@ -310,10 +419,6 @@ _GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
#endif #endif
#ifdef __cplusplus
}
#endif
#endif /* _GL_WCHAR_H */ #endif /* _GL_WCHAR_H */
#endif /* _GL_WCHAR_H */ #endif /* _GL_WCHAR_H */
#endif #endif

View file

@ -1,4 +1,4 @@
# duplocale.m4 serial 1 # duplocale.m4 serial 2
dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc. dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -41,6 +41,8 @@ int main ()
case "$gl_cv_func_duplocale_works" in case "$gl_cv_func_duplocale_works" in
*no) REPLACE_DUPLOCALE=1 ;; *no) REPLACE_DUPLOCALE=1 ;;
esac esac
else
HAVE_DUPLOCALE=0
fi fi
if test $REPLACE_DUPLOCALE = 1; then if test $REPLACE_DUPLOCALE = 1; then
gl_REPLACE_LOCALE_H gl_REPLACE_LOCALE_H

20
m4/func.m4 Normal file
View file

@ -0,0 +1,20 @@
# func.m4 serial 2
dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# Written by Simon Josefsson
AC_DEFUN([gl_FUNC],
[
AC_CACHE_CHECK([whether __func__ is available], [gl_cv_var_func],
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]], [[const char *str = __func__;]])],
[gl_cv_var_func=yes],
[gl_cv_var_func=no]))
if test "$gl_cv_var_func" != yes; then
AC_DEFINE([__func__], ["<unknown function>"],
[Define as a replacement for the ISO C99 __func__ variable.])
fi
])

View file

@ -15,7 +15,7 @@
# Specification in the form of a command-line invocation: # Specification in the form of a command-line invocation:
# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --libtool --macro-prefix=gl --no-vc-files alignof alloca-opt announce-gen autobuild byteswap canonicalize-lgpl duplocale environ extensions flock fpieee full-read full-write gendocs getaddrinfo gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton lib-symbol-versions lib-symbol-visibility libunistring locale maintainer-makefile putenv stdlib strcase strftime striconveh string sys_stat verify version-etc-fsf vsnprintf warnings # gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --libtool --macro-prefix=gl --no-vc-files alignof alloca-opt announce-gen autobuild byteswap canonicalize-lgpl duplocale environ extensions flock fpieee full-read full-write func gendocs getaddrinfo gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton lib-symbol-versions lib-symbol-visibility libunistring locale maintainer-makefile putenv stdlib strcase strftime striconveh string sys_stat verify version-etc-fsf vsnprintf warnings
# Specification in the form of a few gnulib-tool.m4 macro invocations: # Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([]) gl_LOCAL_DIR([])
@ -33,6 +33,7 @@ gl_MODULES([
fpieee fpieee
full-read full-read
full-write full-write
func
gendocs gendocs
getaddrinfo getaddrinfo
gitlog-to-changelog gitlog-to-changelog

View file

@ -1,4 +1,4 @@
# gnulib-common.m4 serial 12 # gnulib-common.m4 serial 13
dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -61,9 +61,16 @@ m4_ifndef([AS_VAR_IF],
[AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])]) [AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])])
# AC_PROG_MKDIR_P # AC_PROG_MKDIR_P
# is a backport of autoconf-2.60's AC_PROG_MKDIR_P. # is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix
# Remove this macro when we can assume autoconf >= 2.60. # for interoperability with automake-1.9.6 from autoconf-2.62.
m4_ifdef([AC_PROG_MKDIR_P], [], [ # Remove this macro when we can assume autoconf >= 2.62 or
# autoconf >= 2.60 && automake >= 1.10.
m4_ifdef([AC_PROG_MKDIR_P], [
dnl For automake-1.9.6 && autoconf < 2.62: Ensure MKDIR_P is AC_SUBSTed.
m4_define([AC_PROG_MKDIR_P],
m4_defn([AC_PROG_MKDIR_P])[
AC_SUBST([MKDIR_P])])], [
dnl For autoconf < 2.60: Backport of AC_PROG_MKDIR_P.
AC_DEFUN_ONCE([AC_PROG_MKDIR_P], AC_DEFUN_ONCE([AC_PROG_MKDIR_P],
[AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
MKDIR_P='$(mkdir_p)' MKDIR_P='$(mkdir_p)'

View file

@ -26,14 +26,120 @@ AC_DEFUN([gl_EARLY],
m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
AC_REQUIRE([AC_PROG_RANLIB]) AC_REQUIRE([AC_PROG_RANLIB])
AC_REQUIRE([AM_PROG_CC_C_O]) AC_REQUIRE([AM_PROG_CC_C_O])
# Code from module alignof:
# Code from module alloca-opt:
# Code from module announce-gen:
# Code from module arg-nonnull:
# Code from module arpa_inet:
# Code from module autobuild:
AB_INIT AB_INIT
# Code from module byteswap:
# Code from module c++defs:
# Code from module c-ctype:
# Code from module c-strcase:
# Code from module c-strcaseeq:
# Code from module canonicalize-lgpl:
# Code from module configmake:
# Code from module duplocale:
# Code from module environ:
# Code from module errno:
# Code from module extensions:
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
# Code from module float:
# Code from module flock:
# Code from module fpieee:
AC_REQUIRE([gl_FP_IEEE]) AC_REQUIRE([gl_FP_IEEE])
# Code from module full-read:
# Code from module full-write:
# Code from module func:
# Code from module gendocs:
# Code from module getaddrinfo:
# Code from module gettext-h:
# Code from module gitlog-to-changelog:
# Code from module gnu-web-doc-update:
# Code from module gnumakefile:
# Code from module gnupload:
# Code from module gperf:
# Code from module havelib:
# Code from module hostent:
# Code from module iconv:
# Code from module iconv-h:
# Code from module iconv_open:
# Code from module iconv_open-utf:
# Code from module include_next:
# Code from module inet_ntop:
# Code from module inet_pton:
# Code from module inline:
# Code from module lib-symbol-versions:
# Code from module lib-symbol-visibility:
# Code from module libunistring:
# Code from module localcharset:
# Code from module locale:
# Code from module lstat:
# Code from module maintainer-makefile:
# Code from module malloc-posix:
# Code from module malloca:
# Code from module mbrlen:
# Code from module mbrtowc:
# Code from module mbsinit:
# Code from module memchr:
# Code from module multiarch:
# Code from module netdb:
# Code from module netinet_in:
# Code from module pathmax:
# Code from module putenv:
# Code from module readlink:
# Code from module safe-read:
# Code from module safe-write:
# Code from module servent:
# Code from module size_max:
# Code from module snprintf:
# Code from module socklen:
# Code from module ssize_t:
# Code from module stat:
# Code from module stdarg:
dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode
dnl for the builtin va_copy to work. With Autoconf 2.60 or later, dnl for the builtin va_copy to work. With Autoconf 2.60 or later,
dnl AC_PROG_CC_STDC arranges for this. With older Autoconf AC_PROG_CC_STDC dnl AC_PROG_CC_STDC arranges for this. With older Autoconf AC_PROG_CC_STDC
dnl shouldn't hurt, though installers are on their own to set c99 mode. dnl shouldn't hurt, though installers are on their own to set c99 mode.
AC_REQUIRE([AC_PROG_CC_STDC]) AC_REQUIRE([AC_PROG_CC_STDC])
# Code from module stdbool:
# Code from module stddef:
# Code from module stdint:
# Code from module stdio:
# Code from module stdlib:
# Code from module strcase:
# Code from module streq:
# Code from module strftime:
# Code from module striconveh:
# Code from module string:
# Code from module strings:
# Code from module sys_file:
# Code from module sys_socket:
# Code from module sys_stat:
# Code from module time:
# Code from module time_r:
# Code from module unistd:
# Code from module unistr/base:
# Code from module unistr/u8-mbtouc:
# Code from module unistr/u8-mbtouc-unsafe:
# Code from module unistr/u8-mbtoucr:
# Code from module unistr/u8-prev:
# Code from module unistr/u8-uctomb:
# Code from module unitypes:
# Code from module unused-parameter:
# Code from module useless-if-before-free:
# Code from module vasnprintf:
# Code from module vc-list-files:
# Code from module verify:
# Code from module version-etc:
# Code from module version-etc-fsf:
# Code from module vsnprintf:
# Code from module warn-on-use:
# Code from module warnings:
# Code from module wchar:
# Code from module write:
# Code from module xsize:
]) ])
# This macro should be invoked from ./configure.ac, in the section # This macro should be invoked from ./configure.ac, in the section
@ -49,26 +155,56 @@ AC_DEFUN([gl_INIT],
m4_pushdef([gl_LIBSOURCES_DIR], []) m4_pushdef([gl_LIBSOURCES_DIR], [])
gl_COMMON gl_COMMON
gl_source_base='lib' gl_source_base='lib'
# Code from module alignof:
# Code from module alloca-opt:
gl_FUNC_ALLOCA gl_FUNC_ALLOCA
# Code from module announce-gen:
# Code from module arg-nonnull:
# Code from module arpa_inet:
gl_HEADER_ARPA_INET gl_HEADER_ARPA_INET
AC_PROG_MKDIR_P AC_PROG_MKDIR_P
# Code from module autobuild:
# Code from module byteswap:
gl_BYTESWAP gl_BYTESWAP
# Code from module c++defs:
# Code from module c-ctype:
# Code from module c-strcase:
# Code from module c-strcaseeq:
# Code from module canonicalize-lgpl:
gl_CANONICALIZE_LGPL gl_CANONICALIZE_LGPL
gl_MODULE_INDICATOR([canonicalize-lgpl]) gl_MODULE_INDICATOR([canonicalize-lgpl])
gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name]) gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name])
gl_STDLIB_MODULE_INDICATOR([realpath]) gl_STDLIB_MODULE_INDICATOR([realpath])
# Code from module configmake:
# Code from module duplocale:
gl_FUNC_DUPLOCALE gl_FUNC_DUPLOCALE
gl_LOCALE_MODULE_INDICATOR([duplocale]) gl_LOCALE_MODULE_INDICATOR([duplocale])
# Code from module environ:
gl_ENVIRON gl_ENVIRON
gl_UNISTD_MODULE_INDICATOR([environ]) gl_UNISTD_MODULE_INDICATOR([environ])
# Code from module errno:
gl_HEADER_ERRNO_H gl_HEADER_ERRNO_H
# Code from module extensions:
# Code from module float:
gl_FLOAT_H gl_FLOAT_H
# Code from module flock:
gl_FUNC_FLOCK gl_FUNC_FLOCK
gl_HEADER_SYS_FILE_MODULE_INDICATOR([flock]) gl_HEADER_SYS_FILE_MODULE_INDICATOR([flock])
# Code from module fpieee:
# Code from module full-read:
# Code from module full-write:
# Code from module func:
gl_FUNC
# Code from module gendocs:
# Code from module getaddrinfo:
gl_GETADDRINFO gl_GETADDRINFO
gl_NETDB_MODULE_INDICATOR([getaddrinfo]) gl_NETDB_MODULE_INDICATOR([getaddrinfo])
# Code from module gettext-h:
AC_SUBST([LIBINTL]) AC_SUBST([LIBINTL])
AC_SUBST([LTLIBINTL]) AC_SUBST([LTLIBINTL])
# Code from module gitlog-to-changelog:
# Code from module gnu-web-doc-update:
# Code from module gnumakefile:
# Autoconf 2.61a.99 and earlier don't support linking a file only # Autoconf 2.61a.99 and earlier don't support linking a file only
# in VPATH builds. But since GNUmakefile is for maintainer use # in VPATH builds. But since GNUmakefile is for maintainer use
# only, it does not matter if we skip the link with older autoconf. # only, it does not matter if we skip the link with older autoconf.
@ -79,93 +215,172 @@ AC_DEFUN([gl_INIT],
m4_defn([m4_PACKAGE_VERSION])), [1], [], m4_defn([m4_PACKAGE_VERSION])), [1], [],
[AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [], [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
[GNUmakefile=$GNUmakefile])]) [GNUmakefile=$GNUmakefile])])
# Code from module gnupload:
# Code from module gperf:
# Code from module havelib:
# Code from module hostent:
gl_HOSTENT gl_HOSTENT
# Code from module iconv:
AM_ICONV AM_ICONV
# Code from module iconv-h:
gl_ICONV_H gl_ICONV_H
# Code from module iconv_open:
gl_FUNC_ICONV_OPEN gl_FUNC_ICONV_OPEN
# Code from module iconv_open-utf:
gl_FUNC_ICONV_OPEN_UTF gl_FUNC_ICONV_OPEN_UTF
# Code from module include_next:
# Code from module inet_ntop:
gl_INET_NTOP gl_INET_NTOP
gl_ARPA_INET_MODULE_INDICATOR([inet_ntop]) gl_ARPA_INET_MODULE_INDICATOR([inet_ntop])
# Code from module inet_pton:
gl_INET_PTON gl_INET_PTON
gl_ARPA_INET_MODULE_INDICATOR([inet_pton]) gl_ARPA_INET_MODULE_INDICATOR([inet_pton])
# Code from module inline:
gl_INLINE gl_INLINE
# Code from module lib-symbol-versions:
gl_LD_VERSION_SCRIPT gl_LD_VERSION_SCRIPT
# Code from module lib-symbol-visibility:
gl_VISIBILITY gl_VISIBILITY
# Code from module libunistring:
gl_LIBUNISTRING gl_LIBUNISTRING
# Code from module localcharset:
gl_LOCALCHARSET gl_LOCALCHARSET
LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\"" LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\""
AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT]) AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
# Code from module locale:
gl_LOCALE_H gl_LOCALE_H
# Code from module lstat:
gl_FUNC_LSTAT gl_FUNC_LSTAT
gl_SYS_STAT_MODULE_INDICATOR([lstat]) gl_SYS_STAT_MODULE_INDICATOR([lstat])
# Code from module maintainer-makefile:
AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER], AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER],
[AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])]) [AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])])
# Code from module malloc-posix:
gl_FUNC_MALLOC_POSIX gl_FUNC_MALLOC_POSIX
gl_STDLIB_MODULE_INDICATOR([malloc-posix]) gl_STDLIB_MODULE_INDICATOR([malloc-posix])
# Code from module malloca:
gl_MALLOCA gl_MALLOCA
# Code from module mbrlen:
gl_FUNC_MBRLEN gl_FUNC_MBRLEN
gl_WCHAR_MODULE_INDICATOR([mbrlen]) gl_WCHAR_MODULE_INDICATOR([mbrlen])
# Code from module mbrtowc:
gl_FUNC_MBRTOWC gl_FUNC_MBRTOWC
gl_WCHAR_MODULE_INDICATOR([mbrtowc]) gl_WCHAR_MODULE_INDICATOR([mbrtowc])
# Code from module mbsinit:
gl_FUNC_MBSINIT gl_FUNC_MBSINIT
gl_WCHAR_MODULE_INDICATOR([mbsinit]) gl_WCHAR_MODULE_INDICATOR([mbsinit])
# Code from module memchr:
gl_FUNC_MEMCHR gl_FUNC_MEMCHR
gl_STRING_MODULE_INDICATOR([memchr]) gl_STRING_MODULE_INDICATOR([memchr])
# Code from module multiarch:
gl_MULTIARCH gl_MULTIARCH
# Code from module netdb:
gl_HEADER_NETDB gl_HEADER_NETDB
# Code from module netinet_in:
gl_HEADER_NETINET_IN gl_HEADER_NETINET_IN
AC_PROG_MKDIR_P AC_PROG_MKDIR_P
# Code from module pathmax:
gl_PATHMAX gl_PATHMAX
# Code from module putenv:
gl_FUNC_PUTENV gl_FUNC_PUTENV
gl_STDLIB_MODULE_INDICATOR([putenv]) gl_STDLIB_MODULE_INDICATOR([putenv])
# Code from module readlink:
gl_FUNC_READLINK gl_FUNC_READLINK
gl_UNISTD_MODULE_INDICATOR([readlink]) gl_UNISTD_MODULE_INDICATOR([readlink])
# Code from module safe-read:
gl_SAFE_READ gl_SAFE_READ
# Code from module safe-write:
gl_SAFE_WRITE gl_SAFE_WRITE
# Code from module servent:
gl_SERVENT gl_SERVENT
# Code from module size_max:
gl_SIZE_MAX gl_SIZE_MAX
# Code from module snprintf:
gl_FUNC_SNPRINTF gl_FUNC_SNPRINTF
gl_STDIO_MODULE_INDICATOR([snprintf]) gl_STDIO_MODULE_INDICATOR([snprintf])
# Code from module socklen:
gl_TYPE_SOCKLEN_T gl_TYPE_SOCKLEN_T
# Code from module ssize_t:
gt_TYPE_SSIZE_T gt_TYPE_SSIZE_T
# Code from module stat:
gl_FUNC_STAT gl_FUNC_STAT
gl_SYS_STAT_MODULE_INDICATOR([stat]) gl_SYS_STAT_MODULE_INDICATOR([stat])
# Code from module stdarg:
gl_STDARG_H gl_STDARG_H
# Code from module stdbool:
AM_STDBOOL_H AM_STDBOOL_H
# Code from module stddef:
gl_STDDEF_H gl_STDDEF_H
# Code from module stdint:
gl_STDINT_H gl_STDINT_H
# Code from module stdio:
gl_STDIO_H gl_STDIO_H
# Code from module stdlib:
gl_STDLIB_H gl_STDLIB_H
# Code from module strcase:
gl_STRCASE gl_STRCASE
# Code from module streq:
# Code from module strftime:
gl_FUNC_GNU_STRFTIME gl_FUNC_GNU_STRFTIME
# Code from module striconveh:
if test $gl_cond_libtool = false; then if test $gl_cond_libtool = false; then
gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV" gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV"
gl_libdeps="$gl_libdeps $LIBICONV" gl_libdeps="$gl_libdeps $LIBICONV"
fi fi
# Code from module string:
gl_HEADER_STRING_H gl_HEADER_STRING_H
# Code from module strings:
gl_HEADER_STRINGS_H gl_HEADER_STRINGS_H
# Code from module sys_file:
gl_HEADER_SYS_FILE_H gl_HEADER_SYS_FILE_H
AC_PROG_MKDIR_P AC_PROG_MKDIR_P
# Code from module sys_socket:
gl_HEADER_SYS_SOCKET gl_HEADER_SYS_SOCKET
AC_PROG_MKDIR_P AC_PROG_MKDIR_P
# Code from module sys_stat:
gl_HEADER_SYS_STAT_H gl_HEADER_SYS_STAT_H
AC_PROG_MKDIR_P AC_PROG_MKDIR_P
# Code from module time:
gl_HEADER_TIME_H gl_HEADER_TIME_H
# Code from module time_r:
gl_TIME_R gl_TIME_R
gl_TIME_MODULE_INDICATOR([time_r])
# Code from module unistd:
gl_UNISTD_H gl_UNISTD_H
# Code from module unistr/base:
# Code from module unistr/u8-mbtouc:
gl_MODULE_INDICATOR([unistr/u8-mbtouc]) gl_MODULE_INDICATOR([unistr/u8-mbtouc])
# Code from module unistr/u8-mbtouc-unsafe:
gl_MODULE_INDICATOR([unistr/u8-mbtouc-unsafe]) gl_MODULE_INDICATOR([unistr/u8-mbtouc-unsafe])
# Code from module unistr/u8-mbtoucr:
gl_MODULE_INDICATOR([unistr/u8-mbtoucr]) gl_MODULE_INDICATOR([unistr/u8-mbtoucr])
# Code from module unistr/u8-prev:
# Code from module unistr/u8-uctomb:
gl_MODULE_INDICATOR([unistr/u8-uctomb]) gl_MODULE_INDICATOR([unistr/u8-uctomb])
# Code from module unitypes:
# Code from module unused-parameter:
# Code from module useless-if-before-free:
# Code from module vasnprintf:
gl_FUNC_VASNPRINTF gl_FUNC_VASNPRINTF
# Code from module vc-list-files:
# Code from module verify:
# Code from module version-etc:
gl_VERSION_ETC gl_VERSION_ETC
# Code from module version-etc-fsf:
# Code from module vsnprintf:
gl_FUNC_VSNPRINTF gl_FUNC_VSNPRINTF
gl_STDIO_MODULE_INDICATOR([vsnprintf]) gl_STDIO_MODULE_INDICATOR([vsnprintf])
# Code from module warn-on-use:
# Code from module warnings:
AC_SUBST([WARN_CFLAGS]) AC_SUBST([WARN_CFLAGS])
# Code from module wchar:
gl_WCHAR_H gl_WCHAR_H
# Code from module write:
gl_FUNC_WRITE gl_FUNC_WRITE
gl_UNISTD_MODULE_INDICATOR([write]) gl_UNISTD_MODULE_INDICATOR([write])
# Code from module xsize:
gl_XSIZE gl_XSIZE
# End of code from modules
m4_ifval(gl_LIBSOURCES_LIST, [ m4_ifval(gl_LIBSOURCES_LIST, [
m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ || m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
for gl_file in ]gl_LIBSOURCES_LIST[ ; do for gl_file in ]gl_LIBSOURCES_LIST[ ; do
@ -296,6 +511,7 @@ AC_DEFUN([gltests_LIBSOURCES], [
AC_DEFUN([gl_FILE_LIST], [ AC_DEFUN([gl_FILE_LIST], [
build-aux/announce-gen build-aux/announce-gen
build-aux/arg-nonnull.h build-aux/arg-nonnull.h
build-aux/c++defs.h
build-aux/config.rpath build-aux/config.rpath
build-aux/gendocs.sh build-aux/gendocs.sh
build-aux/gitlog-to-changelog build-aux/gitlog-to-changelog
@ -434,6 +650,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/float_h.m4 m4/float_h.m4
m4/flock.m4 m4/flock.m4
m4/fpieee.m4 m4/fpieee.m4
m4/func.m4
m4/getaddrinfo.m4 m4/getaddrinfo.m4
m4/glibc21.m4 m4/glibc21.m4
m4/gnulib-common.m4 m4/gnulib-common.m4
@ -507,7 +724,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/vsnprintf.m4 m4/vsnprintf.m4
m4/warn-on-use.m4 m4/warn-on-use.m4
m4/warnings.m4 m4/warnings.m4
m4/wchar.m4 m4/wchar_h.m4
m4/wchar_t.m4 m4/wchar_t.m4
m4/wint_t.m4 m4/wint_t.m4
m4/write.m4 m4/write.m4

View file

@ -1,4 +1,4 @@
# iconv_open.m4 serial 6 # iconv_open.m4 serial 7
dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -10,6 +10,8 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN],
AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([gl_ICONV_H_DEFAULTS]) AC_REQUIRE([gl_ICONV_H_DEFAULTS])
if test "$am_cv_func_iconv" = yes; then if test "$am_cv_func_iconv" = yes; then
dnl Provide the <iconv.h> override, for the sake of the C++ aliases.
gl_REPLACE_ICONV_H
dnl Test whether iconv_open accepts standardized encoding names. dnl Test whether iconv_open accepts standardized encoding names.
dnl We know that GNU libiconv and GNU libc do. dnl We know that GNU libiconv and GNU libc do.
AC_EGREP_CPP([gnu_iconv], [ AC_EGREP_CPP([gnu_iconv], [

View file

@ -1,4 +1,4 @@
# locale_h.m4 serial 7 # locale_h.m4 serial 9
dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -79,11 +79,14 @@ AC_DEFUN([gl_LOCALE_MODULE_INDICATOR],
dnl Use AC_REQUIRE here, so that the default settings are expanded once only. dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
dnl Define it also as a C macro, for the benefit of the unit tests.
gl_MODULE_INDICATOR([$1])
]) ])
AC_DEFUN([gl_LOCALE_H_DEFAULTS], AC_DEFUN([gl_LOCALE_H_DEFAULTS],
[ [
GNULIB_DUPLOCALE=0; AC_SUBST([GNULIB_DUPLOCALE]) GNULIB_DUPLOCALE=0; AC_SUBST([GNULIB_DUPLOCALE])
dnl Assume proper GNU behavior unless another module says otherwise. dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE])
REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE]) REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE])
]) ])

View file

@ -1,4 +1,4 @@
# stdio_h.m4 serial 25 # stdio_h.m4 serial 26
dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -45,6 +45,8 @@ AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
dnl Use AC_REQUIRE here, so that the default settings are expanded once only. dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
AC_REQUIRE([gl_STDIO_H_DEFAULTS]) AC_REQUIRE([gl_STDIO_H_DEFAULTS])
GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
dnl Define it also as a C macro, for the benefit of the unit tests.
gl_MODULE_INDICATOR([$1])
]) ])
AC_DEFUN([gl_STDIO_H_DEFAULTS], AC_DEFUN([gl_STDIO_H_DEFAULTS],

View file

@ -1,4 +1,4 @@
# stdlib_h.m4 serial 22 # stdlib_h.m4 serial 23
dnl Copyright (C) 2007-2010 Free Software Foundation, Inc. dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -43,6 +43,8 @@ AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
dnl Use AC_REQUIRE here, so that the default settings are expanded once only. dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
dnl Define it also as a C macro, for the benefit of the unit tests.
gl_MODULE_INDICATOR([$1])
]) ])
AC_DEFUN([gl_STDLIB_H_DEFAULTS], AC_DEFUN([gl_STDLIB_H_DEFAULTS],

View file

@ -5,7 +5,7 @@
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
# serial 11 # serial 12
# Written by Paul Eggert. # Written by Paul Eggert.
@ -35,6 +35,8 @@ AC_DEFUN([gl_STRING_MODULE_INDICATOR],
dnl Use AC_REQUIRE here, so that the default settings are expanded once only. dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
dnl Define it also as a C macro, for the benefit of the unit tests.
gl_MODULE_INDICATOR([$1])
]) ])
AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],

View file

@ -1,7 +1,7 @@
# Configure a replacement for <sys/file.h>. # Configure a replacement for <sys/file.h>.
# serial 3 # serial 4
# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. # Copyright (C) 2008-2010 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
@ -12,10 +12,7 @@ AC_DEFUN([gl_HEADER_SYS_FILE_H],
[ [
AC_REQUIRE([gl_HEADER_SYS_FILE_H_DEFAULTS]) AC_REQUIRE([gl_HEADER_SYS_FILE_H_DEFAULTS])
dnl Only flock is defined in a working <sys/file.h>. If that dnl <sys/file.h> is always overridden, because of GNULIB_POSIXCHECK.
dnl function is already there, we don't want to do any substitution.
AC_CHECK_FUNCS_ONCE([flock])
gl_CHECK_NEXT_HEADERS([sys/file.h]) gl_CHECK_NEXT_HEADERS([sys/file.h])
AC_CHECK_HEADERS_ONCE([sys/file.h]) AC_CHECK_HEADERS_ONCE([sys/file.h])

View file

@ -1,4 +1,4 @@
# sys_socket_h.m4 serial 14 # sys_socket_h.m4 serial 16
dnl Copyright (C) 2005-2010 Free Software Foundation, Inc. dnl Copyright (C) 2005-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -19,7 +19,6 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
[gl_cv_header_sys_socket_h_selfcontained=no]) [gl_cv_header_sys_socket_h_selfcontained=no])
]) ])
if test $gl_cv_header_sys_socket_h_selfcontained = yes; then if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
SYS_SOCKET_H=''
dnl If the shutdown function exists, <sys/socket.h> should define dnl If the shutdown function exists, <sys/socket.h> should define
dnl SHUT_RD, SHUT_WR, SHUT_RDWR. dnl SHUT_RD, SHUT_WR, SHUT_RDWR.
AC_CHECK_FUNCS([shutdown]) AC_CHECK_FUNCS([shutdown])
@ -37,8 +36,6 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
SYS_SOCKET_H='sys/socket.h' SYS_SOCKET_H='sys/socket.h'
fi fi
fi fi
else
SYS_SOCKET_H='sys/socket.h'
fi fi
# We need to check for ws2tcpip.h now. # We need to check for ws2tcpip.h now.
gl_PREREQ_SYS_H_SOCKET gl_PREREQ_SYS_H_SOCKET
@ -56,16 +53,11 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
]) ])
if test $ac_cv_type_struct_sockaddr_storage = no; then if test $ac_cv_type_struct_sockaddr_storage = no; then
HAVE_STRUCT_SOCKADDR_STORAGE=0 HAVE_STRUCT_SOCKADDR_STORAGE=0
SYS_SOCKET_H='sys/socket.h'
fi fi
if test $ac_cv_type_sa_family_t = no; then if test $ac_cv_type_sa_family_t = no; then
HAVE_SA_FAMILY_T=0 HAVE_SA_FAMILY_T=0
SYS_SOCKET_H='sys/socket.h'
fi fi
if test -n "$SYS_SOCKET_H"; then gl_PREREQ_SYS_H_WINSOCK2
gl_PREREQ_SYS_H_WINSOCK2
fi
AC_SUBST([SYS_SOCKET_H])
dnl Check for declarations of anything we want to poison if the dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use. dnl corresponding gnulib module is not in use.
@ -134,6 +126,8 @@ AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR],
dnl Use AC_REQUIRE here, so that the default settings are expanded once only. dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS]) AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
dnl Define it also as a C macro, for the benefit of the unit tests.
gl_MODULE_INDICATOR([$1])
]) ])
AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS], AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],

View file

@ -1,4 +1,4 @@
# sys_stat_h.m4 serial 22 -*- Autoconf -*- # sys_stat_h.m4 serial 23 -*- Autoconf -*-
dnl Copyright (C) 2006-2010 Free Software Foundation, Inc. dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -39,6 +39,8 @@ AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR],
dnl Use AC_REQUIRE here, so that the default settings are expanded once only. dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
dnl Define it also as a C macro, for the benefit of the unit tests.
gl_MODULE_INDICATOR([$1])
]) ])
AC_DEFUN([gl_SYS_STAT_H_DEFAULTS], AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],

View file

@ -23,18 +23,6 @@ AC_DEFUN([gl_HEADER_TIME_H_BODY],
AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC]) AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
]) ])
AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS],
[
dnl If another module says to replace or to not replace, do that.
dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK;
dnl this lets maintainers check for portability.
REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R])
REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME])
REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP])
REPLACE_STRPTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRPTIME])
REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM])
])
dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
dnl in time.h or sys/time.h. dnl in time.h or sys/time.h.
@ -72,3 +60,29 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC]) AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC])
AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC]) AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC])
]) ])
AC_DEFUN([gl_TIME_MODULE_INDICATOR],
[
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
dnl Define it also as a C macro, for the benefit of the unit tests.
gl_MODULE_INDICATOR([$1])
])
AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS],
[
GNULIB_MKTIME=0; AC_SUBST([GNULIB_MKTIME])
GNULIB_NANOSLEEP=0; AC_SUBST([GNULIB_NANOSLEEP])
GNULIB_STRPTIME=0; AC_SUBST([GNULIB_STRPTIME])
GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM])
GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R])
dnl If another module says to replace or to not replace, do that.
dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK;
dnl this lets maintainers check for portability.
REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R])
REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME])
REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP])
REPLACE_STRPTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRPTIME])
REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM])
])

View file

@ -1,4 +1,4 @@
# unistd_h.m4 serial 39 # unistd_h.m4 serial 40
dnl Copyright (C) 2006-2010 Free Software Foundation, Inc. dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -47,6 +47,8 @@ AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
dnl Use AC_REQUIRE here, so that the default settings are expanded once only. dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
dnl Define it also as a C macro, for the benefit of the unit tests.
gl_MODULE_INDICATOR([$1])
]) ])
AC_DEFUN([gl_UNISTD_H_DEFAULTS], AC_DEFUN([gl_UNISTD_H_DEFAULTS],

View file

@ -1,4 +1,4 @@
# warn-on-use.m4 serial 1 # warn-on-use.m4 serial 2
dnl Copyright (C) 2010 Free Software Foundation, Inc. dnl Copyright (C) 2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -30,12 +30,12 @@ AC_DEFUN([gl_WARN_ON_USE_PREPARE],
for gl_func in m4_flatten([$2]); do for gl_func in m4_flatten([$2]); do
AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl
AC_CACHE_CHECK([whether $gl_func is declared without a macro], AC_CACHE_CHECK([whether $gl_func is declared without a macro],
[gl_Symbol], gl_Symbol,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1],
[@%:@undef $gl_func [@%:@undef $gl_func
(void) $gl_func;])], (void) $gl_func;])],
[AS_VAR_SET([gl_Symbol], [yes])], [AS_VAR_SET([gl_Symbol], [no])])]) [AS_VAR_SET(gl_Symbol, [yes])], [AS_VAR_SET(gl_Symbol, [no])])])
AS_VAR_IF([gl_Symbol], [yes], AS_VAR_IF(gl_Symbol, [yes],
[AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1]) [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
dnl shortcut - if the raw declaration exists, then set a cache dnl shortcut - if the raw declaration exists, then set a cache
dnl variable to allow skipping any later AC_CHECK_DECL efforts dnl variable to allow skipping any later AC_CHECK_DECL efforts

View file

@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
dnl Written by Eric Blake. dnl Written by Eric Blake.
# wchar.m4 serial 31 # wchar_h.m4 serial 32
AC_DEFUN([gl_WCHAR_H], AC_DEFUN([gl_WCHAR_H],
[ [
@ -108,6 +108,8 @@ AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
dnl Use AC_REQUIRE here, so that the default settings are expanded once only. dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
dnl Define it also as a C macro, for the benefit of the unit tests.
gl_MODULE_INDICATOR([$1])
]) ])
AC_DEFUN([gl_WCHAR_H_DEFAULTS], AC_DEFUN([gl_WCHAR_H_DEFAULTS],