From: Eric Blake Date: Sat, 13 Jan 2007 05:23:36 +0000 (+0000) Subject: Provide a robust . Further simplifications are now X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51a3188e1de710b4514c9f93d47245ad12948ecc;p=pspp Provide a robust . Further simplifications are now possible in other modules, but not included here. * modules/wchar: New module. * m4/wchar.m4: New file. * lib/wchar_.h: Likewise. * modules/mbchar (Depends-on): Depend on wchar, as the first use of the new module. * MODULES.html.sh (Extended multibyte and wide character utilities): New section. --- diff --git a/ChangeLog b/ChangeLog index 66fda758fa..8cb85f08c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2007-01-12 Eric Blake + + Provide a robust . Further simplifications are now + possible in other modules, but not included here. + * modules/wchar: New module. + * m4/wchar.m4: New file. + * lib/wchar_.h: Likewise. + * modules/mbchar (Depends-on): Depend on wchar, as the first use + of the new module. + * MODULES.html.sh (Extended multibyte and wide character utilities): + New section. + 2007-01-12 Paul Eggert * lib/xreadlink.c (SYMLINK_MAX) [!defined SYMLINK_MAX]: Define diff --git a/MODULES.html.sh b/MODULES.html.sh index 8a98e84051..5836e34318 100755 --- a/MODULES.html.sh +++ b/MODULES.html.sh @@ -1844,6 +1844,16 @@ func_all_modules () func_module strtoumax func_end_table + element="Extended multibyte and wide character utilities " + element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"` + func_section_wrap isoc_sup_wchar + func_wrap H3 + func_echo "$element" + + func_begin_table + func_module wchar + func_end_table + element="Wide character classification and mapping utilities " element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"` func_section_wrap isoc_sup_wctype diff --git a/lib/wchar_.h b/lib/wchar_.h new file mode 100644 index 0000000000..6813a2116d --- /dev/null +++ b/lib/wchar_.h @@ -0,0 +1,42 @@ +/* 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. + */ + +#ifndef _GL_WCHAR_H +#define _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 . */ +#include @ABSOLUTE_WCHAR_H@ + +#endif /* _GL_WCHAR_H */ diff --git a/m4/wchar.m4 b/m4/wchar.m4 new file mode 100644 index 0000000000..068f22d31b --- /dev/null +++ b/m4/wchar.m4 @@ -0,0 +1,29 @@ +dnl A placeholder for ISO C99 , for platforms that have issues. + +dnl Copyright (C) 2007 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. + +dnl Written by Eric Blake. + +# wchar.m4 serial 1 + +AC_DEFUN([gl_WCHAR_H], +[ + AC_CACHE_CHECK([whether is standalone], + [gl_cv_header_wchar_h_standalone], + [AC_COMPILE_IFELSE([[#include +wchar_t w;]], + [gl_cv_header_wchar_h_standalone=yes], + [gl_cv_header_wchar_h_standalone=no])]) + if test $gl_cv_header_wchar_h_standalone = yes; then + WCHAR_H= + else + gl_ABSOLUTE_HEADER([wchar.h]) + ABSOLUTE_WCHAR_H=\"$gl_cv_absolute_wchar_h\" + WCHAR_H=wchar.h + fi + AC_SUBST([ABSOLUTE_WCHAR_H]) + AC_SUBST([WCHAR_H]) +]) diff --git a/modules/mbchar b/modules/mbchar index 1d85ef7697..d708ca3cfa 100644 --- a/modules/mbchar +++ b/modules/mbchar @@ -8,6 +8,7 @@ m4/mbchar.m4 Depends-on: stdbool +wchar wctype wcwidth diff --git a/modules/wchar b/modules/wchar new file mode 100644 index 0000000000..8312e96bc2 --- /dev/null +++ b/modules/wchar @@ -0,0 +1,35 @@ +Description: +A that works around platform issues. + +Files: +lib/wchar_.h +m4/wchar.m4 + +Depends-on: +absolute-header + +configure.ac: +gl_WCHAR_H + +Makefile.am: +BUILT_SOURCES += $(WCHAR_H) + +# We need the following in order to create when the system +# version does not work standalone. +wchar.h: wchar_.h + rm -f $@-t $@ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''ABSOLUTE_WCHAR_H''@|$(ABSOLUTE_WCHAR_H)|g' \ + < $(srcdir)/wchar_.h; \ + } > $@-t + mv $@-t $@ +MOSTLYCLEANFILES += wchar.h wchar.h-t + +Include: +#include + +License: +LGPL + +Maintainer: +all