diff options
author | Simon Josefsson <simon@josefsson.org> | 2010-02-17 12:43:49 +0100 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2010-02-17 12:43:49 +0100 |
commit | d140493322aa76e6568f3e61384acafebcc343a1 (patch) | |
tree | 627458d1a2065f5275300ac610252529ec56f8a7 /lib | |
parent | b8d8188e1ae51ce8cc6861ea9dd24d6deaea609e (diff) | |
download | libtasn1-d140493322aa76e6568f3e61384acafebcc343a1.tar.gz libtasn1-d140493322aa76e6568f3e61384acafebcc343a1.tar.bz2 libtasn1-d140493322aa76e6568f3e61384acafebcc343a1.zip |
Update gnulib files.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gllib/Makefile.am | 47 | ||||
-rw-r--r-- | lib/gllib/wchar.in.h | 92 | ||||
-rw-r--r-- | lib/glm4/gnulib-comp.m4 | 3 | ||||
-rw-r--r-- | lib/glm4/warn-on-use.m4 | 45 | ||||
-rw-r--r-- | lib/glm4/wchar.m4 | 15 |
5 files changed, 128 insertions, 74 deletions
diff --git a/lib/gllib/Makefile.am b/lib/gllib/Makefile.am index a64310a..b7a68ae 100644 --- a/lib/gllib/Makefile.am +++ b/lib/gllib/Makefile.am @@ -71,30 +71,6 @@ AM_CFLAGS += $(CFLAG_VISIBILITY) ## end gnulib module lib-symbol-visibility -## begin gnulib module link-warning - -# 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 += link-warning.h -# The link-warning.h that gets inserted into generated .h files is the same as -# build-aux/link-warning.h, except that it has the copyright header cut off. -link-warning.h: $(top_srcdir)/build-aux/link-warning.h - $(AM_V_GEN)rm -f $@-t $@ && \ - sed -n -e '/GL_LINK_WARNING/,$$p' \ - < $(top_srcdir)/build-aux/link-warning.h \ - > $@-t && \ - mv $@-t $@ -MOSTLYCLEANFILES += link-warning.h link-warning.h-t - -LINK_WARNING_H=link-warning.h - -EXTRA_DIST += $(top_srcdir)/build-aux/link-warning.h - -## end gnulib module link-warning - ## begin gnulib module stddef BUILT_SOURCES += $(STDDEF_H) @@ -160,13 +136,32 @@ EXTRA_DIST += stdint.in.h ## end gnulib module stdint +## begin gnulib module warn-on-use + +BUILT_SOURCES += warn-on-use.h +# The warn-on-use.h that gets inserted into generated .h files is the same as +# build-aux/warn-on-use.h, except that it has the copyright header cut off. +warn-on-use.h: $(top_srcdir)/build-aux/warn-on-use.h + $(AM_V_GEN)rm -f $@-t $@ && \ + sed -n -e '/^.ifndef/,$$p' \ + < $(top_srcdir)/build-aux/warn-on-use.h \ + > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t + +WARN_ON_USE_H=warn-on-use.h + +EXTRA_DIST += $(top_srcdir)/build-aux/warn-on-use.h + +## end gnulib module warn-on-use + ## begin gnulib module wchar BUILT_SOURCES += wchar.h # We need the following in order to create <wchar.h> when the system # version does not work standalone. -wchar.h: wchar.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H) +wchar.h: wchar.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ @@ -208,8 +203,8 @@ wchar.h: wchar.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H) -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \ -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \ -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ - -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ < $(srcdir)/wchar.in.h; \ } > $@-t && \ mv $@-t $@ diff --git a/lib/gllib/wchar.in.h b/lib/gllib/wchar.in.h index e2a50fa..c492dd6 100644 --- a/lib/gllib/wchar.in.h +++ b/lib/gllib/wchar.in.h @@ -75,10 +75,10 @@ #ifndef _GL_WCHAR_H #define _GL_WCHAR_H -/* The definition of GL_LINK_WARNING is copied here. */ - /* The definition of _GL_ARG_NONNULL is copied here. */ +/* The definition of _GL_WARN_ON_USE is copied here. */ + #ifdef __cplusplus extern "C" { #endif @@ -115,10 +115,10 @@ extern wint_t btowc (int c); # endif #elif defined GNULIB_POSIXCHECK # undef btowc -# define btowc(c) \ - (GL_LINK_WARNING ("btowc is unportable - " \ - "use gnulib module btowc for portability"), \ - btowc (c)) +# if HAVE_RAW_DECL_BTOWC +_GL_WARN_ON_USE (btowc, "btowc is unportable - " + "use gnulib module btowc for portability"); +# endif #endif @@ -134,10 +134,10 @@ extern int wctob (wint_t wc); # endif #elif defined GNULIB_POSIXCHECK # undef wctob -# define wctob(w) \ - (GL_LINK_WARNING ("wctob is unportable - " \ - "use gnulib module wctob for portability"), \ - wctob (w)) +# if HAVE_RAW_DECL_WCTOB +_GL_WARN_ON_USE (wctob, "wctob is unportable - " + "use gnulib module wctob for portability"); +# endif #endif @@ -152,10 +152,10 @@ extern int mbsinit (const mbstate_t *ps); # endif #elif defined GNULIB_POSIXCHECK # undef mbsinit -# define mbsinit(p) \ - (GL_LINK_WARNING ("mbsinit is unportable - " \ - "use gnulib module mbsinit for portability"), \ - mbsinit (p)) +# if HAVE_RAW_DECL_MBSINIT +_GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - " + "use gnulib module mbsinit for portability"); +# endif #endif @@ -170,10 +170,10 @@ extern size_t mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps); # endif #elif defined GNULIB_POSIXCHECK # undef mbrtowc -# define mbrtowc(w,s,n,p) \ - (GL_LINK_WARNING ("mbrtowc is unportable - " \ - "use gnulib module mbrtowc for portability"), \ - mbrtowc (w, s, n, p)) +# if HAVE_RAW_DECL_MBRTOWC +_GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - " + "use gnulib module mbrtowc for portability"); +# endif #endif @@ -188,10 +188,10 @@ extern size_t mbrlen (const char *s, size_t n, mbstate_t *ps); # endif #elif defined GNULIB_POSIXCHECK # undef mbrlen -# define mbrlen(s,n,p) \ - (GL_LINK_WARNING ("mbrlen is unportable - " \ - "use gnulib module mbrlen for portability"), \ - mbrlen (s, n, p)) +# if HAVE_RAW_DECL_MBRLEN +_GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - " + "use gnulib module mbrlen for portability"); +# endif #endif @@ -207,10 +207,10 @@ extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t # endif #elif defined GNULIB_POSIXCHECK # undef mbsrtowcs -# define mbsrtowcs(d,s,l,p) \ - (GL_LINK_WARNING ("mbsrtowcs is unportable - " \ - "use gnulib module mbsrtowcs for portability"), \ - mbsrtowcs (d, s, l, p)) +# if HAVE_RAW_DECL_MBSRTOWCS +_GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - " + "use gnulib module mbsrtowcs for portability"); +# endif #endif @@ -226,10 +226,10 @@ extern size_t mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, size_ # endif #elif defined GNULIB_POSIXCHECK # undef mbsnrtowcs -# define mbsnrtowcs(d,s,n,l,p) \ - (GL_LINK_WARNING ("mbsnrtowcs is unportable - " \ - "use gnulib module mbsnrtowcs for portability"), \ - mbsnrtowcs (d, s, n, l, p)) +# if HAVE_RAW_DECL_MBSNRTOWCS +_GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - " + "use gnulib module mbsnrtowcs for portability"); +# endif #endif @@ -244,10 +244,10 @@ extern size_t wcrtomb (char *s, wchar_t wc, mbstate_t *ps); # endif #elif defined GNULIB_POSIXCHECK # undef wcrtomb -# define wcrtomb(s,w,p) \ - (GL_LINK_WARNING ("wcrtomb is unportable - " \ - "use gnulib module wcrtomb for portability"), \ - wcrtomb (s, w, p)) +# if HAVE_RAW_DECL_WCRTOMB +_GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - " + "use gnulib module wcrtomb for portability"); +# endif #endif @@ -263,10 +263,10 @@ extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, mbstate_t # endif #elif defined GNULIB_POSIXCHECK # undef wcsrtombs -# define wcsrtombs(d,s,l,p) \ - (GL_LINK_WARNING ("wcsrtombs is unportable - " \ - "use gnulib module wcsrtombs for portability"), \ - wcsrtombs (d, s, l, p)) +# if HAVE_RAW_DECL_WCSRTOMBS +_GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - " + "use gnulib module wcsrtombs for portability"); +# endif #endif @@ -282,10 +282,10 @@ extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, size_ # endif #elif defined GNULIB_POSIXCHECK # undef wcsnrtombs -# define wcsnrtombs(d,s,n,l,p) \ - (GL_LINK_WARNING ("wcsnrtombs is unportable - " \ - "use gnulib module wcsnrtombs for portability"), \ - wcsnrtombs (d, s, n, l, p)) +# if HAVE_RAW_DECL_WCSNRTOMBS +_GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - " + "use gnulib module wcsnrtombs for portability"); +# endif #endif @@ -303,10 +303,10 @@ extern int wcwidth (int /* actually wchar_t */); # endif #elif defined GNULIB_POSIXCHECK # undef wcwidth -# define wcwidth(w) \ - (GL_LINK_WARNING ("wcwidth is unportable - " \ - "use gnulib module wcwidth for portability"), \ - wcwidth (w)) +# if HAVE_RAW_DECL_WCWIDTH +_GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - " + "use gnulib module wcwidth for portability"); +# endif #endif diff --git a/lib/glm4/gnulib-comp.m4 b/lib/glm4/gnulib-comp.m4 index eab9e8a..bb56f12 100644 --- a/lib/glm4/gnulib-comp.m4 +++ b/lib/glm4/gnulib-comp.m4 @@ -175,7 +175,7 @@ AC_DEFUN([lgltests_LIBSOURCES], [ # gnulib-tool and may be removed by future gnulib-tool invocations. AC_DEFUN([lgl_FILE_LIST], [ build-aux/arg-nonnull.h - build-aux/link-warning.h + build-aux/warn-on-use.h lib/dummy.c lib/stddef.in.h lib/stdint.in.h @@ -189,6 +189,7 @@ AC_DEFUN([lgl_FILE_LIST], [ m4/stddef_h.m4 m4/stdint.m4 m4/visibility.m4 + m4/warn-on-use.m4 m4/wchar.m4 m4/wchar_t.m4 m4/wint_t.m4 diff --git a/lib/glm4/warn-on-use.m4 b/lib/glm4/warn-on-use.m4 new file mode 100644 index 0000000..ab46422 --- /dev/null +++ b/lib/glm4/warn-on-use.m4 @@ -0,0 +1,45 @@ +# warn-on-use.m4 serial 1 +dnl Copyright (C) 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. + +# gl_WARN_ON_USE_PREPARE(INCLUDES, NAMES) +# --------------------------------------- +# For each whitespace-separated element in the list of NAMES, define +# HAVE_RAW_DECL_name if the function has a declaration among INCLUDES +# even after being undefined as a macro. +# +# See warn-on-use.h for some hints on how to poison function names, as +# well as ideas on poisoning global variables and macros. NAMES may +# include global variables, but remember that only functions work with +# _GL_WARN_ON_USE. Typically, INCLUDES only needs to list a single +# header, but if the replacement header pulls in other headers because +# some systems declare functions in the wrong header, then INCLUDES +# should do likewise. +# +# If you assume C89, then it is generally safe to assume declarations +# for functions declared in that standard (such as gets) without +# needing gl_WARN_ON_USE_PREPARE. +AC_DEFUN([gl_WARN_ON_USE_PREPARE], +[ + m4_foreach_w([gl_decl], [$2], + [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])), + [Define to 1 if ]m4_defn([gl_decl])[ is declared even after + undefining macros.])])dnl + for gl_func in m4_flatten([$2]); do + AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl + AC_CACHE_CHECK([whether $gl_func is declared without a macro], + [gl_Symbol], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1], +[@%:@undef $gl_func + (void) $gl_func;])], + [AS_VAR_SET([gl_Symbol], [yes])], [AS_VAR_SET([gl_Symbol], [no])])]) + AS_VAR_IF([gl_Symbol], [yes], + [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1]) + dnl shortcut - if the raw declaration exists, then set a cache + dnl variable to allow skipping any later AC_CHECK_DECL efforts + eval ac_cv_have_decl_$gl_func=yes]) + AS_VAR_POPDEF([gl_Symbol])dnl + done +]) diff --git a/lib/glm4/wchar.m4 b/lib/glm4/wchar.m4 index b2055f9..e81485d 100644 --- a/lib/glm4/wchar.m4 +++ b/lib/glm4/wchar.m4 @@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. dnl Written by Eric Blake. -# wchar.m4 serial 30 +# wchar.m4 serial 31 AC_DEFUN([gl_WCHAR_H], [ @@ -33,6 +33,19 @@ AC_DEFUN([gl_WCHAR_H], HAVE_WINT_T=0 fi AC_SUBST([HAVE_WINT_T]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ +/* Some systems require additional headers. */ +#ifndef __GLIBC__ +# include <stddef.h> +# include <stdio.h> +# include <time.h> +#endif +#include <wchar.h> + ]], [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb + wcsrtombs wcsnrtombs wcwidth]) ]) dnl Check whether <wchar.h> is usable at all. |