From: Bruno Haible Date: Mon, 1 Oct 2007 22:41:54 +0000 (+0200) Subject: Rename wchar_.h to wchar.in.h. X-Git-Tag: v0.0~152 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=1cb8e50dafa6e8243f9322a53f5dafac365e968a;p=gnulib.git Rename wchar_.h to wchar.in.h. --- diff --git a/ChangeLog b/ChangeLog index 84d5e9f9e..325b6c6d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -83,6 +83,9 @@ * lib/unistd.in.h: Renamed from lib/unistd_.h. * modules/unistd (Files, Makefile.am): Use unistd.in.h instead of unistd_.h. + * lib/wchar.in.h: Renamed from lib/wchar_.h. + * modules/wchar (Files, Makefile.am): Use wchar.in.h instead of + wchar_.h. 2007-09-30 Bruno Haible diff --git a/lib/wchar.in.h b/lib/wchar.in.h new file mode 100644 index 000000000..924a3382d --- /dev/null +++ b/lib/wchar.in.h @@ -0,0 +1,82 @@ +/* A substitute for ISO C99 , for platforms that have issues. + + Copyright (C) 2007 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 2, 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Written by Eric Blake. */ + +/* + * ISO C 99 for platforms that have issues. + * + * + * For now, this just ensures proper prerequisite inclusion order and + * the declaration of wcwidth(). + */ + +#ifndef _GL_WCHAR_H + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include + +/* Include the original if it exists. + Some builds of uClibc lack it. */ +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_WCHAR_H@ +# @INCLUDE_NEXT@ @NEXT_WCHAR_H@ +#endif + +#ifndef _GL_WCHAR_H +#define _GL_WCHAR_H + +/* The definition of GL_LINK_WARNING is copied here. */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Return the number of screen columns needed for WC. */ +#if @GNULIB_WCWIDTH@ +# if @REPLACE_WCWIDTH@ +# undef wcwidth +# define wcwidth rpl_wcwidth +extern int wcwidth (wchar_t); +# else +# if !defined wcwidth && !@HAVE_DECL_WCWIDTH@ +/* wcwidth exists but is not declared. */ +extern int wcwidth (int /* actually wchar_t */); +# endif +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcwidth +# define wcwidth(w) \ + (GL_LINK_WARNING ("wcwidth is unportable - " \ + "use gnulib module wcwidth for portability"), \ + wcwidth (w)) +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _GL_WCHAR_H */ +#endif /* _GL_WCHAR_H */ diff --git a/lib/wchar_.h b/lib/wchar_.h deleted file mode 100644 index 924a3382d..000000000 --- a/lib/wchar_.h +++ /dev/null @@ -1,82 +0,0 @@ -/* A substitute for ISO C99 , for platforms that have issues. - - Copyright (C) 2007 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 2, 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* Written by Eric Blake. */ - -/* - * ISO C 99 for platforms that have issues. - * - * - * For now, this just ensures proper prerequisite inclusion order and - * the declaration of wcwidth(). - */ - -#ifndef _GL_WCHAR_H - -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.0.1 has a bug: , and must be - included before . */ -#include -#include -#include - -/* Include the original if it exists. - Some builds of uClibc lack it. */ -/* The include_next requires a split double-inclusion guard. */ -#if @HAVE_WCHAR_H@ -# @INCLUDE_NEXT@ @NEXT_WCHAR_H@ -#endif - -#ifndef _GL_WCHAR_H -#define _GL_WCHAR_H - -/* The definition of GL_LINK_WARNING is copied here. */ - -#ifdef __cplusplus -extern "C" { -#endif - - -/* Return the number of screen columns needed for WC. */ -#if @GNULIB_WCWIDTH@ -# if @REPLACE_WCWIDTH@ -# undef wcwidth -# define wcwidth rpl_wcwidth -extern int wcwidth (wchar_t); -# else -# if !defined wcwidth && !@HAVE_DECL_WCWIDTH@ -/* wcwidth exists but is not declared. */ -extern int wcwidth (int /* actually wchar_t */); -# endif -# endif -#elif defined GNULIB_POSIXCHECK -# undef wcwidth -# define wcwidth(w) \ - (GL_LINK_WARNING ("wcwidth is unportable - " \ - "use gnulib module wcwidth for portability"), \ - wcwidth (w)) -#endif - - -#ifdef __cplusplus -} -#endif - -#endif /* _GL_WCHAR_H */ -#endif /* _GL_WCHAR_H */ diff --git a/modules/wchar b/modules/wchar index 5fff34f4f..6f685824b 100644 --- a/modules/wchar +++ b/modules/wchar @@ -2,7 +2,7 @@ Description: A that works around platform issues. Files: -lib/wchar_.h +lib/wchar.in.h m4/wchar.m4 Depends-on: @@ -17,7 +17,7 @@ BUILT_SOURCES += $(WCHAR_H) # We need the following in order to create when the system # version does not work standalone. -wchar.h: wchar_.h +wchar.h: wchar.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ @@ -27,7 +27,7 @@ wchar.h: wchar_.h -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ - < $(srcdir)/wchar_.h; \ + < $(srcdir)/wchar.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += wchar.h wchar.h-t