diff options
author | bonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-24 10:50:45 +0000 |
---|---|---|
committer | bonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-24 10:50:45 +0000 |
commit | d856c8a6b9ed6ffbbb012ce9f999e9db3a8ee302 (patch) | |
tree | 5c68861b20c202df9c26dd8ebfaf794153accea0 /libcpp | |
parent | 7b73f71f43633824db20764c402d0c2ca6f98535 (diff) | |
download | gcc-d856c8a6b9ed6ffbbb012ce9f999e9db3a8ee302.tar.gz |
ChangeLog:
2004-05-23 Paolo Bonzini <bonzini@gnu.org>
* Makefile.def (host_modules): add libcpp.
* Makefile.tpl: Add dependencies on and for libcpp.
* Makefile.in: Regenerate.
* configure.in: Add libcpp host module.
* configure: Regenerate.
config/ChangeLog:
2004-05-23 Paolo Bonzini <bonzini@gnu.org>
* acx.m4 (ACX_HEADER_STDBOOL, ACX_HEADER_STRING):
From gcc.
gcc/ChangeLog:
2004-05-23 Paolo Bonzini <bonzini@gnu.org>
Move libcpp to the toplevel.
* Makefile.in: Remove references to libcpp files,
use CPPLIBS instead of libcpp.a. Define SYMTAB_H
and change hashtable.h to that.
* aclocal.m4 (gcc_AC_HEADER_STDBOOL,
gcc_AC_HEADER_STRING, gcc_AC_C__BOOL): Remove.
* configure.ac (gcc_AC_C__BOOL, HAVE_UCHAR): Remove tests.
* configure: Regenerate.
* config.in: Regenerate.
* c-ppoutput.c: Include ../libcpp/internal.h instead of cpphash.h.
* cppcharset.c: Removed.
* cpperror.c: Removed.
* cppexp.c: Removed.
* cppfiles.c: Removed.
* cpphash.c: Removed.
* cpphash.h: Removed.
* cppinit.c: Removed.
* cpplex.c: Removed.
* cpplib.c: Removed.
* cpplib.h: Removed.
* cppmacro.c: Removed.
* cpppch.c: Removed.
* cpptrad.c: Removed.
* cppucnid.h: Removed.
* cppucnid.pl: Removed.
* cppucnid.tab: Removed.
* hashtable.c: Removed.
* hashtable.h: Removed.
* line-map.c: Removed.
* line-map.h: Removed.
* mkdeps.c: Removed.
* mkdeps.h: Removed.
* stringpool.h: Include symtab.h instead of hashtable.h.
* tree.h: Include symtab.h instead of hashtable.h.
* system.h (O_NONBLOCK, O_NOCTTY): Do not define.
gcc/cp/ChangeLog:
2004-05-23 Paolo Bonzini <bonzini@gnu.org>
* Make-lang.in: No need to specify $(LIBCPP).
gcc/java/ChangeLog:
2004-05-23 Paolo Bonzini <bonzini@gnu.org>
* Make-lang.in: Link in $(LIBCPP) instead of mkdeps.o.
libcpp/ChangeLog:
2004-05-23 Paolo Bonzini <bonzini@gnu.org>
Moved libcpp from the gcc subdirectory to the toplevel.
* Makefile.am: New file.
* Makefile.in: Regenerate.
* configure.ac: New file.
* configure: Regenerate.
* config.in: Regenerate.
* charset.c: Moved from gcc/cppcharset.c. Add note about
brokenness of input charset detection. Adjust for change
in name of cppucnid.h.
* errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
* expr.c: Moved from gcc/cppexp.c.
* files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
Remove #define of O_BINARY, it is in system.h.
* identifiers.c: Moved from gcc/cpphash.c.
* internal.h: Moved from gcc/cpphash.h. Change header
guard name. All other files adjusted to match name change.
* init.c: Moved from gcc/cppinit.c.
(init_library) [ENABLE_NLS]: Call bindtextdomain.
* lex.c: Moved from gcc/cpplex.c.
* directives.c: Moved from gcc/cpplib.c.
* macro.c: Moved from gcc/cppmacro.c.
* pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
* traditional.c: Moved from gcc/cpptrad.c.
* ucnid.h: Moved from gcc/cppucnid.h. Change header
guard name.
* ucnid.pl: Moved from gcc/cppucnid.pl.
* ucnid.tab: Moved from gcc/cppucnid.tab. Change header
guard name.
* symtab.c: Moved from gcc/hashtable.c.
* line-map.c: Moved from gcc. Do not include intl.h.
* mkdeps.c: Moved from gcc.
* system.h: New file.
libcpp/include/ChangeLog:
2004-05-23 Paolo Bonzini <bonzini@gnu.org>
* cpplib.h: Moved from gcc. Change header guard name.
* line-map.h: Moved from gcc. Change header guard name.
* mkdeps.h: Moved from gcc. Change header guard name.
* symtab.h: Moved from gcc/hashtable.h. Change header
guard name.
libcpp/po/ChangeLog:
2004-05-23 Paolo Bonzini <bonzini@gnu.org>
* be.po: Extracted from gcc/po/be.po.
* ca.po: Extracted from gcc/po/ca.po.
* da.po: Extracted from gcc/po/da.po.
* de.po: Extracted from gcc/po/de.po.
* el.po: Extracted from gcc/po/el.po.
* es.po: Extracted from gcc/po/es.po.
* fr.po: Extracted from gcc/po/fr.po.
* ja.po: Extracted from gcc/po/ja.po.
* nl.po: Extracted from gcc/po/nl.po.
* sv.po: Extracted from gcc/po/sv.po.
* tr.po: Extracted from gcc/po/tr.po.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82199 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp')
44 files changed, 37932 insertions, 0 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog new file mode 100644 index 00000000000..84a0b8369f2 --- /dev/null +++ b/libcpp/ChangeLog @@ -0,0 +1,35 @@ +2004-05-23 Paolo Bonzini <bonzini@gnu.org> + + Moved libcpp from the gcc subdirectory to the toplevel. + * Makefile.am: New file. + * Makefile.in: Regenerate. + * configure.ac: New file. + * configure: Regenerate. + * config.in: Regenerate. + * charset.c: Moved from gcc/cppcharset.c. Add note about + brokenness of input charset detection. Adjust for change + in name of cppucnid.h. + * errors.c: Moved from gcc/cpperror.c. Do not include intl.h. + * expr.c: Moved from gcc/cppexp.c. + * files.c: Moved from gcc/cppfiles.c. Do not include intl.h. + Remove #define of O_BINARY, it is in system.h. + * identifiers.c: Moved from gcc/cpphash.c. + * internal.h: Moved from gcc/cpphash.h. Change header + guard name. All other files adjusted to match name change. + * init.c: Moved from gcc/cppinit.c. + (init_library) [ENABLE_NLS]: Call bindtextdomain. + * lex.c: Moved from gcc/cpplex.c. + * directives.c: Moved from gcc/cpplib.c. + * macro.c: Moved from gcc/cppmacro.c. + * pch.c: Moved from gcc/cpppch.c. Do not include intl.h. + * traditional.c: Moved from gcc/cpptrad.c. + * ucnid.h: Moved from gcc/cppucnid.h. Change header + guard name. + * ucnid.pl: Moved from gcc/cppucnid.pl. + * ucnid.tab: Moved from gcc/cppucnid.tab. Change header + guard name. + * symtab.c: Moved from gcc/hashtable.c. + * line-map.c: Moved from gcc. Do not include intl.h. + * mkdeps.c: Moved from gcc. + * system.h: New file. + diff --git a/libcpp/Makefile.am b/libcpp/Makefile.am new file mode 100644 index 00000000000..5c6b66cf3e1 --- /dev/null +++ b/libcpp/Makefile.am @@ -0,0 +1,75 @@ +localedir = $(datadir)/locale +ACLOCAL_AMFLAGS = -I ../config +AM_CPPFLAGS = -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/../intl \ + -I$(srcdir)/include -DLOCALEDIR="\"$(localedir)\"" + +noinst_LIBRARIES = libcpp.a +libcpp_a_SOURCES = \ + charset.c directives.c errors.c expr.c files.c \ + identifiers.c init.c lex.c line-map.c macro.c mkdeps.c \ + pch.c symtab.c traditional.c + +noinst_HEADERS = \ + include/cpplib.h include/line-map.h include/mkdeps.h \ + include/symtab.h internal.h system.h ucnid.h + +XGETTEXT = @XGETTEXT@ +GMSGFMT = @GMSGFMT@ +MSGMERGE = msgmerge +CATALOGS = @CATALOGS@ + +if ENABLE_NLS +build-po: $(CATALOGS) +update-po: $(CATALOGS:.gmo=.pox) +else +build-po: +update-po: +endif + +# N.B. We do not attempt to copy these into $(srcdir). +.po.gmo: + -test -d po || mkdir po + $(GMSGFMT) --statistics -o $@ $< + +# The new .po has to be gone over by hand, so we deposit it into +# build/po with a different extension. +# If build/po/$(PACKAGE).pot exists, use it (it was just created), +# else use the one in srcdir. +.po.pox: + -test -d po || mkdir po + $(MSGMERGE) $< `if test -f po/$(PACKAGE).pot; \ + then echo po/$(PACKAGE).pot; \ + else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o $@ + +# This rule has to look for .gmo modules in both srcdir and +# the cwd, and has to check that we actually have a catalog +# for each language, in case they weren't built or included +# with the distribution. +install-data-local: + $(mkinstalldirs) $(DESTDIR)$(datadir) + cats="$(CATALOGS)"; for cat in $$cats; do \ + lang=`basename $$cat | sed 's/\.gmo$$//'`; \ + if [ -f $$cat ]; then :; \ + elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \ + else continue; \ + fi; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + echo $(mkinstalldirs) $(DESTDIR)$$dir; \ + $(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \ + echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ + $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ + done + +# Rule for regenerating the message template (gcc.pot). +# Instead of forcing everyone to edit POTFILES.in, which proved impractical, +# this rule has no dependencies and always regenerates libcpp.pot. This is +# relatively harmless since the .po files do not directly depend on it. +.PHONY: po/$(PACKAGE).pot +po/$(PACKAGE).pot: $(libcpp_a_SOURCES) $(noinst_HEADERS) + -test -d $(srcdir)/po || mkdir $(srcdir)/po + $(XGETTEXT) --default-domain=$(PACKAGE) \ + --keyword=cpp_error,3 --keyword=cpp_errno,3 \ + --keyword=cpp_error_with_line,5 \ + --copyright-holder="Free Software Foundation, Inc." \ + --msgid-bugs-address="http://gcc.gnu.org/bugs.html" \ + --language=c -o po/$(PACKAGE).pot $^ diff --git a/libcpp/Makefile.in b/libcpp/Makefile.in new file mode 100644 index 00000000000..05390cba6f1 --- /dev/null +++ b/libcpp/Makefile.in @@ -0,0 +1,641 @@ +# Makefile.in generated by automake 1.8.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +SOURCES = $(libcpp_a_SOURCES) + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +DIST_COMMON = $(am__configure_deps) $(noinst_HEADERS) \ + $(srcdir)/../config.guess $(srcdir)/../config.sub \ + $(srcdir)/../depcomp $(srcdir)/../install-sh \ + $(srcdir)/../missing $(srcdir)/../mkinstalldirs \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/config.in $(top_srcdir)/configure ChangeLog +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ + $(top_srcdir)/../config/gettext.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +AR = ar +ARFLAGS = cru +LIBRARIES = $(noinst_LIBRARIES) +libcpp_a_AR = $(AR) $(ARFLAGS) +libcpp_a_LIBADD = +am_libcpp_a_OBJECTS = charset.$(OBJEXT) directives.$(OBJEXT) \ + errors.$(OBJEXT) expr.$(OBJEXT) files.$(OBJEXT) \ + identifiers.$(OBJEXT) init.$(OBJEXT) lex.$(OBJEXT) \ + line-map.$(OBJEXT) macro.$(OBJEXT) mkdeps.$(OBJEXT) \ + pch.$(OBJEXT) symtab.$(OBJEXT) traditional.$(OBJEXT) +libcpp_a_OBJECTS = $(am_libcpp_a_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I. +depcomp = $(SHELL) $(top_srcdir)/../depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/charset.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/directives.Po ./$(DEPDIR)/errors.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/expr.Po ./$(DEPDIR)/files.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/identifiers.Po ./$(DEPDIR)/init.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lex.Po ./$(DEPDIR)/line-map.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/macro.Po ./$(DEPDIR)/mkdeps.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/pch.Po ./$(DEPDIR)/symtab.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/traditional.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libcpp_a_SOURCES) +DIST_SOURCES = $(libcpp_a_SOURCES) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CATALOGS = @CATALOGS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_NLS_FALSE = @ENABLE_NLS_FALSE@ +ENABLE_NLS_TRUE = @ENABLE_NLS_TRUE@ +EXEEXT = @EXEEXT@ +GMSGFMT = @GMSGFMT@ +INCINTL = @INCINTL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBINTL_DEP = @LIBINTL_DEP@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBICONV = @LTLIBICONV@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +localedir = $(datadir)/locale +ACLOCAL_AMFLAGS = -I ../config +AM_CPPFLAGS = -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/../intl \ + -I$(srcdir)/include -DLOCALEDIR="\"$(localedir)\"" + +noinst_LIBRARIES = libcpp.a +libcpp_a_SOURCES = \ + charset.c directives.c errors.c expr.c files.c \ + identifiers.c init.c lex.c line-map.c macro.c mkdeps.c \ + pch.c symtab.c traditional.c + +noinst_HEADERS = \ + include/cpplib.h include/line-map.h include/mkdeps.h \ + include/symtab.h internal.h system.h ucnid.h + +MSGMERGE = msgmerge +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .gmo .o .obj .po .pox +am--refresh: + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ + cd $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libcpp.a: $(libcpp_a_OBJECTS) $(libcpp_a_DEPENDENCIES) + -rm -f libcpp.a + $(libcpp_a_AR) libcpp.a $(libcpp_a_OBJECTS) $(libcpp_a_LIBADD) + $(RANLIB) libcpp.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/charset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/directives.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errors.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/files.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/identifiers.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/line-map.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/macro.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdeps.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symtab.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/traditional.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -z "$$unique" && unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + $(mkdir_p) $(distdir)/.. $(distdir)/../config $(distdir)/include + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + $(AMTAR) chof - $(distdir) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(AMTAR) xf - ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(AMTAR) xf - ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-am +all-am: Makefile $(LIBRARIES) $(HEADERS) config.h +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-data-local + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ + clean-generic clean-noinstLIBRARIES ctags dist dist-all \ + dist-bzip2 dist-gzip dist-shar dist-tarZ dist-zip distcheck \ + distclean distclean-compile distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-data-local install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am + + +@ENABLE_NLS_TRUE@build-po: $(CATALOGS) +@ENABLE_NLS_TRUE@update-po: $(CATALOGS:.gmo=.pox) +@ENABLE_NLS_FALSE@build-po: +@ENABLE_NLS_FALSE@update-po: + +# N.B. We do not attempt to copy these into $(srcdir). +.po.gmo: + -test -d po || mkdir po + $(GMSGFMT) --statistics -o $@ $< + +# The new .po has to be gone over by hand, so we deposit it into +# build/po with a different extension. +# If build/po/$(PACKAGE).pot exists, use it (it was just created), +# else use the one in srcdir. +.po.pox: + -test -d po || mkdir po + $(MSGMERGE) $< `if test -f po/$(PACKAGE).pot; \ + then echo po/$(PACKAGE).pot; \ + else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o $@ + +# This rule has to look for .gmo modules in both srcdir and +# the cwd, and has to check that we actually have a catalog +# for each language, in case they weren't built or included +# with the distribution. +install-data-local: + $(mkinstalldirs) $(DESTDIR)$(datadir) + cats="$(CATALOGS)"; for cat in $$cats; do \ + lang=`basename $$cat | sed 's/\.gmo$$//'`; \ + if [ -f $$cat ]; then :; \ + elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \ + else continue; \ + fi; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + echo $(mkinstalldirs) $(DESTDIR)$$dir; \ + $(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \ + echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ + $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ + done + +# Rule for regenerating the message template (gcc.pot). +# Instead of forcing everyone to edit POTFILES.in, which proved impractical, +# this rule has no dependencies and always regenerates libcpp.pot. This is +# relatively harmless since the .po files do not directly depend on it. +.PHONY: po/$(PACKAGE).pot +po/$(PACKAGE).pot: $(libcpp_a_SOURCES) $(noinst_HEADERS) + -test -d $(srcdir)/po || mkdir $(srcdir)/po + $(XGETTEXT) --default-domain=$(PACKAGE) \ + --keyword=cpp_error,3 --keyword=cpp_errno,3 \ + --keyword=cpp_error_with_line,5 \ + --copyright-holder="Free Software Foundation, Inc." \ + --msgid-bugs-address="http://gcc.gnu.org/bugs.html" \ + --language=c -o po/$(PACKAGE).pot $^ +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libcpp/aclocal.m4 b/libcpp/aclocal.m4 new file mode 100644 index 00000000000..12cd2d0fe48 --- /dev/null +++ b/libcpp/aclocal.m4 @@ -0,0 +1,1899 @@ +# generated automatically by aclocal 1.8.4 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# codeset.m4 serial AM1 (gettext-0.10.40) +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +AC_DEFUN([AM_LANGINFO_CODESET], +[ + AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, + [AC_TRY_LINK([#include <langinfo.h>], + [char* cs = nl_langinfo(CODESET);], + am_cv_langinfo_codeset=yes, + am_cv_langinfo_codeset=no) + ]) + if test $am_cv_langinfo_codeset = yes; then + AC_DEFINE(HAVE_LANGINFO_CODESET, 1, + [Define if you have <langinfo.h> and nl_langinfo(CODESET).]) + fi +]) + +# iconv.m4 serial AM4 (gettext-0.11.3) +dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], +[ + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([iconv]) +]) + +AC_DEFUN([AM_ICONV_LINK], +[ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable GNU libiconv installed). + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + + dnl Add $INCICONV to CPPFLAGS before performing the following checks, + dnl because if the user has installed libiconv and not disabled its use + dnl via --without-libiconv-prefix, he wants to use it. The first + dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. + am_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) + + AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + AC_TRY_LINK([#include <stdlib.h> +#include <iconv.h>], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_func_iconv=yes) + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + AC_TRY_LINK([#include <stdlib.h> +#include <iconv.h>], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_lib_iconv=yes + am_cv_func_iconv=yes) + LIBS="$am_save_LIBS" + fi + ]) + if test "$am_cv_func_iconv" = yes; then + AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) + fi + if test "$am_cv_lib_iconv" = yes; then + AC_MSG_CHECKING([how to link with libiconv]) + AC_MSG_RESULT([$LIBICONV]) + else + dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV + dnl either. + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + AC_SUBST(LIBICONV) + AC_SUBST(LTLIBICONV) +]) + +AC_DEFUN([AM_ICONV], +[ + AM_ICONV_LINK + if test "$am_cv_func_iconv" = yes; then + AC_MSG_CHECKING([for iconv declaration]) + AC_CACHE_VAL(am_cv_proto_iconv, [ + AC_TRY_COMPILE([ +#include <stdlib.h> +#include <iconv.h> +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif +], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) + am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + AC_MSG_RESULT([$]{ac_t:- + }[$]am_cv_proto_iconv) + AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, + [Define as const if the declaration of iconv() needs const.]) + fi +]) + +# lib-ld.m4 serial 3 (gettext-0.13) +dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl Subroutines of libtool.m4, +dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision +dnl with libtool.m4. + +dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. +AC_DEFUN([AC_LIB_PROG_LD_GNU], +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 </dev/null` in +*GNU* | *'with BFD'*) + acl_cv_prog_gnu_ld=yes ;; +*) + acl_cv_prog_gnu_ld=no ;; +esac]) +with_gnu_ld=$acl_cv_prog_gnu_ld +]) + +dnl From libtool-1.4. Sets the variable LD. +AC_DEFUN([AC_LIB_PROG_LD], +[AC_ARG_WITH(gnu-ld, +[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], +test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by GCC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]* | [A-Za-z]:[\\/]*)] + [re_direlt='/[^/][^/]*/\.\./'] + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(acl_cv_path_LD, +[if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break ;; + *) + test "$with_gnu_ld" != yes && break ;; + esac + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$acl_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +AC_LIB_PROG_LD_GNU +]) + +# lib-link.m4 serial 4 (gettext-0.12) +dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and +dnl augments the CPPFLAGS variable. +AC_DEFUN([AC_LIB_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + ac_cv_lib[]Name[]_libs="$LIB[]NAME" + ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" + ac_cv_lib[]Name[]_cppflags="$INC[]NAME" + ]) + LIB[]NAME="$ac_cv_lib[]Name[]_libs" + LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" + INC[]NAME="$ac_cv_lib[]Name[]_cppflags" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the + dnl results of this search when this library appears as a dependency. + HAVE_LIB[]NAME=yes + undefine([Name]) + undefine([NAME]) +]) + +dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) +dnl searches for libname and the libraries corresponding to explicit and +dnl implicit dependencies, together with the specified include files and +dnl the ability to compile and link the specified testcode. If found, it +dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and +dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and +dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs +dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. +AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], +[ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + + dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + + dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, + dnl because if the user has installed lib[]Name and not disabled its use + dnl via --without-lib[]Name-prefix, he wants to use it. + ac_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + + AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIB[]NAME" + AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) + LIBS="$ac_save_LIBS" + ]) + if test "$ac_cv_lib[]Name" = yes; then + HAVE_LIB[]NAME=yes + AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) + AC_MSG_CHECKING([how to link with lib[]$1]) + AC_MSG_RESULT([$LIB[]NAME]) + else + HAVE_LIB[]NAME=no + dnl If $LIB[]NAME didn't lead to a usable library, we don't need + dnl $INC[]NAME either. + CPPFLAGS="$ac_save_CPPFLAGS" + LIB[]NAME= + LTLIB[]NAME= + fi + AC_SUBST([HAVE_LIB]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + undefine([Name]) + undefine([NAME]) +]) + +dnl Determine the platform dependent parameters needed to use rpath: +dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, +dnl hardcode_direct, hardcode_minus_L. +AC_DEFUN([AC_LIB_RPATH], +[ + AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS + AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld + AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host + AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir + AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + ]) + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + dnl Determine whether the user wants rpath handling at all. + AC_ARG_ENABLE(rpath, + [ --disable-rpath do not hardcode runtime library paths], + :, enable_rpath=yes) +]) + +dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. +AC_DEFUN([AC_LIB_LINKFLAGS_BODY], +[ + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib$1-prefix], +[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib + --without-lib$1-prefix don't search for lib$1 in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi +]) + dnl Search the library and its dependencies in $additional_libdir and + dnl $LDFLAGS. Using breadth-first-seach. + LIB[]NAME= + LTLIB[]NAME= + INC[]NAME= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='$1 $2' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + dnl See if it was already located by an earlier AC_LIB_LINKFLAGS + dnl or AC_LIB_HAVE_LINKFLAGS call. + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" + else + dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined + dnl that this library doesn't exist. So just drop it. + : + fi + else + dnl Search the library lib$name in $additional_libdir and $LDFLAGS + dnl and the already constructed $LIBNAME/$LTLIBNAME. + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + dnl Found the library. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + dnl Linking with a shared library. We attempt to hardcode its + dnl directory into the executable's runpath, unless it's the + dnl standard /usr/lib. + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + dnl No hardcoding is needed. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + dnl The hardcoding into $LIBNAME is system dependent. + if test "$hardcode_direct" = yes; then + dnl Using DIR/libNAME.so during linking hardcodes DIR into the + dnl resulting binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + dnl Rely on "-L$found_dir". + dnl But don't add it if it's already contained in the LDFLAGS + dnl or the already constructed $LIBNAME + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH + dnl here, because this doesn't fit in flags passed to the + dnl compiler. So give up. No hardcoding. This affects only + dnl very old systems. + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + dnl Linking with a static library. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" + else + dnl We shouldn't come here, but anyway it's good to have a + dnl fallback. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" + fi + fi + dnl Assume the include files are nearby. + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + dnl Potentially add $additional_includedir to $INCNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's /usr/local/include and we are using GCC on Linux, + dnl 3. if it's already present in $CPPFLAGS or the already + dnl constructed $INCNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INC[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $INCNAME. + INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + dnl Look for dependencies. + if test -n "$found_la"; then + dnl Read the .la file. It defines the variables + dnl dlname, library_names, old_library, dependency_libs, current, + dnl age, revision, installed, dlopen, dlpreopen, libdir. + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + dnl We use only dependency_libs. + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's /usr/local/lib and we are using GCC on Linux, + dnl 3. if it's already present in $LDFLAGS or the already + dnl constructed $LIBNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LIBNAME. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LTLIBNAME. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + dnl Handle this in the next round. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + dnl Handle this in the next round. Throw away the .la's + dnl directory; it is already contained in a preceding -L + dnl option. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + dnl Most likely an immediate library name. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" + ;; + esac + done + fi + else + dnl Didn't find the library; assume it is in the system directories + dnl known to the linker and runtime loader. (All the system + dnl directories known to the linker should also be known to the + dnl runtime loader, otherwise the system is severely misconfigured.) + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user must + dnl pass all path elements in one option. We can arrange that for a + dnl single library, but not when more than one $LIBNAMEs are used. + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + else + dnl The -rpath options are cumulative. + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + dnl When using libtool, the option that works for both libraries and + dnl executables is -R. The -R options are cumulative. + for found_dir in $ltrpathdirs; do + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" + done + fi +]) + +dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, +dnl unless already present in VAR. +dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes +dnl contains two or three consecutive elements that belong together. +AC_DEFUN([AC_LIB_APPENDTOVAR], +[ + for element in [$2]; do + haveit= + for x in $[$1]; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + [$1]="${[$1]}${[$1]:+ }$element" + fi + done +]) + +# lib-prefix.m4 serial 3 (gettext-0.13) +dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl From Bruno Haible. + +dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and +dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't +dnl require excessive bracketing. +ifdef([AC_HELP_STRING], +[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], +[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) + +dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed +dnl to access previously installed libraries. The basic assumption is that +dnl a user will want packages to use other packages he previously installed +dnl with the same --prefix option. +dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate +dnl libraries, but is otherwise very convenient. +AC_DEFUN([AC_LIB_PREFIX], +[ + AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_LIB_ARG_WITH([lib-prefix], +[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib + --without-lib-prefix don't search for libraries in includedir and libdir], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi +]) + if test $use_additional = yes; then + dnl Potentially add $additional_includedir to $CPPFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's already present in $CPPFLAGS, + dnl 3. if it's /usr/local/include and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + for x in $CPPFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $CPPFLAGS. + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" + fi + fi + fi + fi + dnl Potentially add $additional_libdir to $LDFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's already present in $LDFLAGS, + dnl 3. if it's /usr/local/lib and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + for x in $LDFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LDFLAGS. + LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" + fi + fi + fi + fi + fi +]) + +dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, +dnl acl_final_exec_prefix, containing the values to which $prefix and +dnl $exec_prefix will expand at the end of the configure script. +AC_DEFUN([AC_LIB_PREPARE_PREFIX], +[ + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" +]) + +dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the +dnl variables prefix and exec_prefix bound to the values they will have +dnl at the end of the configure script. +AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], +[ + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + $1 + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" +]) + +# -*- Autoconf -*- +# Copyright (C) 2002, 2003 Free Software Foundation, Inc. +# Generated from amversion.in; do not edit by hand. + +# 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., 59 Temple Place - Suite 330, Boston, MA + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.8"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.8.4])]) + +# AM_AUX_DIR_EXPAND + +# Copyright (C) 2001, 2003 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 6 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]) +fi])]) + +# serial 7 -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 +# 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +#serial 2 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# This macro actually does too much some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 11 + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG(AMTAR, tar) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl + +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. + +# Copyright (C) 2001, 2003 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# -*- Autoconf -*- +# Copyright (C) 2003 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 1 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004 +# 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# -*- Autoconf -*- + + +# Copyright (C) 1997, 1999, 2000, 2001, 2003 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. + +# Copyright (C) 2003, 2004 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # Keeping the `.' argument allows $(mkdir_p) to be used without + # argument. Indeed, we sometimes output rules like + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. + # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more + # expensive solution, as it forces Make to start a sub-shell.) + mkdir_p='mkdir -p -- .' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# +# Check to make sure that the build environment is sane. +# + +# Copyright (C) 1996, 1997, 2000, 2001, 2003 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# AM_PROG_INSTALL_STRIP + +# Copyright (C) 2001, 2003 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., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +m4_include([../config/acx.m4]) +m4_include([../config/gettext.m4]) diff --git a/libcpp/charset.c b/libcpp/charset.c new file mode 100644 index 00000000000..45e24543fd8 --- /dev/null +++ b/libcpp/charset.c @@ -0,0 +1,1429 @@ +/* CPP Library - charsets + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Free Software Foundation, Inc. + + Broken out of c-lex.c Apr 2003, adding valid C99 UCN ranges. + +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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "config.h" +#include "system.h" +#include "cpplib.h" +#include "internal.h" +#include "ucnid.h" + +/* Character set handling for C-family languages. + + Terminological note: In what follows, "charset" or "character set" + will be taken to mean both an abstract set of characters and an + encoding for that set. + + The C99 standard discusses two character sets: source and execution. + The source character set is used for internal processing in translation + phases 1 through 4; the execution character set is used thereafter. + Both are required by 5.2.1.2p1 to be multibyte encodings, not wide + character encodings (see 3.7.2, 3.7.3 for the standardese meanings + of these terms). Furthermore, the "basic character set" (listed in + 5.2.1p3) is to be encoded in each with values one byte wide, and is + to appear in the initial shift state. + + It is not explicitly mentioned, but there is also a "wide execution + character set" used to encode wide character constants and wide + string literals; this is supposed to be the result of applying the + standard library function mbstowcs() to an equivalent narrow string + (6.4.5p5). However, the behavior of hexadecimal and octal + \-escapes is at odds with this; they are supposed to be translated + directly to wchar_t values (6.4.4.4p5,6). + + The source character set is not necessarily the character set used + to encode physical source files on disk; translation phase 1 converts + from whatever that encoding is to the source character set. + + The presence of universal character names in C99 (6.4.3 et seq.) + forces the source character set to be isomorphic to ISO 10646, + that is, Unicode. There is no such constraint on the execution + character set; note also that the conversion from source to + execution character set does not occur for identifiers (5.1.1.2p1#5). + + For convenience of implementation, the source character set's + encoding of the basic character set should be identical to the + execution character set OF THE HOST SYSTEM's encoding of the basic + character set, and it should not be a state-dependent encoding. + + cpplib uses UTF-8 or UTF-EBCDIC for the source character set, + depending on whether the host is based on ASCII or EBCDIC (see + respectively Unicode section 2.3/ISO10646 Amendment 2, and Unicode + Technical Report #16). With limited exceptions, it relies on the + system library's iconv() primitive to do charset conversion + (specified in SUSv2). */ + +#if !HAVE_ICONV +/* Make certain that the uses of iconv(), iconv_open(), iconv_close() + below, which are guarded only by if statements with compile-time + constant conditions, do not cause link errors. */ +#define iconv_open(x, y) (errno = EINVAL, (iconv_t)-1) +#define iconv(a,b,c,d,e) (errno = EINVAL, (size_t)-1) +#define iconv_close(x) (void)0 +#define ICONV_CONST +#endif + +#if HOST_CHARSET == HOST_CHARSET_ASCII +#define SOURCE_CHARSET "UTF-8" +#elif HOST_CHARSET == HOST_CHARSET_EBCDIC +#define SOURCE_CHARSET "UTF-EBCDIC" +#else +#error "Unrecognized basic host character set" +#endif + +#ifndef EILSEQ +#define EILSEQ EINVAL +#endif + +/* This structure is used for a resizable string buffer throughout. */ +/* Don't call it strbuf, as that conflicts with unistd.h on systems + such as DYNIX/ptx where unistd.h includes stropts.h. */ +struct _cpp_strbuf +{ + uchar *text; + size_t asize; + size_t len; +}; + +/* This is enough to hold any string that fits on a single 80-column + line, even if iconv quadruples its size (e.g. conversion from + ASCII to UTF-32) rounded up to a power of two. */ +#define OUTBUF_BLOCK_SIZE 256 + +/* Conversions between UTF-8 and UTF-16/32 are implemented by custom + logic. This is because a depressing number of systems lack iconv, + or have have iconv libraries that do not do these conversions, so + we need a fallback implementation for them. To ensure the fallback + doesn't break due to neglect, it is used on all systems. + + UTF-32 encoding is nice and simple: a four-byte binary number, + constrained to the range 00000000-7FFFFFFF to avoid questions of + signedness. We do have to cope with big- and little-endian + variants. + + UTF-16 encoding uses two-byte binary numbers, again in big- and + little-endian variants, for all values in the 00000000-0000FFFF + range. Values in the 00010000-0010FFFF range are encoded as pairs + of two-byte numbers, called "surrogate pairs": given a number S in + this range, it is mapped to a pair (H, L) as follows: + + H = (S - 0x10000) / 0x400 + 0xD800 + L = (S - 0x10000) % 0x400 + 0xDC00 + + Two-byte values in the D800...DFFF range are ill-formed except as a + component of a surrogate pair. Even if the encoding within a + two-byte value is little-endian, the H member of the surrogate pair + comes first. + + There is no way to encode values in the 00110000-7FFFFFFF range, + which is not currently a problem as there are no assigned code + points in that range; however, the author expects that it will + eventually become necessary to abandon UTF-16 due to this + limitation. Note also that, because of these pairs, UTF-16 does + not meet the requirements of the C standard for a wide character + encoding (see 3.7.3 and 6.4.4.4p11). + + UTF-8 encoding looks like this: + + value range encoded as + 00000000-0000007F 0xxxxxxx + 00000080-000007FF 110xxxxx 10xxxxxx + 00000800-0000FFFF 1110xxxx 10xxxxxx 10xxxxxx + 00010000-001FFFFF 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + 00200000-03FFFFFF 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx + 04000000-7FFFFFFF 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx + + Values in the 0000D800 ... 0000DFFF range (surrogates) are invalid, + which means that three-byte sequences ED xx yy, with A0 <= xx <= BF, + never occur. Note also that any value that can be encoded by a + given row of the table can also be encoded by all successive rows, + but this is not done; only the shortest possible encoding for any + given value is valid. For instance, the character 07C0 could be + encoded as any of DF 80, E0 9F 80, F0 80 9F 80, F8 80 80 9F 80, or + FC 80 80 80 9F 80. Only the first is valid. + + An implementation note: the transformation from UTF-16 to UTF-8, or + vice versa, is easiest done by using UTF-32 as an intermediary. */ + +/* Internal primitives which go from an UTF-8 byte stream to native-endian + UTF-32 in a cppchar_t, or vice versa; this avoids an extra marshal/unmarshal + operation in several places below. */ +static inline int +one_utf8_to_cppchar (const uchar **inbufp, size_t *inbytesleftp, + cppchar_t *cp) +{ + static const uchar masks[6] = { 0x7F, 0x1F, 0x0F, 0x07, 0x02, 0x01 }; + static const uchar patns[6] = { 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; + + cppchar_t c; + const uchar *inbuf = *inbufp; + size_t nbytes, i; + + if (*inbytesleftp < 1) + return EINVAL; + + c = *inbuf; + if (c < 0x80) + { + *cp = c; + *inbytesleftp -= 1; + *inbufp += 1; + return 0; + } + + /* The number of leading 1-bits in the first byte indicates how many + bytes follow. */ + for (nbytes = 2; nbytes < 7; nbytes++) + if ((c & ~masks[nbytes-1]) == patns[nbytes-1]) + goto found; + return EILSEQ; + found: + + if (*inbytesleftp < nbytes) + return EINVAL; + + c = (c & masks[nbytes-1]); + inbuf++; + for (i = 1; i < nbytes; i++) + { + cppchar_t n = *inbuf++; + if ((n & 0xC0) != 0x80) + return EILSEQ; + c = ((c << 6) + (n & 0x3F)); + } + + /* Make sure the shortest possible encoding was used. */ + if (c <= 0x7F && nbytes > 1) return EILSEQ; + if (c <= 0x7FF && nbytes > 2) return EILSEQ; + if (c <= 0xFFFF && nbytes > 3) return EILSEQ; + if (c <= 0x1FFFFF && nbytes > 4) return EILSEQ; + if (c <= 0x3FFFFFF && nbytes > 5) return EILSEQ; + + /* Make sure the character is valid. */ + if (c > 0x7FFFFFFF || (c >= 0xD800 && c <= 0xDFFF)) return EILSEQ; + + *cp = c; + *inbufp = inbuf; + *inbytesleftp -= nbytes; + return 0; +} + +static inline int +one_cppchar_to_utf8 (cppchar_t c, uchar **outbufp, size_t *outbytesleftp) +{ + static const uchar masks[6] = { 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; + static const uchar limits[6] = { 0x80, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE }; + size_t nbytes; + uchar buf[6], *p = &buf[6]; + uchar *outbuf = *outbufp; + + nbytes = 1; + if (c < 0x80) + *--p = c; + else + { + do + { + *--p = ((c & 0x3F) | 0x80); + c >>= 6; + nbytes++; + } + while (c >= 0x3F || (c & limits[nbytes-1])); + *--p = (c | masks[nbytes-1]); + } + + if (*outbytesleftp < nbytes) + return E2BIG; + + while (p < &buf[6]) + *outbuf++ = *p++; + *outbytesleftp -= nbytes; + *outbufp = outbuf; + return 0; +} + +/* The following four functions transform one character between the two + encodings named in the function name. All have the signature + int (*)(iconv_t bigend, const uchar **inbufp, size_t *inbytesleftp, + uchar **outbufp, size_t *outbytesleftp) + + BIGEND must have the value 0 or 1, coerced to (iconv_t); it is + interpreted as a boolean indicating whether big-endian or + little-endian encoding is to be used for the member of the pair + that is not UTF-8. + + INBUFP, INBYTESLEFTP, OUTBUFP, OUTBYTESLEFTP work exactly as they + do for iconv. + + The return value is either 0 for success, or an errno value for + failure, which may be E2BIG (need more space), EILSEQ (ill-formed + input sequence), ir EINVAL (incomplete input sequence). */ + +static inline int +one_utf8_to_utf32 (iconv_t bigend, const uchar **inbufp, size_t *inbytesleftp, + uchar **outbufp, size_t *outbytesleftp) +{ + uchar *outbuf; + cppchar_t s = 0; + int rval; + + /* Check for space first, since we know exactly how much we need. */ + if (*outbytesleftp < 4) + return E2BIG; + + rval = one_utf8_to_cppchar (inbufp, inbytesleftp, &s); + if (rval) + return rval; + + outbuf = *outbufp; + outbuf[bigend ? 3 : 0] = (s & 0x000000FF); + outbuf[bigend ? 2 : 1] = (s & 0x0000FF00) >> 8; + outbuf[bigend ? 1 : 2] = (s & 0x00FF0000) >> 16; + outbuf[bigend ? 0 : 3] = (s & 0xFF000000) >> 24; + + *outbufp += 4; + *outbytesleftp -= 4; + return 0; +} + +static inline int +one_utf32_to_utf8 (iconv_t bigend, const uchar **inbufp, size_t *inbytesleftp, + uchar **outbufp, size_t *outbytesleftp) +{ + cppchar_t s; + int rval; + const uchar *inbuf; + + if (*inbytesleftp < 4) + return EINVAL; + + inbuf = *inbufp; + + s = inbuf[bigend ? 0 : 3] << 24; + s += inbuf[bigend ? 1 : 2] << 16; + s += inbuf[bigend ? 2 : 1] << 8; + s += inbuf[bigend ? 3 : 0]; + + if (s >= 0x7FFFFFFF || (s >= 0xD800 && s <= 0xDFFF)) + return EILSEQ; + + rval = one_cppchar_to_utf8 (s, outbufp, outbytesleftp); + if (rval) + return rval; + + *inbufp += 4; + *inbytesleftp -= 4; + return 0; +} + +static inline int +one_utf8_to_utf16 (iconv_t bigend, const uchar **inbufp, size_t *inbytesleftp, + uchar **outbufp, size_t *outbytesleftp) +{ + int rval; + cppchar_t s = 0; + const uchar *save_inbuf = *inbufp; + size_t save_inbytesleft = *inbytesleftp; + uchar *outbuf = *outbufp; + + rval = one_utf8_to_cppchar (inbufp, inbytesleftp, &s); + if (rval) + return rval; + + if (s > 0x0010FFFF) + { + *inbufp = save_inbuf; + *inbytesleftp = save_inbytesleft; + return EILSEQ; + } + + if (s < 0xFFFF) + { + if (*outbytesleftp < 2) + { + *inbufp = save_inbuf; + *inbytesleftp = save_inbytesleft; + return E2BIG; + } + outbuf[bigend ? 1 : 0] = (s & 0x00FF); + outbuf[bigend ? 0 : 1] = (s & 0xFF00) >> 8; + + *outbufp += 2; + *outbytesleftp -= 2; + return 0; + } + else + { + cppchar_t hi, lo; + + if (*outbytesleftp < 4) + { + *inbufp = save_inbuf; + *inbytesleftp = save_inbytesleft; + return E2BIG; + } + + hi = (s - 0x10000) / 0x400 + 0xD800; + lo = (s - 0x10000) % 0x400 + 0xDC00; + + /* Even if we are little-endian, put the high surrogate first. + ??? Matches practice? */ + outbuf[bigend ? 1 : 0] = (hi & 0x00FF); + outbuf[bigend ? 0 : 1] = (hi & 0xFF00) >> 8; + outbuf[bigend ? 3 : 2] = (lo & 0x00FF); + outbuf[bigend ? 2 : 3] = (lo & 0xFF00) >> 8; + + *outbufp += 4; + *outbytesleftp -= 4; + return 0; + } +} + +static inline int +one_utf16_to_utf8 (iconv_t bigend, const uchar **inbufp, size_t *inbytesleftp, + uchar **outbufp, size_t *outbytesleftp) +{ + cppchar_t s; + const uchar *inbuf = *inbufp; + int rval; + + if (*inbytesleftp < 2) + return EINVAL; + s = inbuf[bigend ? 0 : 1] << 8; + s += inbuf[bigend ? 1 : 0]; + + /* Low surrogate without immediately preceding high surrogate is invalid. */ + if (s >= 0xDC00 && s <= 0xDFFF) + return EILSEQ; + /* High surrogate must have a following low surrogate. */ + else if (s >= 0xD800 && s <= 0xDBFF) + { + cppchar_t hi = s, lo; + if (*inbytesleftp < 4) + return EINVAL; + + lo = inbuf[bigend ? 2 : 3] << 8; + lo += inbuf[bigend ? 3 : 2]; + + if (lo < 0xDC00 || lo > 0xDFFF) + return EILSEQ; + + s = (hi - 0xD800) * 0x400 + (lo - 0xDC00) + 0x10000; + } + + rval = one_cppchar_to_utf8 (s, outbufp, outbytesleftp); + if (rval) + return rval; + + /* Success - update the input pointers (one_cppchar_to_utf8 has done + the output pointers for us). */ + if (s <= 0xFFFF) + { + *inbufp += 2; + *inbytesleftp -= 2; + } + else + { + *inbufp += 4; + *inbytesleftp -= 4; + } + return 0; +} + +/* Helper routine for the next few functions. The 'const' on + one_conversion means that we promise not to modify what function is + pointed to, which lets the inliner see through it. */ + +static inline bool +conversion_loop (int (*const one_conversion)(iconv_t, const uchar **, size_t *, + uchar **, size_t *), + iconv_t cd, const uchar *from, size_t flen, struct _cpp_strbuf *to) +{ + const uchar *inbuf; + uchar *outbuf; + size_t inbytesleft, outbytesleft; + int rval; + + inbuf = from; + inbytesleft = flen; + outbuf = to->text + to->len; + outbytesleft = to->asize - to->len; + + for (;;) + { + do + rval = one_conversion (cd, &inbuf, &inbytesleft, + &outbuf, &outbytesleft); + while (inbytesleft && !rval); + + if (__builtin_expect (inbytesleft == 0, 1)) + { + to->len = to->asize - outbytesleft; + return true; + } + if (rval != E2BIG) + { + errno = rval; + return false; + } + + outbytesleft += OUTBUF_BLOCK_SIZE; + to->asize += OUTBUF_BLOCK_SIZE; + to->text = xrealloc (to->text, to->asize); + outbuf = to->text + to->asize - outbytesleft; + } +} + + +/* These functions convert entire strings between character sets. + They all have the signature + + bool (*)(iconv_t cd, const uchar *from, size_t flen, struct _cpp_strbuf *to); + + The input string FROM is converted as specified by the function + name plus the iconv descriptor CD (which may be fake), and the + result appended to TO. On any error, false is returned, otherwise true. */ + +/* These four use the custom conversion code above. */ +static bool +convert_utf8_utf16 (iconv_t cd, const uchar *from, size_t flen, + struct _cpp_strbuf *to) +{ + return conversion_loop (one_utf8_to_utf16, cd, from, flen, to); +} + +static bool +convert_utf8_utf32 (iconv_t cd, const uchar *from, size_t flen, + struct _cpp_strbuf *to) +{ + return conversion_loop (one_utf8_to_utf32, cd, from, flen, to); +} + +static bool +convert_utf16_utf8 (iconv_t cd, const uchar *from, size_t flen, + struct _cpp_strbuf *to) +{ + return conversion_loop (one_utf16_to_utf8, cd, from, flen, to); +} + +static bool +convert_utf32_utf8 (iconv_t cd, const uchar *from, size_t flen, + struct _cpp_strbuf *to) +{ + return conversion_loop (one_utf32_to_utf8, cd, from, flen, to); +} + +/* Identity conversion, used when we have no alternative. */ +static bool +convert_no_conversion (iconv_t cd ATTRIBUTE_UNUSED, + const uchar *from, size_t flen, struct _cpp_strbuf *to) +{ + if (to->len + flen > to->asize) + { + to->asize = to->len + flen; + to->text = xrealloc (to->text, to->asize); + } + memcpy (to->text + to->len, from, flen); + to->len += flen; + return true; +} + +/* And this one uses the system iconv primitive. It's a little + different, since iconv's interface is a little different. */ +#if HAVE_ICONV +static bool +convert_using_iconv (iconv_t cd, const uchar *from, size_t flen, + struct _cpp_strbuf *to) +{ + ICONV_CONST char *inbuf; + char *outbuf; + size_t inbytesleft, outbytesleft; + + /* Reset conversion descriptor and check that it is valid. */ + if (iconv (cd, 0, 0, 0, 0) == (size_t)-1) + return false; + + inbuf = (ICONV_CONST char *)from; + inbytesleft = flen; + outbuf = (char *)to->text + to->len; + outbytesleft = to->asize - to->len; + + for (;;) + { + iconv (cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); + if (__builtin_expect (inbytesleft == 0, 1)) + { + to->len = to->asize - outbytesleft; + return true; + } + if (errno != E2BIG) + return false; + + outbytesleft += OUTBUF_BLOCK_SIZE; + to->asize += OUTBUF_BLOCK_SIZE; + to->text = xrealloc (to->text, to->asize); + outbuf = (char *)to->text + to->asize - outbytesleft; + } +} +#else +#define convert_using_iconv 0 /* prevent undefined symbol error below */ +#endif + +/* Arrange for the above custom conversion logic to be used automatically + when conversion between a suitable pair of character sets is requested. */ + +#define APPLY_CONVERSION(CONVERTER, FROM, FLEN, TO) \ + CONVERTER.func (CONVERTER.cd, FROM, FLEN, TO) + +struct conversion +{ + const char *pair; + convert_f func; + iconv_t fake_cd; +}; +static const struct conversion conversion_tab[] = { + { "UTF-8/UTF-32LE", convert_utf8_utf32, (iconv_t)0 }, + { "UTF-8/UTF-32BE", convert_utf8_utf32, (iconv_t)1 }, + { "UTF-8/UTF-16LE", convert_utf8_utf16, (iconv_t)0 }, + { "UTF-8/UTF-16BE", convert_utf8_utf16, (iconv_t)1 }, + { "UTF-32LE/UTF-8", convert_utf32_utf8, (iconv_t)0 }, + { "UTF-32BE/UTF-8", convert_utf32_utf8, (iconv_t)1 }, + { "UTF-16LE/UTF-8", convert_utf16_utf8, (iconv_t)0 }, + { "UTF-16BE/UTF-8", convert_utf16_utf8, (iconv_t)1 }, +}; + +/* Subroutine of cpp_init_iconv: initialize and return a + cset_converter structure for conversion from FROM to TO. If + iconv_open() fails, issue an error and return an identity + converter. Silently return an identity converter if FROM and TO + are identical. */ +static struct cset_converter +init_iconv_desc (cpp_reader *pfile, const char *to, const char *from) +{ + struct cset_converter ret; + char *pair; + size_t i; + + if (!strcasecmp (to, from)) + { + ret.func = convert_no_conversion; + ret.cd = (iconv_t) -1; + return ret; + } + + pair = alloca(strlen(to) + strlen(from) + 2); + + strcpy(pair, from); + strcat(pair, "/"); + strcat(pair, to); + for (i = 0; i < ARRAY_SIZE (conversion_tab); i++) + if (!strcasecmp (pair, conversion_tab[i].pair)) + { + ret.func = conversion_tab[i].func; + ret.cd = conversion_tab[i].fake_cd; + return ret; + } + + /* No custom converter - try iconv. */ + if (HAVE_ICONV) + { + ret.func = convert_using_iconv; + ret.cd = iconv_open (to, from); + + if (ret.cd == (iconv_t) -1) + { + if (errno == EINVAL) + cpp_error (pfile, CPP_DL_ERROR, /* FIXME should be DL_SORRY */ + "conversion from %s to %s not supported by iconv", + from, to); + else + cpp_errno (pfile, CPP_DL_ERROR, "iconv_open"); + + ret.func = convert_no_conversion; + } + } + else + { + cpp_error (pfile, CPP_DL_ERROR, /* FIXME: should be DL_SORRY */ + "no iconv implementation, cannot convert from %s to %s", + from, to); + ret.func = convert_no_conversion; + ret.cd = (iconv_t) -1; + } + return ret; +} + +/* If charset conversion is requested, initialize iconv(3) descriptors + for conversion from the source character set to the execution + character sets. If iconv is not present in the C library, and + conversion is requested, issue an error. */ + +void +cpp_init_iconv (cpp_reader *pfile) +{ + const char *ncset = CPP_OPTION (pfile, narrow_charset); + const char *wcset = CPP_OPTION (pfile, wide_charset); + const char *default_wcset; + + bool be = CPP_OPTION (pfile, bytes_big_endian); + + if (CPP_OPTION (pfile, wchar_precision) >= 32) + default_wcset = be ? "UTF-32BE" : "UTF-32LE"; + else if (CPP_OPTION (pfile, wchar_precision) >= 16) + default_wcset = be ? "UTF-16BE" : "UTF-16LE"; + else + /* This effectively means that wide strings are not supported, + so don't do any conversion at all. */ + default_wcset = SOURCE_CHARSET; + + if (!ncset) + ncset = SOURCE_CHARSET; + if (!wcset) + wcset = default_wcset; + + pfile->narrow_cset_desc = init_iconv_desc (pfile, ncset, SOURCE_CHARSET); + pfile->wide_cset_desc = init_iconv_desc (pfile, wcset, SOURCE_CHARSET); +} + +void +_cpp_destroy_iconv (cpp_reader *pfile) +{ + if (HAVE_ICONV) + { + if (pfile->narrow_cset_desc.func == convert_using_iconv) + iconv_close (pfile->narrow_cset_desc.cd); + if (pfile->wide_cset_desc.func == convert_using_iconv) + iconv_close (pfile->wide_cset_desc.cd); + } +} + + +/* Utility routine that computes a mask of the form 0000...111... with + WIDTH 1-bits. */ +static inline size_t +width_to_mask (size_t width) +{ + width = MIN (width, BITS_PER_CPPCHAR_T); + if (width >= CHAR_BIT * sizeof (size_t)) + return ~(size_t) 0; + else + return ((size_t) 1 << width) - 1; +} + + + +/* Returns 1 if C is valid in an identifier, 2 if C is valid except at + the start of an identifier, and 0 if C is not valid in an + identifier. We assume C has already gone through the checks of + _cpp_valid_ucn. The algorithm is a simple binary search on the + table defined in cppucnid.h. */ + +static int +ucn_valid_in_identifier (cpp_reader *pfile, cppchar_t c) +{ + int mn, mx, md; + + mn = -1; + mx = ARRAY_SIZE (ucnranges); + while (mx - mn > 1) + { + md = (mn + mx) / 2; + if (c < ucnranges[md].lo) + mx = md; + else if (c > ucnranges[md].hi) + mn = md; + else + goto found; + } + return 0; + + found: + /* When -pedantic, we require the character to have been listed by + the standard for the current language. Otherwise, we accept the + union of the acceptable sets for C++98 and C99. */ + if (CPP_PEDANTIC (pfile) + && ((CPP_OPTION (pfile, c99) && !(ucnranges[md].flags & C99)) + || (CPP_OPTION (pfile, cplusplus) + && !(ucnranges[md].flags & CXX)))) + return 0; + + /* In C99, UCN digits may not begin identifiers. */ + if (CPP_OPTION (pfile, c99) && (ucnranges[md].flags & DIG)) + return 2; + + return 1; +} + +/* [lex.charset]: The character designated by the universal character + name \UNNNNNNNN is that character whose character short name in + ISO/IEC 10646 is NNNNNNNN; the character designated by the + universal character name \uNNNN is that character whose character + short name in ISO/IEC 10646 is 0000NNNN. If the hexadecimal value + for a universal character name is less than 0x20 or in the range + 0x7F-0x9F (inclusive), or if the universal character name + designates a character in the basic source character set, then the + program is ill-formed. + + *PSTR must be preceded by "\u" or "\U"; it is assumed that the + buffer end is delimited by a non-hex digit. Returns zero if UCNs + are not part of the relevant standard, or if the string beginning + at *PSTR doesn't syntactically match the form 'NNNN' or 'NNNNNNNN'. + + Otherwise the nonzero value of the UCN, whether valid or invalid, + is returned. Diagnostics are emitted for invalid values. PSTR + is updated to point one beyond the UCN, or to the syntactically + invalid character. + + IDENTIFIER_POS is 0 when not in an identifier, 1 for the start of + an identifier, or 2 otherwise. +*/ + +cppchar_t +_cpp_valid_ucn (cpp_reader *pfile, const uchar **pstr, + const uchar *limit, int identifier_pos) +{ + cppchar_t result, c; + unsigned int length; + const uchar *str = *pstr; + const uchar *base = str - 2; + + if (!CPP_OPTION (pfile, cplusplus) && !CPP_OPTION (pfile, c99)) + cpp_error (pfile, CPP_DL_WARNING, + "universal character names are only valid in C++ and C99"); + else if (CPP_WTRADITIONAL (pfile) && identifier_pos == 0) + cpp_error (pfile, CPP_DL_WARNING, + "the meaning of '\\%c' is different in traditional C", + (int) str[-1]); + + if (str[-1] == 'u') + length = 4; + else if (str[-1] == 'U') + length = 8; + else + abort(); + + result = 0; + do + { + c = *str; + if (!ISXDIGIT (c)) + break; + str++; + result = (result << 4) + hex_value (c); + } + while (--length && str < limit); + + *pstr = str; + if (length) + { + /* We'll error when we try it out as the start of an identifier. */ + cpp_error (pfile, CPP_DL_ERROR, + "incomplete universal character name %.*s", + (int) (str - base), base); + result = 1; + } + /* The standard permits $, @ and ` to be specified as UCNs. We use + hex escapes so that this also works with EBCDIC hosts. */ + else if ((result < 0xa0 + && (result != 0x24 && result != 0x40 && result != 0x60)) + || (result & 0x80000000) + || (result >= 0xD800 && result <= 0xDFFF)) + { + cpp_error (pfile, CPP_DL_ERROR, + "%.*s is not a valid universal character", + (int) (str - base), base); + result = 1; + } + else if (identifier_pos) + { + int validity = ucn_valid_in_identifier (pfile, result); + + if (validity == 0) + cpp_error (pfile, CPP_DL_ERROR, + "universal character %.*s is not valid in an identifier", + (int) (str - base), base); + else if (validity == 2 && identifier_pos == 1) + cpp_error (pfile, CPP_DL_ERROR, + "universal character %.*s is not valid at the start of an identifier", + (int) (str - base), base); + } + + if (result == 0) + result = 1; + + return result; +} + +/* Convert an UCN, pointed to by FROM, to UTF-8 encoding, then translate + it to the execution character set and write the result into TBUF. + An advanced pointer is returned. Issues all relevant diagnostics. */ + + +static const uchar * +convert_ucn (cpp_reader *pfile, const uchar *from, const uchar *limit, + struct _cpp_strbuf *tbuf, bool wide) +{ + cppchar_t ucn; + uchar buf[6]; + uchar *bufp = buf; + size_t bytesleft = 6; + int rval; + struct cset_converter cvt + = wide ? pfile->wide_cset_desc : pfile->narrow_cset_desc; + + from++; /* Skip u/U. */ + ucn = _cpp_valid_ucn (pfile, &from, limit, 0); + + rval = one_cppchar_to_utf8 (ucn, &bufp, &bytesleft); + if (rval) + { + errno = rval; + cpp_errno (pfile, CPP_DL_ERROR, + "converting UCN to source character set"); + } + else if (!APPLY_CONVERSION (cvt, buf, 6 - bytesleft, tbuf)) + cpp_errno (pfile, CPP_DL_ERROR, + "converting UCN to execution character set"); + + return from; +} + +static void +emit_numeric_escape (cpp_reader *pfile, cppchar_t n, + struct _cpp_strbuf *tbuf, bool wide) +{ + if (wide) + { + /* We have to render this into the target byte order, which may not + be our byte order. */ + bool bigend = CPP_OPTION (pfile, bytes_big_endian); + size_t width = CPP_OPTION (pfile, wchar_precision); + size_t cwidth = CPP_OPTION (pfile, char_precision); + size_t cmask = width_to_mask (cwidth); + size_t nbwc = width / cwidth; + size_t i; + size_t off = tbuf->len; + cppchar_t c; + + if (tbuf->len + nbwc > tbuf->asize) + { + tbuf->asize += OUTBUF_BLOCK_SIZE; + tbuf->text = xrealloc (tbuf->text, tbuf->asize); + } + + for (i = 0; i < nbwc; i++) + { + c = n & cmask; + n >>= cwidth; + tbuf->text[off + (bigend ? nbwc - i - 1 : i)] = c; + } + tbuf->len += nbwc; + } + else + { + if (tbuf->len + 1 > tbuf->asize) + { + tbuf->asize += OUTBUF_BLOCK_SIZE; + tbuf->text = xrealloc (tbuf->text, tbuf->asize); + } + tbuf->text[tbuf->len++] = n; + } +} + +/* Convert a hexadecimal escape, pointed to by FROM, to the execution + character set and write it into the string buffer TBUF. Returns an + advanced pointer, and issues diagnostics as necessary. + No character set translation occurs; this routine always produces the + execution-set character with numeric value equal to the given hex + number. You can, e.g. generate surrogate pairs this way. */ +static const uchar * +convert_hex (cpp_reader *pfile, const uchar *from, const uchar *limit, + struct _cpp_strbuf *tbuf, bool wide) +{ + cppchar_t c, n = 0, overflow = 0; + int digits_found = 0; + size_t width = (wide ? CPP_OPTION (pfile, wchar_precision) + : CPP_OPTION (pfile, char_precision)); + size_t mask = width_to_mask (width); + + if (CPP_WTRADITIONAL (pfile)) + cpp_error (pfile, CPP_DL_WARNING, + "the meaning of '\\x' is different in traditional C"); + + from++; /* Skip 'x'. */ + while (from < limit) + { + c = *from; + if (! hex_p (c)) + break; + from++; + overflow |= n ^ (n << 4 >> 4); + n = (n << 4) + hex_value (c); + digits_found = 1; + } + + if (!digits_found) + { + cpp_error (pfile, CPP_DL_ERROR, + "\\x used with no following hex digits"); + return from; + } + + if (overflow | (n != (n & mask))) + { + cpp_error (pfile, CPP_DL_PEDWARN, + "hex escape sequence out of range"); + n &= mask; + } + + emit_numeric_escape (pfile, n, tbuf, wide); + + return from; +} + +/* Convert an octal escape, pointed to by FROM, to the execution + character set and write it into the string buffer TBUF. Returns an + advanced pointer, and issues diagnostics as necessary. + No character set translation occurs; this routine always produces the + execution-set character with numeric value equal to the given octal + number. */ +static const uchar * +convert_oct (cpp_reader *pfile, const uchar *from, const uchar *limit, + struct _cpp_strbuf *tbuf, bool wide) +{ + size_t count = 0; + cppchar_t c, n = 0; + size_t width = (wide ? CPP_OPTION (pfile, wchar_precision) + : CPP_OPTION (pfile, char_precision)); + size_t mask = width_to_mask (width); + bool overflow = false; + + while (from < limit && count++ < 3) + { + c = *from; + if (c < '0' || c > '7') + break; + from++; + overflow |= n ^ (n << 3 >> 3); + n = (n << 3) + c - '0'; + } + + if (n != (n & mask)) + { + cpp_error (pfile, CPP_DL_PEDWARN, + "octal escape sequence out of range"); + n &= mask; + } + + emit_numeric_escape (pfile, n, tbuf, wide); + + return from; +} + +/* Convert an escape sequence (pointed to by FROM) to its value on + the target, and to the execution character set. Do not scan past + LIMIT. Write the converted value into TBUF. Returns an advanced + pointer. Handles all relevant diagnostics. */ +static const uchar * +convert_escape (cpp_reader *pfile, const uchar *from, const uchar *limit, + struct _cpp_strbuf *tbuf, bool wide) +{ + /* Values of \a \b \e \f \n \r \t \v respectively. */ +#if HOST_CHARSET == HOST_CHARSET_ASCII + static const uchar charconsts[] = { 7, 8, 27, 12, 10, 13, 9, 11 }; +#elif HOST_CHARSET == HOST_CHARSET_EBCDIC + static const uchar charconsts[] = { 47, 22, 39, 12, 21, 13, 5, 11 }; +#else +#error "unknown host character set" +#endif + + uchar c; + struct cset_converter cvt + = wide ? pfile->wide_cset_desc : pfile->narrow_cset_desc; + + c = *from; + switch (c) + { + /* UCNs, hex escapes, and octal escapes are processed separately. */ + case 'u': case 'U': + return convert_ucn (pfile, from, limit, tbuf, wide); + + case 'x': + return convert_hex (pfile, from, limit, tbuf, wide); + break; + + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + return convert_oct (pfile, from, limit, tbuf, wide); + + /* Various letter escapes. Get the appropriate host-charset + value into C. */ + case '\\': case '\'': case '"': case '?': break; + + case '(': case '{': case '[': case '%': + /* '\(', etc, can be used at the beginning of a line in a long + string split onto multiple lines with \-newline, to prevent + Emacs or other text editors from getting confused. '\%' can + be used to prevent SCCS from mangling printf format strings. */ + if (CPP_PEDANTIC (pfile)) + goto unknown; + break; + + case 'b': c = charconsts[1]; break; + case 'f': c = charconsts[3]; break; + case 'n': c = charconsts[4]; break; + case 'r': c = charconsts[5]; break; + case 't': c = charconsts[6]; break; + case 'v': c = charconsts[7]; break; + + case 'a': + if (CPP_WTRADITIONAL (pfile)) + cpp_error (pfile, CPP_DL_WARNING, + "the meaning of '\\a' is different in traditional C"); + c = charconsts[0]; + break; + + case 'e': case 'E': + if (CPP_PEDANTIC (pfile)) + cpp_error (pfile, CPP_DL_PEDWARN, + "non-ISO-standard escape sequence, '\\%c'", (int) c); + c = charconsts[2]; + break; + + default: + unknown: + if (ISGRAPH (c)) + cpp_error (pfile, CPP_DL_PEDWARN, + "unknown escape sequence '\\%c'", (int) c); + else + cpp_error (pfile, CPP_DL_PEDWARN, + "unknown escape sequence: '\\%03o'", (int) c); + } + + /* Now convert what we have to the execution character set. */ + if (!APPLY_CONVERSION (cvt, &c, 1, tbuf)) + cpp_errno (pfile, CPP_DL_ERROR, + "converting escape sequence to execution character set"); + + return from + 1; +} + +/* FROM is an array of cpp_string structures of length COUNT. These + are to be converted from the source to the execution character set, + escape sequences translated, and finally all are to be + concatenated. WIDE indicates whether or not to produce a wide + string. The result is written into TO. Returns true for success, + false for failure. */ +bool +cpp_interpret_string (cpp_reader *pfile, const cpp_string *from, size_t count, + cpp_string *to, bool wide) +{ + struct _cpp_strbuf tbuf; + const uchar *p, *base, *limit; + size_t i; + struct cset_converter cvt + = wide ? pfile->wide_cset_desc : pfile->narrow_cset_desc; + + tbuf.asize = MAX (OUTBUF_BLOCK_SIZE, from->len); + tbuf.text = xmalloc (tbuf.asize); + tbuf.len = 0; + + for (i = 0; i < count; i++) + { + p = from[i].text; + if (*p == 'L') p++; + p++; /* Skip leading quote. */ + limit = from[i].text + from[i].len - 1; /* Skip trailing quote. */ + + for (;;) + { + base = p; + while (p < limit && *p != '\\') + p++; + if (p > base) + { + /* We have a run of normal characters; these can be fed + directly to convert_cset. */ + if (!APPLY_CONVERSION (cvt, base, p - base, &tbuf)) + goto fail; + } + if (p == limit) + break; + + p = convert_escape (pfile, p + 1, limit, &tbuf, wide); + } + } + /* NUL-terminate the 'to' buffer and translate it to a cpp_string + structure. */ + emit_numeric_escape (pfile, 0, &tbuf, wide); + tbuf.text = xrealloc (tbuf.text, tbuf.len); + to->text = tbuf.text; + to->len = tbuf.len; + return true; + + fail: + cpp_errno (pfile, CPP_DL_ERROR, "converting to execution character set"); + free (tbuf.text); + return false; +} + +/* Subroutine of do_line and do_linemarker. Convert escape sequences + in a string, but do not perform character set conversion. */ +bool +cpp_interpret_string_notranslate (cpp_reader *pfile, const cpp_string *from, + size_t count, cpp_string *to, bool wide) +{ + struct cset_converter save_narrow_cset_desc = pfile->narrow_cset_desc; + bool retval; + + pfile->narrow_cset_desc.func = convert_no_conversion; + pfile->narrow_cset_desc.cd = (iconv_t) -1; + + retval = cpp_interpret_string (pfile, from, count, to, wide); + + pfile->narrow_cset_desc = save_narrow_cset_desc; + return retval; +} + + +/* Subroutine of cpp_interpret_charconst which performs the conversion + to a number, for narrow strings. STR is the string structure returned + by cpp_interpret_string. PCHARS_SEEN and UNSIGNEDP are as for + cpp_interpret_charconst. */ +static cppchar_t +narrow_str_to_charconst (cpp_reader *pfile, cpp_string str, + unsigned int *pchars_seen, int *unsignedp) +{ + size_t width = CPP_OPTION (pfile, char_precision); + size_t max_chars = CPP_OPTION (pfile, int_precision) / width; + size_t mask = width_to_mask (width); + size_t i; + cppchar_t result, c; + bool unsigned_p; + + /* The value of a multi-character character constant, or a + single-character character constant whose representation in the + execution character set is more than one byte long, is + implementation defined. This implementation defines it to be the + number formed by interpreting the byte sequence in memory as a + big-endian binary number. If overflow occurs, the high bytes are + lost, and a warning is issued. + + We don't want to process the NUL terminator handed back by + cpp_interpret_string. */ + result = 0; + for (i = 0; i < str.len - 1; i++) + { + c = str.text[i] & mask; + if (width < BITS_PER_CPPCHAR_T) + result = (result << width) | c; + else + result = c; + } + + if (i > max_chars) + { + i = max_chars; + cpp_error (pfile, CPP_DL_WARNING, + "character constant too long for its type"); + } + else if (i > 1 && CPP_OPTION (pfile, warn_multichar)) + cpp_error (pfile, CPP_DL_WARNING, "multi-character character constant"); + + /* Multichar constants are of type int and therefore signed. */ + if (i > 1) + unsigned_p = 0; + else + unsigned_p = CPP_OPTION (pfile, unsigned_char); + + /* Truncate the constant to its natural width, and simultaneously + sign- or zero-extend to the full width of cppchar_t. + For single-character constants, the value is WIDTH bits wide. + For multi-character constants, the value is INT_PRECISION bits wide. */ + if (i > 1) + width = CPP_OPTION (pfile, int_precision); + if (width < BITS_PER_CPPCHAR_T) + { + mask = ((cppchar_t) 1 << width) - 1; + if (unsigned_p || !(result & (1 << (width - 1)))) + result &= mask; + else + result |= ~mask; + } + *pchars_seen = i; + *unsignedp = unsigned_p; + return result; +} + +/* Subroutine of cpp_interpret_charconst which performs the conversion + to a number, for wide strings. STR is the string structure returned + by cpp_interpret_string. PCHARS_SEEN and UNSIGNEDP are as for + cpp_interpret_charconst. */ +static cppchar_t +wide_str_to_charconst (cpp_reader *pfile, cpp_string str, + unsigned int *pchars_seen, int *unsignedp) +{ + bool bigend = CPP_OPTION (pfile, bytes_big_endian); + size_t width = CPP_OPTION (pfile, wchar_precision); + size_t cwidth = CPP_OPTION (pfile, char_precision); + size_t mask = width_to_mask (width); + size_t cmask = width_to_mask (cwidth); + size_t nbwc = width / cwidth; + size_t off, i; + cppchar_t result = 0, c; + + /* This is finicky because the string is in the target's byte order, + which may not be our byte order. Only the last character, ignoring + the NUL terminator, is relevant. */ + off = str.len - (nbwc * 2); + result = 0; + for (i = 0; i < nbwc; i++) + { + c = bigend ? str.text[off + i] : str.text[off + nbwc - i - 1]; + result = (result << cwidth) | (c & cmask); + } + + /* Wide character constants have type wchar_t, and a single + character exactly fills a wchar_t, so a multi-character wide + character constant is guaranteed to overflow. */ + if (off > 0) + cpp_error (pfile, CPP_DL_WARNING, + "character constant too long for its type"); + + /* Truncate the constant to its natural width, and simultaneously + sign- or zero-extend to the full width of cppchar_t. */ + if (width < BITS_PER_CPPCHAR_T) + { + if (CPP_OPTION (pfile, unsigned_wchar) || !(result & (1 << (width - 1)))) + result &= mask; + else + result |= ~mask; + } + + *unsignedp = CPP_OPTION (pfile, unsigned_wchar); + *pchars_seen = 1; + return result; +} + +/* Interpret a (possibly wide) character constant in TOKEN. + PCHARS_SEEN points to a variable that is filled in with the number + of characters seen, and UNSIGNEDP to a variable that indicates + whether the result has signed type. */ +cppchar_t +cpp_interpret_charconst (cpp_reader *pfile, const cpp_token *token, + unsigned int *pchars_seen, int *unsignedp) +{ + cpp_string str = { 0, 0 }; + bool wide = (token->type == CPP_WCHAR); + cppchar_t result; + + /* an empty constant will appear as L'' or '' */ + if (token->val.str.len == (size_t) (2 + wide)) + { + cpp_error (pfile, CPP_DL_ERROR, "empty character constant"); + return 0; + } + else if (!cpp_interpret_string (pfile, &token->val.str, 1, &str, wide)) + return 0; + + if (wide) + result = wide_str_to_charconst (pfile, str, pchars_seen, unsignedp); + else + result = narrow_str_to_charconst (pfile, str, pchars_seen, unsignedp); + + if (str.text != token->val.str.text) + free ((void *)str.text); + + return result; +} + +uchar * +_cpp_convert_input (cpp_reader *pfile, const char *input_charset, + uchar *input, size_t size, size_t len, off_t *st_size) +{ + struct cset_converter input_cset; + struct _cpp_strbuf to; + + input_cset = init_iconv_desc (pfile, SOURCE_CHARSET, input_charset); + if (input_cset.func == convert_no_conversion) + { + to.text = input; + to.asize = size; + to.len = len; + } + else + { + to.asize = MAX (65536, len); + to.text = xmalloc (to.asize); + to.len = 0; + + if (!APPLY_CONVERSION (input_cset, input, len, &to)) + cpp_error (pfile, CPP_DL_ERROR, + "failure to convert %s to %s", + CPP_OPTION (pfile, input_charset), SOURCE_CHARSET); + + free (input); + } + + /* Clean up the mess. */ + if (input_cset.func == convert_using_iconv) + iconv_close (input_cset.cd); + + /* Resize buffer if we allocated substantially too much, or if we + haven't enough space for the \n-terminator. */ + if (to.len + 4096 < to.asize || to.len >= to.asize) + to.text = xrealloc (to.text, to.len + 1); + + to.text[to.len] = '\n'; + *st_size = to.len; + return to.text; +} + +const char * +_cpp_default_encoding (void) +{ + const char *current_encoding = NULL; + + /* We disable this because the default codeset is 7-bit ASCII on + most platforms, and this causes conversion failures on every + file in GCC that happens to have one of the upper 128 characters + in it -- most likely, as part of the name of a contributor. + We should definitely recognize in-band markers of file encoding, + like: + - the appropriate Unicode byte-order mark (FE FF) to recognize + UTF16 and UCS4 (in both big-endian and little-endian flavors) + and UTF8 + - a "#i", "#d", "/*", "//", " #p" or "#p" (for #pragma) to + distinguish ASCII and EBCDIC. + - now we can parse something like "#pragma GCC encoding <xyz> + on the first line, or even Emacs/VIM's mode line tags (there's + a problem here in that VIM uses the last line, and Emacs has + its more elaborate "Local variables:" convention). + - investigate whether Java has another common convention, which + would be friendly to support. + (Zack Weinberg and Paolo Bonzini, May 20th 2004) */ +#if defined (HAVE_LOCALE_H) && defined (HAVE_LANGINFO_CODESET) && 0 + setlocale (LC_CTYPE, ""); + current_encoding = nl_langinfo (CODESET); +#endif + if (current_encoding == NULL || *current_encoding == '\0') + current_encoding = SOURCE_CHARSET; + + return current_encoding; +} diff --git a/libcpp/config.in b/libcpp/config.in new file mode 100644 index 00000000000..4b7bce74d59 --- /dev/null +++ b/libcpp/config.in @@ -0,0 +1,198 @@ +/* config.in. Generated from configure.ac by autoheader. */ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +#undef CRAY_STACKSEG_END + +/* Define to 1 if using `alloca.c'. */ +#undef C_ALLOCA + +/* Define if you want more run-time sanity checks. */ +#undef ENABLE_CHECKING + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#undef ENABLE_NLS + +/* Define to 1 if you have `alloca', as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). + */ +#undef HAVE_ALLOCA_H + +/* Define to 1 if you have the declaration of `abort', and to 0 if you don't. + */ +#undef HAVE_DECL_ABORT + +/* Define to 1 if you have the declaration of `errno', and to 0 if you don't. + */ +#undef HAVE_DECL_ERRNO + +/* Define to 1 if you have the declaration of `fprintf_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FPRINTF_UNLOCKED + +/* Define to 1 if you have the declaration of `fputc_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FPUTC_UNLOCKED + +/* Define to 1 if you have the declaration of `fputs_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FPUTS_UNLOCKED + +/* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FWRITE_UNLOCKED + +/* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you + don't. */ +#undef HAVE_DECL_PUTC_UNLOCKED + +/* Define to 1 if you have the <fcntl.h> header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the `fprintf_unlocked' function. */ +#undef HAVE_FPRINTF_UNLOCKED + +/* Define to 1 if you have the `fputc_unlocked' function. */ +#undef HAVE_FPUTC_UNLOCKED + +/* Define to 1 if you have the `fputs_unlocked' function. */ +#undef HAVE_FPUTS_UNLOCKED + +/* Define to 1 if you have the `fwrite_unlocked' function. */ +#undef HAVE_FWRITE_UNLOCKED + +/* Define if you have the iconv() function. */ +#undef HAVE_ICONV + +/* Define to 1 if you have the <iconv.h> header file. */ +#undef HAVE_ICONV_H + +/* Define to 1 if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H + +/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */ +#undef HAVE_LANGINFO_CODESET + +/* Define to 1 if you have the <limits.h> header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the <locale.h> header file. */ +#undef HAVE_LOCALE_H + +/* Define to 1 if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if libc includes obstacks. */ +#undef HAVE_OBSTACK + +/* Define to 1 if you have the `putc_unlocked' function. */ +#undef HAVE_PUTC_UNLOCKED + +/* Define if you have a working <stdbool.h> header file. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the <stddef.h> header file. */ +#undef HAVE_STDDEF_H + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the <sys/file.h> header file. */ +#undef HAVE_SYS_FILE_H + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define if <sys/types.h> defines \`uchar'. */ +#undef HAVE_UCHAR + +/* Define to 1 if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Define if the \`_Bool' type is built-in. */ +#undef HAVE__BOOL + +/* Define to the widest efficient host integer type at least as wide as the + target's size_t type. */ +#undef HOST_WIDE_INT + +/* Define as const if the declaration of iconv() needs const. */ +#undef ICONV_CONST + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* The size of a `int', as computed by sizeof. */ +#undef SIZEOF_INT + +/* The size of a `long', as computed by sizeof. */ +#undef SIZEOF_LONG + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define if you can safely include both <string.h> and <strings.h>. */ +#undef STRING_WITH_STRINGS + +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ +#undef TIME_WITH_SYS_TIME + +/* Define to 1 if your <sys/time.h> declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* Version number of package */ +#undef VERSION + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to `long' if <sys/types.h> does not define. */ +#undef off_t + +/* Define to `unsigned' if <sys/types.h> does not define. */ +#undef size_t diff --git a/libcpp/configure b/libcpp/configure new file mode 100755 index 00000000000..713d13935dd --- /dev/null +++ b/libcpp/configure @@ -0,0 +1,8776 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59 for cpplib . +# +# Report bugs to <gcc-bugs@gcc.gnu.org>. +# +# Copyright (C) 2003 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='cpplib' +PACKAGE_TARNAME='cpplib' +PACKAGE_VERSION=' ' +PACKAGE_STRING='cpplib ' +PACKAGE_BUGREPORT='gcc-bugs@gcc.gnu.org' + +ac_unique_file="ucnid.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include <stdio.h> +#if HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#if HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif +#if STDC_HEADERS +# include <stdlib.h> +# include <stddef.h> +#else +# if HAVE_STDLIB_H +# include <stdlib.h> +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include <memory.h> +# endif +# include <string.h> +#endif +#if HAVE_STRINGS_H +# include <strings.h> +#endif +#if HAVE_INTTYPES_H +# include <inttypes.h> +#else +# if HAVE_STDINT_H +# include <stdint.h> +# endif +#endif +#if HAVE_UNISTD_H +# include <unistd.h> +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB CPP EGREP LIBOBJS ALLOCA USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS LIBICONV LTLIBICONV ENABLE_NLS_TRUE ENABLE_NLS_FALSE LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures cpplib to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of cpplib :";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --disable-rpath do not hardcode runtime library paths + --enable-checking enable expensive run-time checks + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld default=no + --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib + --without-libiconv-prefix don't search for libiconv in includedir and libdir + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a + nonstandard directory <lib dir> + CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have + headers in a nonstandard directory <include dir> + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to <gcc-bugs@gcc.gnu.org>. +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd "$ac_popdir" + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +cpplib configure +generated by GNU Autoconf 2.59 + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by cpplib $as_me , which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6 +if test "${ac_cv_target+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6 +target=$ac_cv_target +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- +am__api_version="1.8" +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # Keeping the `.' argument allows $(mkdir_p) to be used without + # argument. Indeed, we sometimes output rules like + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. + # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more + # expensive solution, as it forces Make to start a sub-shell.) + mkdir_p='mkdir -p -- .' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='cpplib' + VERSION=' ' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. + + + +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + +# Checks for programs. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 + (eval $ac_compiler --version </dev/null >&5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 + (eval $ac_compiler -v </dev/null >&5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 + (eval $ac_compiler -V </dev/null >&5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include <stdlib.h> +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + +# Checks for header files. + +echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/types.h> +#include <sys/time.h> +#include <time.h> + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_time=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_time=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6 +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether string.h and strings.h may both be included" >&5 +echo $ECHO_N "checking whether string.h and strings.h may both be included... $ECHO_C" >&6 +if test "${gcc_cv_header_string+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <string.h> +#include <strings.h> +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gcc_cv_header_string=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gcc_cv_header_string=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $gcc_cv_header_string" >&5 +echo "${ECHO_T}$gcc_cv_header_string" >&6 +if test $gcc_cv_header_string = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STRING_WITH_STRINGS 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for working stdbool.h" >&5 +echo $ECHO_N "checking for working stdbool.h... $ECHO_C" >&6 +if test "${ac_cv_header_stdbool_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdbool.h> +int +main () +{ +bool foo = false; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdbool_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdbool_h=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6 +if test $ac_cv_header_stdbool_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STDBOOL_H 1 +_ACEOF + +fi +echo "$as_me:$LINENO: checking for built-in _Bool" >&5 +echo $ECHO_N "checking for built-in _Bool... $ECHO_C" >&6 +if test "${gcc_cv_c__bool+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +_Bool foo; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gcc_cv_c__bool=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gcc_cv_c__bool=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $gcc_cv_c__bool" >&5 +echo "${ECHO_T}$gcc_cv_c__bool" >&6 +if test $gcc_cv_c__bool = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE__BOOL 1 +_ACEOF + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <string.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdlib.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <ctype.h> +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + + + + + +for ac_header in iconv.h locale.h fcntl.h limits.h stddef.h \ + stdlib.h strings.h string.h sys/file.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ----------------------------------- ## +## Report this to gcc-bugs@gcc.gnu.org ## +## ----------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# Checks for typedefs, structures, and compiler characteristics. +echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_const=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6 +if test "${ac_cv_c_inline+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_inline=$ac_kw; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6 + + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +echo "$as_me:$LINENO: checking for obstacks" >&5 +echo $ECHO_N "checking for obstacks... $ECHO_C" >&6 +if test "${ac_cv_func_obstack+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include "obstack.h" +int +main () +{ +struct obstack *mem; obstack_free(mem,(char *) 0) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_obstack=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_obstack=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_obstack" >&5 +echo "${ECHO_T}$ac_cv_func_obstack" >&6 +if test $ac_cv_func_obstack = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_OBSTACK 1 +_ACEOF + +else + case $LIBOBJS in + "obstack.$ac_objext" | \ + *" obstack.$ac_objext" | \ + "obstack.$ac_objext "* | \ + *" obstack.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS obstack.$ac_objext" ;; +esac + +fi + +echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6 +if test "${ac_cv_type_off_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((off_t *) 0) + return 0; +if (sizeof (off_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_off_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_off_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6 +if test $ac_cv_type_off_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define off_t long +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_size_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned +_ACEOF + +fi + +echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 +if test "${ac_cv_struct_tm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/types.h> +#include <time.h> + +int +main () +{ +struct tm *tp; tp->tm_sec; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_struct_tm=time.h +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_struct_tm=sys/time.h +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$ac_cv_struct_tm" >&6 +if test $ac_cv_struct_tm = sys/time.h; then + +cat >>confdefs.h <<\_ACEOF +#define TM_IN_SYS_TIME 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for int" >&5 +echo $ECHO_N "checking for int... $ECHO_C" >&6 +if test "${ac_cv_type_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((int *) 0) + return 0; +if (sizeof (int)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 +echo "${ECHO_T}$ac_cv_type_int" >&6 + +echo "$as_me:$LINENO: checking size of int" >&5 +echo $ECHO_N "checking size of int... $ECHO_C" >&6 +if test "${ac_cv_sizeof_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_int" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_int=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +long longval () { return (long) (sizeof (int)); } +unsigned long ulongval () { return (long) (sizeof (int)); } +#include <stdio.h> +#include <stdlib.h> +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (int))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (int)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (int)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_int=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_int=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + +echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6 +if test "${ac_cv_type_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((long *) 0) + return 0; +if (sizeof (long)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_long=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6 + +echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6 +if test "${ac_cv_sizeof_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_long" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_long=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +long longval () { return (long) (sizeof (long)); } +unsigned long ulongval () { return (long) (sizeof (long)); } +#include <stdio.h> +#include <stdlib.h> +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (long))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (long)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (long)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_long=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_long=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + + + + + + +for ac_func in putc_unlocked fputc_unlocked fputs_unlocked \ + fwrite_unlocked fprintf_unlocked +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +echo "$as_me:$LINENO: checking whether abort is declared" >&5 +echo $ECHO_N "checking whether abort is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_abort+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef abort + char *p = (char *) abort; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_abort=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_abort=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_abort" >&5 +echo "${ECHO_T}$ac_cv_have_decl_abort" >&6 +if test $ac_cv_have_decl_abort = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ABORT 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ABORT 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether errno is declared" >&5 +echo $ECHO_N "checking whether errno is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_errno+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef errno + char *p = (char *) errno; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_errno=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_errno=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_errno" >&5 +echo "${ECHO_T}$ac_cv_have_decl_errno" >&6 +if test $ac_cv_have_decl_errno = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ERRNO 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ERRNO 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether putc_unlocked is declared" >&5 +echo $ECHO_N "checking whether putc_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_putc_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef putc_unlocked + char *p = (char *) putc_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_putc_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_putc_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_putc_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_putc_unlocked" >&6 +if test $ac_cv_have_decl_putc_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTC_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTC_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether fputc_unlocked is declared" >&5 +echo $ECHO_N "checking whether fputc_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fputc_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef fputc_unlocked + char *p = (char *) fputc_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fputc_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fputc_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputc_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fputc_unlocked" >&6 +if test $ac_cv_have_decl_fputc_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPUTC_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPUTC_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether fputs_unlocked is declared" >&5 +echo $ECHO_N "checking whether fputs_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fputs_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef fputs_unlocked + char *p = (char *) fputs_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fputs_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fputs_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputs_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fputs_unlocked" >&6 +if test $ac_cv_have_decl_fputs_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPUTS_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPUTS_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether fwrite_unlocked is declared" >&5 +echo $ECHO_N "checking whether fwrite_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fwrite_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef fwrite_unlocked + char *p = (char *) fwrite_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fwrite_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fwrite_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fwrite_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fwrite_unlocked" >&6 +if test $ac_cv_have_decl_fwrite_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FWRITE_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FWRITE_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether fprintf_unlocked is declared" >&5 +echo $ECHO_N "checking whether fprintf_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fprintf_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef fprintf_unlocked + char *p = (char *) fprintf_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fprintf_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fprintf_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fprintf_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fprintf_unlocked" >&6 +if test $ac_cv_have_decl_fprintf_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPRINTF_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPRINTF_UNLOCKED 0 +_ACEOF + + +fi + + + +# Checks for library functions. +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +echo "$as_me:$LINENO: checking for working alloca.h" >&5 +echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 +if test "${ac_cv_working_alloca_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <alloca.h> +int +main () +{ +char *p = (char *) alloca (2 * sizeof (int)); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_working_alloca_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_working_alloca_h=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 +if test $ac_cv_working_alloca_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ALLOCA_H 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for alloca" >&5 +echo $ECHO_N "checking for alloca... $ECHO_C" >&6 +if test "${ac_cv_func_alloca_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include <malloc.h> +# define alloca _alloca +# else +# if HAVE_ALLOCA_H +# include <alloca.h> +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +# endif +#endif + +int +main () +{ +char *p = (char *) alloca (1); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_alloca_works=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_alloca_works=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 + +if test $ac_cv_func_alloca_works = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ALLOCA 1 +_ACEOF + +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + +ALLOCA=alloca.$ac_objext + +cat >>confdefs.h <<\_ACEOF +#define C_ALLOCA 1 +_ACEOF + + +echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 +echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 +if test "${ac_cv_os_cray+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if defined(CRAY) && ! defined(CRAY2) +webecray +#else +wenotbecray +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "webecray" >/dev/null 2>&1; then + ac_cv_os_cray=yes +else + ac_cv_os_cray=no +fi +rm -f conftest* + +fi +echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +echo "${ECHO_T}$ac_cv_os_cray" >&6 +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + +cat >>confdefs.h <<_ACEOF +#define CRAY_STACKSEG_END $ac_func +_ACEOF + + break +fi + + done +fi + +echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 +if test "${ac_cv_c_stack_direction+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_c_stack_direction=0 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int +find_stack_direction () +{ + static char *addr = 0; + auto char dummy; + if (addr == 0) + { + addr = &dummy; + return find_stack_direction (); + } + else + return (&dummy > addr) ? 1 : -1; +} + +int +main () +{ + exit (find_stack_direction () < 0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_stack_direction=1 +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_stack_direction=-1 +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 + +cat >>confdefs.h <<_ACEOF +#define STACK_DIRECTION $ac_cv_c_stack_direction +_ACEOF + + +fi + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <string.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdlib.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <ctype.h> +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + + + echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 +echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6 +if test "${am_cv_langinfo_codeset+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <langinfo.h> +int +main () +{ +char* cs = nl_langinfo(CODESET); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_langinfo_codeset=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +am_cv_langinfo_codeset=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 +echo "${ECHO_T}$am_cv_langinfo_codeset" >&6 + if test $am_cv_langinfo_codeset = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LANGINFO_CODESET 1 +_ACEOF + + fi + +# If we haven't got the data from the intl directory, +# assume NLS is disabled. +USE_NLS=no +LIBINTL= +LIBINTL_DEP= +INCINTL= +XGETTEXT= +GMSGFMT= +POSUB= +if test -f ../intl/config.intl; then + . ../intl/config.intl +fi +echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 +if test x"$USE_NLS" != xyes; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_NLS 1 +_ACEOF + + + echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 +echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 + # Look for .po and .gmo files in the source directory. + CATALOGS= + XLINGUAS= + for cat in $srcdir/po/*.gmo $srcdir/po/*.po; do + # If there aren't any .gmo files the shell will give us the + # literal string "../path/to/srcdir/po/*.gmo" which has to be + # weeded out. + case "$cat" in *\**) + continue;; + esac + # The quadruple backslash is collapsed to a double backslash + # by the backticks, then collapsed again by the double quotes, + # leaving us with one backslash in the sed expression (right + # before the dot that mustn't act as a wildcard). + cat=`echo $cat | sed -e "s!$srcdir/!!" -e "s!\\\\.po!.gmo!"` + lang=`echo $cat | sed -e 's!po/!!' -e "s!\\\\.gmo!!"` + # The user is allowed to set LINGUAS to a list of languages to + # install catalogs for. If it's empty that means "all of them." + if test "x$LINGUAS" = x; then + CATALOGS="$CATALOGS $cat" + XLINGUAS="$XLINGUAS $lang" + else + case "$LINGUAS" in *$lang*) + CATALOGS="$CATALOGS $cat" + XLINGUAS="$XLINGUAS $lang" + ;; + esac + fi + done + LINGUAS="$XLINGUAS" + echo "$as_me:$LINENO: result: $LINGUAS" >&5 +echo "${ECHO_T}$LINGUAS" >&6 +fi + +echo "$as_me:$LINENO: checking for uchar" >&5 +echo $ECHO_N "checking for uchar... $ECHO_C" >&6 +if test "${gcc_cv_type_uchar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include "ansidecl.h" +#include "system.h" + +int +main () +{ +if ((uchar *)0) return 0; + if (sizeof(uchar)) return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uchar=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uchar=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $gcc_cv_type_uchar" >&5 +echo "${ECHO_T}$gcc_cv_type_uchar" >&6 +if test $ac_cv_type_uchar = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_UCHAR 1 +_ACEOF + +fi + + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi; +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo "$as_me:$LINENO: checking for ld used by GCC" >&5 +echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 +else + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 +fi +if test "${acl_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break ;; + *) + test "$with_gnu_ld" != yes && break ;; + esac + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$acl_cv_path_LD" +if test -n "$LD"; then + echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${acl_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 </dev/null` in +*GNU* | *'with BFD'*) + acl_cv_prog_gnu_ld=yes ;; +*) + acl_cv_prog_gnu_ld=no ;; +esac +fi +echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6 +with_gnu_ld=$acl_cv_prog_gnu_ld + + + + echo "$as_me:$LINENO: checking for shared library run path origin" >&5 +echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6 +if test "${acl_cv_rpath+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + +fi +echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 +echo "${ECHO_T}$acl_cv_rpath" >&6 + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath or --disable-rpath was given. +if test "${enable_rpath+set}" = set; then + enableval="$enable_rpath" + : +else + enable_rpath=yes +fi; + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. +if test "${with_libiconv_prefix+set}" = set; then + withval="$with_libiconv_prefix" + + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + +fi; + LIBICONV= + LTLIBICONV= + INCICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi + + + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + echo "$as_me:$LINENO: checking for iconv" >&5 +echo $ECHO_N "checking for iconv... $ECHO_C" >&6 +if test "${am_cv_func_iconv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdlib.h> +#include <iconv.h> +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_func_iconv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdlib.h> +#include <iconv.h> +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + +fi +echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 +echo "${ECHO_T}$am_cv_func_iconv" >&6 + if test "$am_cv_func_iconv" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ICONV 1 +_ACEOF + + fi + if test "$am_cv_lib_iconv" = yes; then + echo "$as_me:$LINENO: checking how to link with libiconv" >&5 +echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: $LIBICONV" >&5 +echo "${ECHO_T}$LIBICONV" >&6 + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + if test "$am_cv_func_iconv" = yes; then + echo "$as_me:$LINENO: checking for iconv declaration" >&5 +echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6 + if test "${am_cv_proto_iconv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include <stdlib.h> +#include <iconv.h> +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + am_cv_proto_iconv_arg1="" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +am_cv_proto_iconv_arg1="const" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" +fi + + am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + echo "$as_me:$LINENO: result: ${ac_t:- + }$am_cv_proto_iconv" >&5 +echo "${ECHO_T}${ac_t:- + }$am_cv_proto_iconv" >&6 + +cat >>confdefs.h <<_ACEOF +#define ICONV_CONST $am_cv_proto_iconv_arg1 +_ACEOF + + fi + + + +if test "x$enable_nls" != xno; then + ENABLE_NLS_TRUE= + ENABLE_NLS_FALSE='#' +else + ENABLE_NLS_TRUE='#' + ENABLE_NLS_FALSE= +fi + +# Check whether --enable-checking or --disable-checking was given. +if test "${enable_checking+set}" = set; then + enableval="$enable_checking" + +else + enable_checking=no +fi; + +if test $enable_checking != no ; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_CHECKING 1 +_ACEOF + +fi + +case $target in + alpha*-*-* | \ + x86_64-*-* | \ + ia64-*-* | \ + hppa*64*-*-* | parisc*64*-*-* | \ + mips*-*-* | \ + mmix-*-* | \ + powerpc*-*-* | \ + rs6000*-*-* | \ + s390*-*-* | \ + sparc64*-*-* | ultrasparc-*-freebsd* | \ + sparcv9-*-solaris2* | \ + sparc-*-solaris2.789 | sparc-*-solaris2.10-9 | \ + sh123456789l*-*-*) + need_64bit_hwint=yes ;; + *) + need_64bit_hwint=no ;; +esac + +case $need_64bit_hwint:$ac_cv_sizeof_long in + *:8 | no:*) host_wide_int=long ;; + *) host_wide_int='long long' ;; +esac + + +cat >>confdefs.h <<_ACEOF +#define HOST_WIDE_INT $host_wide_int +_ACEOF + + + ac_config_headers="$ac_config_headers config.h:config.in" + + ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${ENABLE_NLS_TRUE}" && test -z "${ENABLE_NLS_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"ENABLE_NLS\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"ENABLE_NLS\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by cpplib $as_me , which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to <bug-autoconf@gnu.org>." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +cpplib config.status +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@target@,$target,;t t +s,@target_cpu@,$target_cpu,;t t +s,@target_vendor@,$target_vendor,;t t +s,@target_os@,$target_os,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@AMTAR@,$AMTAR,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@mkdir_p@,$mkdir_p,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@ALLOCA@,$ALLOCA,;t t +s,@USE_NLS@,$USE_NLS,;t t +s,@LIBINTL@,$LIBINTL,;t t +s,@LIBINTL_DEP@,$LIBINTL_DEP,;t t +s,@INCINTL@,$INCINTL,;t t +s,@XGETTEXT@,$XGETTEXT,;t t +s,@GMSGFMT@,$GMSGFMT,;t t +s,@POSUB@,$POSUB,;t t +s,@CATALOGS@,$CATALOGS,;t t +s,@LIBICONV@,$LIBICONV,;t t +s,@LTLIBICONV@,$LTLIBICONV,;t t +s,@ENABLE_NLS_TRUE@,$ENABLE_NLS_TRUE,;t t +s,@ENABLE_NLS_FALSE@,$ENABLE_NLS_FALSE,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'`/stamp-h$_am_stamp_count +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/libcpp/configure.ac b/libcpp/configure.ac new file mode 100644 index 00000000000..79c0e417337 --- /dev/null +++ b/libcpp/configure.ac @@ -0,0 +1,96 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.57) +AC_INIT(cpplib, [ ], gcc-bugs@gcc.gnu.org, cpplib) +AC_CONFIG_SRCDIR(ucnid.h) +AC_CANONICAL_SYSTEM +AM_INIT_AUTOMAKE(foreign) +AM_MAINTAINER_MODE + +# Checks for programs. +AC_PROG_CC +AC_PROG_RANLIB + +# Checks for header files. +AC_HEADER_TIME +ACX_HEADER_STRING +ACX_HEADER_STDBOOL +AC_CHECK_HEADERS(iconv.h locale.h fcntl.h limits.h stddef.h \ + stdlib.h strings.h string.h sys/file.h unistd.h) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_C_INLINE +AC_FUNC_OBSTACK +AC_TYPE_OFF_T +AC_TYPE_SIZE_T +AC_STRUCT_TM +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(long) +AC_CHECK_FUNCS(putc_unlocked fputc_unlocked fputs_unlocked \ + fwrite_unlocked fprintf_unlocked) +AC_CHECK_DECLS([abort, errno, putc_unlocked, fputc_unlocked, + fputs_unlocked, fwrite_unlocked, fprintf_unlocked]) + +# Checks for library functions. +AC_FUNC_ALLOCA +AC_HEADER_STDC +AM_LANGINFO_CODESET +ZW_GNU_GETTEXT_SISTER_DIR + +AC_CACHE_CHECK(for uchar, gcc_cv_type_uchar, +[AC_TRY_COMPILE([ +#include "ansidecl.h" +#include "system.h" +], +[if ((uchar *)0) return 0; + if (sizeof(uchar)) return 0;], +ac_cv_type_uchar=yes, ac_cv_type_uchar=no)]) +if test $ac_cv_type_uchar = yes; then + AC_DEFINE(HAVE_UCHAR, 1, + [Define if <sys/types.h> defines \`uchar'.]) +fi + +AM_ICONV +AM_CONDITIONAL(ENABLE_NLS, [test "x$enable_nls" != xno]) +AC_ARG_ENABLE(checking, +[ --enable-checking enable expensive run-time checks],, +enable_checking=no) + +if test $enable_checking != no ; then + AC_DEFINE(ENABLE_CHECKING, 1, +[Define if you want more run-time sanity checks.]) +fi + +case $target in + alpha*-*-* | \ + x86_64-*-* | \ + ia64-*-* | \ + hppa*64*-*-* | parisc*64*-*-* | \ + mips*-*-* | \ + mmix-*-* | \ + powerpc*-*-* | \ + rs6000*-*-* | \ + s390*-*-* | \ + sparc64*-*-* | ultrasparc-*-freebsd* | \ + sparcv9-*-solaris2* | \ + sparc-*-solaris2.[789] | sparc-*-solaris2.1[0-9] | \ + sh[123456789l]*-*-*) + need_64bit_hwint=yes ;; + *) + need_64bit_hwint=no ;; +esac + +case $need_64bit_hwint:$ac_cv_sizeof_long in + *:8 | no:*) host_wide_int=long ;; + *) host_wide_int='long long' ;; +esac + +AC_DEFINE_UNQUOTED(HOST_WIDE_INT, $host_wide_int, +[Define to the widest efficient host integer type at least + as wide as the target's size_t type.]) + +AC_CONFIG_HEADERS(config.h:config.in) +AC_CONFIG_FILES(Makefile) +AC_OUTPUT diff --git a/libcpp/directives.c b/libcpp/directives.c new file mode 100644 index 00000000000..f9ff2ce3344 --- /dev/null +++ b/libcpp/directives.c @@ -0,0 +1,1987 @@ +/* CPP Library. (Directive handling.) + Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Contributed by Per Bothner, 1994-95. + Based on CCCP program by Paul Rubin, June 1986 + Adapted to ANSI C, Richard Stallman, Jan 1987 + +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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "config.h" +#include "system.h" +#include "cpplib.h" +#include "internal.h" +#include "obstack.h" + +/* Chained list of answers to an assertion. */ +struct answer +{ + struct answer *next; + unsigned int count; + cpp_token first[1]; +}; + +/* Stack of conditionals currently in progress + (including both successful and failing conditionals). */ +struct if_stack +{ + struct if_stack *next; + unsigned int line; /* Line where condition started. */ + const cpp_hashnode *mi_cmacro;/* macro name for #ifndef around entire file */ + bool skip_elses; /* Can future #else / #elif be skipped? */ + bool was_skipping; /* If were skipping on entry. */ + int type; /* Most recent conditional for diagnostics. */ +}; + +/* Contains a registered pragma or pragma namespace. */ +typedef void (*pragma_cb) (cpp_reader *); +struct pragma_entry +{ + struct pragma_entry *next; + const cpp_hashnode *pragma; /* Name and length. */ + int is_nspace; + union { + pragma_cb handler; + struct pragma_entry *space; + } u; +}; + +/* Values for the origin field of struct directive. KANDR directives + come from traditional (K&R) C. STDC89 directives come from the + 1989 C standard. EXTENSION directives are extensions. */ +#define KANDR 0 +#define STDC89 1 +#define EXTENSION 2 + +/* Values for the flags field of struct directive. COND indicates a + conditional; IF_COND an opening conditional. INCL means to treat + "..." and <...> as q-char and h-char sequences respectively. IN_I + means this directive should be handled even if -fpreprocessed is in + effect (these are the directives with callback hooks). + + EXPAND is set on directives that are always macro-expanded. */ +#define COND (1 << 0) +#define IF_COND (1 << 1) +#define INCL (1 << 2) +#define IN_I (1 << 3) +#define EXPAND (1 << 4) + +/* Defines one #-directive, including how to handle it. */ +typedef void (*directive_handler) (cpp_reader *); +typedef struct directive directive; +struct directive +{ + directive_handler handler; /* Function to handle directive. */ + const uchar *name; /* Name of directive. */ + unsigned short length; /* Length of name. */ + unsigned char origin; /* Origin of directive. */ + unsigned char flags; /* Flags describing this directive. */ +}; + +/* Forward declarations. */ + +static void skip_rest_of_line (cpp_reader *); +static void check_eol (cpp_reader *); +static void start_directive (cpp_reader *); +static void prepare_directive_trad (cpp_reader *); +static void end_directive (cpp_reader *, int); +static void directive_diagnostics (cpp_reader *, const directive *, int); +static void run_directive (cpp_reader *, int, const char *, size_t); +static char *glue_header_name (cpp_reader *); +static const char *parse_include (cpp_reader *, int *); +static void push_conditional (cpp_reader *, int, int, const cpp_hashnode *); +static unsigned int read_flag (cpp_reader *, unsigned int); +static int strtoul_for_line (const uchar *, unsigned int, unsigned long *); +static void do_diagnostic (cpp_reader *, int, int); +static cpp_hashnode *lex_macro_node (cpp_reader *); +static int undefine_macros (cpp_reader *, cpp_hashnode *, void *); +static void do_include_common (cpp_reader *, enum include_type); +static struct pragma_entry *lookup_pragma_entry (struct pragma_entry *, + const cpp_hashnode *); +static struct pragma_entry *insert_pragma_entry (cpp_reader *, + struct pragma_entry **, + const cpp_hashnode *, + pragma_cb); +static int count_registered_pragmas (struct pragma_entry *); +static char ** save_registered_pragmas (struct pragma_entry *, char **); +static char ** restore_registered_pragmas (cpp_reader *, struct pragma_entry *, + char **); +static void do_pragma_once (cpp_reader *); +static void do_pragma_poison (cpp_reader *); +static void do_pragma_system_header (cpp_reader *); +static void do_pragma_dependency (cpp_reader *); +static void do_linemarker (cpp_reader *); +static const cpp_token *get_token_no_padding (cpp_reader *); +static const cpp_token *get__Pragma_string (cpp_reader *); +static void destringize_and_run (cpp_reader *, const cpp_string *); +static int parse_answer (cpp_reader *, struct answer **, int); +static cpp_hashnode *parse_assertion (cpp_reader *, struct answer **, int); +static struct answer ** find_answer (cpp_hashnode *, const struct answer *); +static void handle_assertion (cpp_reader *, const char *, int); + +/* This is the table of directive handlers. It is ordered by + frequency of occurrence; the numbers at the end are directive + counts from all the source code I have lying around (egcs and libc + CVS as of 1999-05-18, plus grub-0.5.91, linux-2.2.9, and + pcmcia-cs-3.0.9). This is no longer important as directive lookup + is now O(1). All extensions other than #warning and #include_next + are deprecated. The name is where the extension appears to have + come from. */ + +#define DIRECTIVE_TABLE \ +D(define, T_DEFINE = 0, KANDR, IN_I) /* 270554 */ \ +D(include, T_INCLUDE, KANDR, INCL | EXPAND) /* 52262 */ \ +D(endif, T_ENDIF, KANDR, COND) /* 45855 */ \ +D(ifdef, T_IFDEF, KANDR, COND | IF_COND) /* 22000 */ \ +D(if, T_IF, KANDR, COND | IF_COND | EXPAND) /* 18162 */ \ +D(else, T_ELSE, KANDR, COND) /* 9863 */ \ +D(ifndef, T_IFNDEF, KANDR, COND | IF_COND) /* 9675 */ \ +D(undef, T_UNDEF, KANDR, IN_I) /* 4837 */ \ +D(line, T_LINE, KANDR, EXPAND) /* 2465 */ \ +D(elif, T_ELIF, STDC89, COND | EXPAND) /* 610 */ \ +D(error, T_ERROR, STDC89, 0) /* 475 */ \ +D(pragma, T_PRAGMA, STDC89, IN_I) /* 195 */ \ +D(warning, T_WARNING, EXTENSION, 0) /* 22 */ \ +D(include_next, T_INCLUDE_NEXT, EXTENSION, INCL | EXPAND) /* 19 */ \ +D(ident, T_IDENT, EXTENSION, IN_I) /* 11 */ \ +D(import, T_IMPORT, EXTENSION, INCL | EXPAND) /* 0 ObjC */ \ +D(assert, T_ASSERT, EXTENSION, 0) /* 0 SVR4 */ \ +D(unassert, T_UNASSERT, EXTENSION, 0) /* 0 SVR4 */ \ +D(sccs, T_SCCS, EXTENSION, 0) /* 0 SVR4? */ + +/* Use the table to generate a series of prototypes, an enum for the + directive names, and an array of directive handlers. */ + +#define D(name, t, o, f) static void do_##name (cpp_reader *); +DIRECTIVE_TABLE +#undef D + +#define D(n, tag, o, f) tag, +enum +{ + DIRECTIVE_TABLE + N_DIRECTIVES +}; +#undef D + +#define D(name, t, origin, flags) \ +{ do_##name, (const uchar *) #name, \ + sizeof #name - 1, origin, flags }, +static const directive dtable[] = +{ +DIRECTIVE_TABLE +}; +#undef D +#undef DIRECTIVE_TABLE + +/* Wrapper struct directive for linemarkers. + The origin is more or less true - the original K+R cpp + did use this notation in its preprocessed output. */ +static const directive linemarker_dir = +{ + do_linemarker, U"#", 1, KANDR, IN_I +}; + +#define SEEN_EOL() (pfile->cur_token[-1].type == CPP_EOF) + +/* Skip any remaining tokens in a directive. */ +static void +skip_rest_of_line (cpp_reader *pfile) +{ + /* Discard all stacked contexts. */ + while (pfile->context->prev) + _cpp_pop_context (pfile); + + /* Sweep up all tokens remaining on the line. */ + if (! SEEN_EOL ()) + while (_cpp_lex_token (pfile)->type != CPP_EOF) + ; +} + +/* Ensure there are no stray tokens at the end of a directive. */ +static void +check_eol (cpp_reader *pfile) +{ + if (! SEEN_EOL () && _cpp_lex_token (pfile)->type != CPP_EOF) + cpp_error (pfile, CPP_DL_PEDWARN, "extra tokens at end of #%s directive", + pfile->directive->name); +} + +/* Called when entering a directive, _Pragma or command-line directive. */ +static void +start_directive (cpp_reader *pfile) +{ + /* Setup in-directive state. */ + pfile->state.in_directive = 1; + pfile->state.save_comments = 0; + + /* Some handlers need the position of the # for diagnostics. */ + pfile->directive_line = pfile->line_table->highest_line; +} + +/* Called when leaving a directive, _Pragma or command-line directive. */ +static void +end_directive (cpp_reader *pfile, int skip_line) +{ + if (CPP_OPTION (pfile, traditional)) + { + /* Revert change of prepare_directive_trad. */ + pfile->state.prevent_expansion--; + + if (pfile->directive != &dtable[T_DEFINE]) + _cpp_remove_overlay (pfile); + } + /* We don't skip for an assembler #. */ + else if (skip_line) + { + skip_rest_of_line (pfile); + if (!pfile->keep_tokens) + { + pfile->cur_run = &pfile->base_run; + pfile->cur_token = pfile->base_run.base; + } + } + + /* Restore state. */ + pfile->state.save_comments = ! CPP_OPTION (pfile, discard_comments); + pfile->state.in_directive = 0; + pfile->state.in_expression = 0; + pfile->state.angled_headers = 0; + pfile->directive = 0; +} + +/* Prepare to handle the directive in pfile->directive. */ +static void +prepare_directive_trad (cpp_reader *pfile) +{ + if (pfile->directive != &dtable[T_DEFINE]) + { + bool no_expand = (pfile->directive + && ! (pfile->directive->flags & EXPAND)); + bool was_skipping = pfile->state.skipping; + + pfile->state.in_expression = (pfile->directive == &dtable[T_IF] + || pfile->directive == &dtable[T_ELIF]); + if (pfile->state.in_expression) + pfile->state.skipping = false; + + if (no_expand) + pfile->state.prevent_expansion++; + _cpp_scan_out_logical_line (pfile, NULL); + if (no_expand) + pfile->state.prevent_expansion--; + + pfile->state.skipping = was_skipping; + _cpp_overlay_buffer (pfile, pfile->out.base, + pfile->out.cur - pfile->out.base); + } + + /* Stop ISO C from expanding anything. */ + pfile->state.prevent_expansion++; +} + +/* Output diagnostics for a directive DIR. INDENTED is nonzero if + the '#' was indented. */ +static void +directive_diagnostics (cpp_reader *pfile, const directive *dir, int indented) +{ + /* Issue -pedantic warnings for extensions. */ + if (CPP_PEDANTIC (pfile) + && ! pfile->state.skipping + && dir->origin == EXTENSION) + cpp_error (pfile, CPP_DL_PEDWARN, "#%s is a GCC extension", dir->name); + + /* Traditionally, a directive is ignored unless its # is in + column 1. Therefore in code intended to work with K+R + compilers, directives added by C89 must have their # + indented, and directives present in traditional C must not. + This is true even of directives in skipped conditional + blocks. #elif cannot be used at all. */ + if (CPP_WTRADITIONAL (pfile)) + { + if (dir == &dtable[T_ELIF]) + cpp_error (pfile, CPP_DL_WARNING, + "suggest not using #elif in traditional C"); + else if (indented && dir->origin == KANDR) + cpp_error (pfile, CPP_DL_WARNING, + "traditional C ignores #%s with the # indented", + dir->name); + else if (!indented && dir->origin != KANDR) + cpp_error (pfile, CPP_DL_WARNING, + "suggest hiding #%s from traditional C with an indented #", + dir->name); + } +} + +/* Check if we have a known directive. INDENTED is nonzero if the + '#' of the directive was indented. This function is in this file + to save unnecessarily exporting dtable etc. to cpplex.c. Returns + nonzero if the line of tokens has been handled, zero if we should + continue processing the line. */ +int +_cpp_handle_directive (cpp_reader *pfile, int indented) +{ + const directive *dir = 0; + const cpp_token *dname; + bool was_parsing_args = pfile->state.parsing_args; + int skip = 1; + + if (was_parsing_args) + { + if (CPP_OPTION (pfile, pedantic)) + cpp_error (pfile, CPP_DL_PEDWARN, + "embedding a directive within macro arguments is not portable"); + pfile->state.parsing_args = 0; + pfile->state.prevent_expansion = 0; + } + start_directive (pfile); + dname = _cpp_lex_token (pfile); + + if (dname->type == CPP_NAME) + { + if (dname->val.node->is_directive) + dir = &dtable[dname->val.node->directive_index]; + } + /* We do not recognize the # followed by a number extension in + assembler code. */ + else if (dname->type == CPP_NUMBER && CPP_OPTION (pfile, lang) != CLK_ASM) + { + dir = &linemarker_dir; + if (CPP_PEDANTIC (pfile) && ! CPP_OPTION (pfile, preprocessed) + && ! pfile->state.skipping) + cpp_error (pfile, CPP_DL_PEDWARN, + "style of line directive is a GCC extension"); + } + + if (dir) + { + /* If we have a directive that is not an opening conditional, + invalidate any control macro. */ + if (! (dir->flags & IF_COND)) + pfile->mi_valid = false; + + /* Kluge alert. In order to be sure that code like this + + #define HASH # + HASH define foo bar + + does not cause '#define foo bar' to get executed when + compiled with -save-temps, we recognize directives in + -fpreprocessed mode only if the # is in column 1. cppmacro.c + puts a space in front of any '#' at the start of a macro. */ + if (CPP_OPTION (pfile, preprocessed) + && (indented || !(dir->flags & IN_I))) + { + skip = 0; + dir = 0; + } + else + { + /* In failed conditional groups, all non-conditional + directives are ignored. Before doing that, whether + skipping or not, we should lex angle-bracketed headers + correctly, and maybe output some diagnostics. */ + pfile->state.angled_headers = dir->flags & INCL; + pfile->state.directive_wants_padding = dir->flags & INCL; + if (! CPP_OPTION (pfile, preprocessed)) + directive_diagnostics (pfile, dir, indented); + if (pfile->state.skipping && !(dir->flags & COND)) + dir = 0; + } + } + else if (dname->type == CPP_EOF) + ; /* CPP_EOF is the "null directive". */ + else + { + /* An unknown directive. Don't complain about it in assembly + source: we don't know where the comments are, and # may + introduce assembler pseudo-ops. Don't complain about invalid + directives in skipped conditional groups (6.10 p4). */ + if (CPP_OPTION (pfile, lang) == CLK_ASM) + skip = 0; + else if (!pfile->state.skipping) + cpp_error (pfile, CPP_DL_ERROR, "invalid preprocessing directive #%s", + cpp_token_as_text (pfile, dname)); + } + + pfile->directive = dir; + if (CPP_OPTION (pfile, traditional)) + prepare_directive_trad (pfile); + + if (dir) + pfile->directive->handler (pfile); + else if (skip == 0) + _cpp_backup_tokens (pfile, 1); + + end_directive (pfile, skip); + if (was_parsing_args) + { + /* Restore state when within macro args. */ + pfile->state.parsing_args = 2; + pfile->state.prevent_expansion = 1; + } + return skip; +} + +/* Directive handler wrapper used by the command line option + processor. BUF is \n terminated. */ +static void +run_directive (cpp_reader *pfile, int dir_no, const char *buf, size_t count) +{ + cpp_push_buffer (pfile, (const uchar *) buf, count, + /* from_stage3 */ true); + /* Disgusting hack. */ + if (dir_no == T_PRAGMA) + pfile->buffer->file = pfile->buffer->prev->file; + start_directive (pfile); + + /* This is a short-term fix to prevent a leading '#' being + interpreted as a directive. */ + _cpp_clean_line (pfile); + + pfile->directive = &dtable[dir_no]; + if (CPP_OPTION (pfile, traditional)) + prepare_directive_trad (pfile); + pfile->directive->handler (pfile); + end_directive (pfile, 1); + if (dir_no == T_PRAGMA) + pfile->buffer->file = NULL; + _cpp_pop_buffer (pfile); +} + +/* Checks for validity the macro name in #define, #undef, #ifdef and + #ifndef directives. */ +static cpp_hashnode * +lex_macro_node (cpp_reader *pfile) +{ + const cpp_token *token = _cpp_lex_token (pfile); + + /* The token immediately after #define must be an identifier. That + identifier may not be "defined", per C99 6.10.8p4. + In C++, it may not be any of the "named operators" either, + per C++98 [lex.digraph], [lex.key]. + Finally, the identifier may not have been poisoned. (In that case + the lexer has issued the error message for us.) */ + + if (token->type == CPP_NAME) + { + cpp_hashnode *node = token->val.node; + + if (node == pfile->spec_nodes.n_defined) + cpp_error (pfile, CPP_DL_ERROR, + "\"defined\" cannot be used as a macro name"); + else if (! (node->flags & NODE_POISONED)) + return node; + } + else if (token->flags & NAMED_OP) + cpp_error (pfile, CPP_DL_ERROR, + "\"%s\" cannot be used as a macro name as it is an operator in C++", + NODE_NAME (token->val.node)); + else if (token->type == CPP_EOF) + cpp_error (pfile, CPP_DL_ERROR, "no macro name given in #%s directive", + pfile->directive->name); + else + cpp_error (pfile, CPP_DL_ERROR, "macro names must be identifiers"); + + return NULL; +} + +/* Process a #define directive. Most work is done in cppmacro.c. */ +static void +do_define (cpp_reader *pfile) +{ + cpp_hashnode *node = lex_macro_node (pfile); + + if (node) + { + /* If we have been requested to expand comments into macros, + then re-enable saving of comments. */ + pfile->state.save_comments = + ! CPP_OPTION (pfile, discard_comments_in_macro_exp); + + if (_cpp_create_definition (pfile, node)) + if (pfile->cb.define) + pfile->cb.define (pfile, pfile->directive_line, node); + } +} + +/* Handle #undef. Mark the identifier NT_VOID in the hash table. */ +static void +do_undef (cpp_reader *pfile) +{ + cpp_hashnode *node = lex_macro_node (pfile); + + if (node) + { + if (pfile->cb.undef) + pfile->cb.undef (pfile, pfile->directive_line, node); + + /* 6.10.3.5 paragraph 2: [#undef] is ignored if the specified + identifier is not currently defined as a macro name. */ + if (node->type == NT_MACRO) + { + if (node->flags & NODE_WARN) + cpp_error (pfile, CPP_DL_WARNING, + "undefining \"%s\"", NODE_NAME (node)); + + if (CPP_OPTION (pfile, warn_unused_macros)) + _cpp_warn_if_unused_macro (pfile, node, NULL); + + _cpp_free_definition (node); + } + } + + check_eol (pfile); +} + +/* Undefine a single macro/assertion/whatever. */ + +static int +undefine_macros (cpp_reader *pfile, cpp_hashnode *h, + void *data_p ATTRIBUTE_UNUSED) +{ + switch (h->type) + { + case NT_VOID: + break; + + case NT_MACRO: + if (pfile->cb.undef) + (*pfile->cb.undef) (pfile, pfile->directive_line, h); + + if (CPP_OPTION (pfile, warn_unused_macros)) + _cpp_warn_if_unused_macro (pfile, h, NULL); + + /* And fall through.... */ + case NT_ASSERTION: + _cpp_free_definition (h); + break; + + default: + abort (); + } + h->flags &= ~NODE_POISONED; + return 1; +} + +/* Undefine all macros and assertions. */ + +void +cpp_undef_all (cpp_reader *pfile) +{ + cpp_forall_identifiers (pfile, undefine_macros, NULL); +} + + +/* Helper routine used by parse_include. Reinterpret the current line + as an h-char-sequence (< ... >); we are looking at the first token + after the <. Returns a malloced filename. */ +static char * +glue_header_name (cpp_reader *pfile) +{ + const cpp_token *token; + char *buffer; + size_t len, total_len = 0, capacity = 1024; + + /* To avoid lexed tokens overwriting our glued name, we can only + allocate from the string pool once we've lexed everything. */ + buffer = xmalloc (capacity); + for (;;) + { + token = get_token_no_padding (pfile); + + if (token->type == CPP_GREATER) + break; + if (token->type == CPP_EOF) + { + cpp_error (pfile, CPP_DL_ERROR, "missing terminating > character"); + break; + } + + len = cpp_token_len (token) + 2; /* Leading space, terminating \0. */ + if (total_len + len > capacity) + { + capacity = (capacity + len) * 2; + buffer = xrealloc (buffer, capacity); + } + + if (token->flags & PREV_WHITE) + buffer[total_len++] = ' '; + + total_len = (cpp_spell_token (pfile, token, (uchar *) &buffer[total_len]) + - (uchar *) buffer); + } + + buffer[total_len] = '\0'; + return buffer; +} + +/* Returns the file name of #include, #include_next, #import and + #pragma dependency. The string is malloced and the caller should + free it. Returns NULL on error. */ +static const char * +parse_include (cpp_reader *pfile, int *pangle_brackets) +{ + char *fname; + const cpp_token *header; + + /* Allow macro expansion. */ + header = get_token_no_padding (pfile); + if (header->type == CPP_STRING || header->type == CPP_HEADER_NAME) + { + fname = xmalloc (header->val.str.len - 1); + memcpy (fname, header->val.str.text + 1, header->val.str.len - 2); + fname[header->val.str.len - 2] = '\0'; + *pangle_brackets = header->type == CPP_HEADER_NAME; + } + else if (header->type == CPP_LESS) + { + fname = glue_header_name (pfile); + *pangle_brackets = 1; + } + else + { + const unsigned char *dir; + + if (pfile->directive == &dtable[T_PRAGMA]) + dir = U"pragma dependency"; + else + dir = pfile->directive->name; + cpp_error (pfile, CPP_DL_ERROR, "#%s expects \"FILENAME\" or <FILENAME>", + dir); + + return NULL; + } + + check_eol (pfile); + return fname; +} + +/* Handle #include, #include_next and #import. */ +static void +do_include_common (cpp_reader *pfile, enum include_type type) +{ + const char *fname; + int angle_brackets; + + fname = parse_include (pfile, &angle_brackets); + if (!fname) + return; + + /* Prevent #include recursion. */ + if (pfile->line_table->depth >= CPP_STACK_MAX) + cpp_error (pfile, CPP_DL_ERROR, "#include nested too deeply"); + else + { + /* Get out of macro context, if we are. */ + skip_rest_of_line (pfile); + + if (pfile->cb.include) + pfile->cb.include (pfile, pfile->directive_line, + pfile->directive->name, fname, angle_brackets); + + _cpp_stack_include (pfile, fname, angle_brackets, type); + } + + free ((void *) fname); +} + +static void +do_include (cpp_reader *pfile) +{ + do_include_common (pfile, IT_INCLUDE); +} + +static void +do_import (cpp_reader *pfile) +{ + do_include_common (pfile, IT_IMPORT); +} + +static void +do_include_next (cpp_reader *pfile) +{ + enum include_type type = IT_INCLUDE_NEXT; + + /* If this is the primary source file, warn and use the normal + search logic. */ + if (! pfile->buffer->prev) + { + cpp_error (pfile, CPP_DL_WARNING, + "#include_next in primary source file"); + type = IT_INCLUDE; + } + do_include_common (pfile, type); +} + +/* Subroutine of do_linemarker. Read possible flags after file name. + LAST is the last flag seen; 0 if this is the first flag. Return the + flag if it is valid, 0 at the end of the directive. Otherwise + complain. */ +static unsigned int +read_flag (cpp_reader *pfile, unsigned int last) +{ + const cpp_token *token = _cpp_lex_token (pfile); + + if (token->type == CPP_NUMBER && token->val.str.len == 1) + { + unsigned int flag = token->val.str.text[0] - '0'; + + if (flag > last && flag <= 4 + && (flag != 4 || last == 3) + && (flag != 2 || last == 0)) + return flag; + } + + if (token->type != CPP_EOF) + cpp_error (pfile, CPP_DL_ERROR, "invalid flag \"%s\" in line directive", + cpp_token_as_text (pfile, token)); + return 0; +} + +/* Subroutine of do_line and do_linemarker. Convert a number in STR, + of length LEN, to binary; store it in NUMP, and return 0 if the + number was well-formed, 1 if not. Temporary, hopefully. */ +static int +strtoul_for_line (const uchar *str, unsigned int len, long unsigned int *nump) +{ + unsigned long reg = 0; + uchar c; + while (len--) + { + c = *str++; + if (!ISDIGIT (c)) + return 1; + reg *= 10; + reg += c - '0'; + } + *nump = reg; + return 0; +} + +/* Interpret #line command. + Note that the filename string (if any) is a true string constant + (escapes are interpreted), unlike in #line. */ +static void +do_line (cpp_reader *pfile) +{ + const struct line_maps *line_table = pfile->line_table; + const struct line_map *map = &line_table->maps[line_table->used - 1]; + const cpp_token *token; + const char *new_file = map->to_file; + unsigned long new_lineno; + + /* C99 raised the minimum limit on #line numbers. */ + unsigned int cap = CPP_OPTION (pfile, c99) ? 2147483647 : 32767; + + /* #line commands expand macros. */ + token = cpp_get_token (pfile); + if (token->type != CPP_NUMBER + || strtoul_for_line (token->val.str.text, token->val.str.len, + &new_lineno)) + { + cpp_error (pfile, CPP_DL_ERROR, + "\"%s\" after #line is not a positive integer", + cpp_token_as_text (pfile, token)); + return; + } + + if (CPP_PEDANTIC (pfile) && (new_lineno == 0 || new_lineno > cap)) + cpp_error (pfile, CPP_DL_PEDWARN, "line number out of range"); + + token = cpp_get_token (pfile); + if (token->type == CPP_STRING) + { + cpp_string s = { 0, 0 }; + if (cpp_interpret_string_notranslate (pfile, &token->val.str, 1, + &s, false)) + new_file = (const char *)s.text; + check_eol (pfile); + } + else if (token->type != CPP_EOF) + { + cpp_error (pfile, CPP_DL_ERROR, "\"%s\" is not a valid filename", + cpp_token_as_text (pfile, token)); + return; + } + + skip_rest_of_line (pfile); + _cpp_do_file_change (pfile, LC_RENAME, new_file, new_lineno, + map->sysp); +} + +/* Interpret the # 44 "file" [flags] notation, which has slightly + different syntax and semantics from #line: Flags are allowed, + and we never complain about the line number being too big. */ +static void +do_linemarker (cpp_reader *pfile) +{ + const struct line_maps *line_table = pfile->line_table; + const struct line_map *map = &line_table->maps[line_table->used - 1]; + const cpp_token *token; + const char *new_file = map->to_file; + unsigned long new_lineno; + unsigned int new_sysp = map->sysp; + enum lc_reason reason = LC_RENAME; + int flag; + + /* Back up so we can get the number again. Putting this in + _cpp_handle_directive risks two calls to _cpp_backup_tokens in + some circumstances, which can segfault. */ + _cpp_backup_tokens (pfile, 1); + + /* #line commands expand macros. */ + token = cpp_get_token (pfile); + if (token->type != CPP_NUMBER + || strtoul_for_line (token->val.str.text, token->val.str.len, + &new_lineno)) + { + cpp_error (pfile, CPP_DL_ERROR, + "\"%s\" after # is not a positive integer", + cpp_token_as_text (pfile, token)); + return; + } + + token = cpp_get_token (pfile); + if (token->type == CPP_STRING) + { + cpp_string s = { 0, 0 }; + if (cpp_interpret_string_notranslate (pfile, &token->val.str, + 1, &s, false)) + new_file = (const char *)s.text; + + new_sysp = 0; + flag = read_flag (pfile, 0); + if (flag == 1) + { + reason = LC_ENTER; + /* Fake an include for cpp_included (). */ + _cpp_fake_include (pfile, new_file); + flag = read_flag (pfile, flag); + } + else if (flag == 2) + { + reason = LC_LEAVE; + flag = read_flag (pfile, flag); + } + if (flag == 3) + { + new_sysp = 1; + flag = read_flag (pfile, flag); + if (flag == 4) + new_sysp = 2; + pfile->buffer->sysp = new_sysp; + } + + check_eol (pfile); + } + else if (token->type != CPP_EOF) + { + cpp_error (pfile, CPP_DL_ERROR, "\"%s\" is not a valid filename", + cpp_token_as_text (pfile, token)); + return; + } + + skip_rest_of_line (pfile); + _cpp_do_file_change (pfile, reason, new_file, new_lineno, new_sysp); +} + +/* Arrange the file_change callback. pfile->line has changed to + FILE_LINE of TO_FILE, for reason REASON. SYSP is 1 for a system + header, 2 for a system header that needs to be extern "C" protected, + and zero otherwise. */ +void +_cpp_do_file_change (cpp_reader *pfile, enum lc_reason reason, + const char *to_file, unsigned int file_line, + unsigned int sysp) +{ + const struct line_map *map = linemap_add (pfile->line_table, reason, sysp, + to_file, file_line); + if (map != NULL) + linemap_line_start (pfile->line_table, map->to_line, 127); + + if (pfile->cb.file_change) + pfile->cb.file_change (pfile, map); +} + +/* Report a warning or error detected by the program we are + processing. Use the directive's tokens in the error message. */ +static void +do_diagnostic (cpp_reader *pfile, int code, int print_dir) +{ + if (_cpp_begin_message (pfile, code, pfile->cur_token[-1].src_loc, 0)) + { + if (print_dir) + fprintf (stderr, "#%s ", pfile->directive->name); + pfile->state.prevent_expansion++; + cpp_output_line (pfile, stderr); + pfile->state.prevent_expansion--; + } +} + +static void +do_error (cpp_reader *pfile) +{ + do_diagnostic (pfile, CPP_DL_ERROR, 1); +} + +static void +do_warning (cpp_reader *pfile) +{ + /* We want #warning diagnostics to be emitted in system headers too. */ + do_diagnostic (pfile, CPP_DL_WARNING_SYSHDR, 1); +} + +/* Report program identification. */ +static void +do_ident (cpp_reader *pfile) +{ + const cpp_token *str = cpp_get_token (pfile); + + if (str->type != CPP_STRING) + cpp_error (pfile, CPP_DL_ERROR, "invalid #ident directive"); + else if (pfile->cb.ident) + pfile->cb.ident (pfile, pfile->directive_line, &str->val.str); + + check_eol (pfile); +} + +/* Lookup a PRAGMA name in a singly-linked CHAIN. Returns the + matching entry, or NULL if none is found. The returned entry could + be the start of a namespace chain, or a pragma. */ +static struct pragma_entry * +lookup_pragma_entry (struct pragma_entry *chain, const cpp_hashnode *pragma) +{ + while (chain && chain->pragma != pragma) + chain = chain->next; + + return chain; +} + +/* Create and insert a pragma entry for NAME at the beginning of a + singly-linked CHAIN. If handler is NULL, it is a namespace, + otherwise it is a pragma and its handler. */ +static struct pragma_entry * +insert_pragma_entry (cpp_reader *pfile, struct pragma_entry **chain, + const cpp_hashnode *pragma, pragma_cb handler) +{ + struct pragma_entry *new; + + new = (struct pragma_entry *) + _cpp_aligned_alloc (pfile, sizeof (struct pragma_entry)); + new->pragma = pragma; + if (handler) + { + new->is_nspace = 0; + new->u.handler = handler; + } + else + { + new->is_nspace = 1; + new->u.space = NULL; + } + + new->next = *chain; + *chain = new; + return new; +} + +/* Register a pragma NAME in namespace SPACE. If SPACE is null, it + goes in the global namespace. HANDLER is the handler it will call, + which must be non-NULL. */ +void +cpp_register_pragma (cpp_reader *pfile, const char *space, const char *name, + pragma_cb handler) +{ + struct pragma_entry **chain = &pfile->pragmas; + struct pragma_entry *entry; + const cpp_hashnode *node; + + if (!handler) + abort (); + + if (space) + { + node = cpp_lookup (pfile, U space, strlen (space)); + entry = lookup_pragma_entry (*chain, node); + if (!entry) + entry = insert_pragma_entry (pfile, chain, node, NULL); + else if (!entry->is_nspace) + goto clash; + chain = &entry->u.space; + } + + /* Check for duplicates. */ + node = cpp_lookup (pfile, U name, strlen (name)); + entry = lookup_pragma_entry (*chain, node); + if (entry) + { + if (entry->is_nspace) + clash: + cpp_error (pfile, CPP_DL_ICE, + "registering \"%s\" as both a pragma and a pragma namespace", + NODE_NAME (node)); + else if (space) + cpp_error (pfile, CPP_DL_ICE, "#pragma %s %s is already registered", + space, name); + else + cpp_error (pfile, CPP_DL_ICE, "#pragma %s is already registered", name); + } + else + insert_pragma_entry (pfile, chain, node, handler); +} + +/* Register the pragmas the preprocessor itself handles. */ +void +_cpp_init_internal_pragmas (cpp_reader *pfile) +{ + /* Pragmas in the global namespace. */ + cpp_register_pragma (pfile, 0, "once", do_pragma_once); + + /* New GCC-specific pragmas should be put in the GCC namespace. */ + cpp_register_pragma (pfile, "GCC", "poison", do_pragma_poison); + cpp_register_pragma (pfile, "GCC", "system_header", do_pragma_system_header); + cpp_register_pragma (pfile, "GCC", "dependency", do_pragma_dependency); +} + +/* Return the number of registered pragmas in PE. */ + +static int +count_registered_pragmas (struct pragma_entry *pe) +{ + int ct = 0; + for (; pe != NULL; pe = pe->next) + { + if (pe->is_nspace) + ct += count_registered_pragmas (pe->u.space); + ct++; + } + return ct; +} + +/* Save into SD the names of the registered pragmas referenced by PE, + and return a pointer to the next free space in SD. */ + +static char ** +save_registered_pragmas (struct pragma_entry *pe, char **sd) +{ + for (; pe != NULL; pe = pe->next) + { + if (pe->is_nspace) + sd = save_registered_pragmas (pe->u.space, sd); + *sd++ = xmemdup (HT_STR (&pe->pragma->ident), + HT_LEN (&pe->pragma->ident), + HT_LEN (&pe->pragma->ident) + 1); + } + return sd; +} + +/* Return a newly-allocated array which saves the names of the + registered pragmas. */ + +char ** +_cpp_save_pragma_names (cpp_reader *pfile) +{ + int ct = count_registered_pragmas (pfile->pragmas); + char **result = xnewvec (char *, ct); + (void) save_registered_pragmas (pfile->pragmas, result); + return result; +} + +/* Restore from SD the names of the registered pragmas referenced by PE, + and return a pointer to the next unused name in SD. */ + +static char ** +restore_registered_pragmas (cpp_reader *pfile, struct pragma_entry *pe, + char **sd) +{ + for (; pe != NULL; pe = pe->next) + { + if (pe->is_nspace) + sd = restore_registered_pragmas (pfile, pe->u.space, sd); + pe->pragma = cpp_lookup (pfile, U *sd, strlen (*sd)); + free (*sd); + sd++; + } + return sd; +} + +/* Restore the names of the registered pragmas from SAVED. */ + +void +_cpp_restore_pragma_names (cpp_reader *pfile, char **saved) +{ + (void) restore_registered_pragmas (pfile, pfile->pragmas, saved); + free (saved); +} + +/* Pragmata handling. We handle some, and pass the rest on to the + front end. C99 defines three pragmas and says that no macro + expansion is to be performed on them; whether or not macro + expansion happens for other pragmas is implementation defined. + This implementation never macro-expands the text after #pragma. */ +static void +do_pragma (cpp_reader *pfile) +{ + const struct pragma_entry *p = NULL; + const cpp_token *token, *pragma_token = pfile->cur_token; + unsigned int count = 1; + + pfile->state.prevent_expansion++; + + token = cpp_get_token (pfile); + if (token->type == CPP_NAME) + { + p = lookup_pragma_entry (pfile->pragmas, token->val.node); + if (p && p->is_nspace) + { + count = 2; + token = cpp_get_token (pfile); + if (token->type == CPP_NAME) + p = lookup_pragma_entry (p->u.space, token->val.node); + else + p = NULL; + } + } + + if (p) + { + /* Since the handler below doesn't get the line number, that it + might need for diagnostics, make sure it has the right + numbers in place. */ + if (pfile->cb.line_change) + (*pfile->cb.line_change) (pfile, pragma_token, false); + (*p->u.handler) (pfile); + } + else if (pfile->cb.def_pragma) + { + _cpp_backup_tokens (pfile, count); + pfile->cb.def_pragma (pfile, pfile->directive_line); + } + + pfile->state.prevent_expansion--; +} + +/* Handle #pragma once. */ +static void +do_pragma_once (cpp_reader *pfile) +{ + if (pfile->buffer->prev == NULL) + cpp_error (pfile, CPP_DL_WARNING, "#pragma once in main file"); + + check_eol (pfile); + _cpp_mark_file_once_only (pfile, pfile->buffer->file); +} + +/* Handle #pragma GCC poison, to poison one or more identifiers so + that the lexer produces a hard error for each subsequent usage. */ +static void +do_pragma_poison (cpp_reader *pfile) +{ + const cpp_token *tok; + cpp_hashnode *hp; + + pfile->state.poisoned_ok = 1; + for (;;) + { + tok = _cpp_lex_token (pfile); + if (tok->type == CPP_EOF) + break; + if (tok->type != CPP_NAME) + { + cpp_error (pfile, CPP_DL_ERROR, + "invalid #pragma GCC poison directive"); + break; + } + + hp = tok->val.node; + if (hp->flags & NODE_POISONED) + continue; + + if (hp->type == NT_MACRO) + cpp_error (pfile, CPP_DL_WARNING, "poisoning existing macro \"%s\"", + NODE_NAME (hp)); + _cpp_free_definition (hp); + hp->flags |= NODE_POISONED | NODE_DIAGNOSTIC; + } + pfile->state.poisoned_ok = 0; +} + +/* Mark the current header as a system header. This will suppress + some categories of warnings (notably those from -pedantic). It is + intended for use in system libraries that cannot be implemented in + conforming C, but cannot be certain that their headers appear in a + system include directory. To prevent abuse, it is rejected in the + primary source file. */ +static void +do_pragma_system_header (cpp_reader *pfile) +{ + cpp_buffer *buffer = pfile->buffer; + + if (buffer->prev == 0) + cpp_error (pfile, CPP_DL_WARNING, + "#pragma system_header ignored outside include file"); + else + { + check_eol (pfile); + skip_rest_of_line (pfile); + cpp_make_system_header (pfile, 1, 0); + } +} + +/* Check the modified date of the current include file against a specified + file. Issue a diagnostic, if the specified file is newer. We use this to + determine if a fixed header should be refixed. */ +static void +do_pragma_dependency (cpp_reader *pfile) +{ + const char *fname; + int angle_brackets, ordering; + + fname = parse_include (pfile, &angle_brackets); + if (!fname) + return; + + ordering = _cpp_compare_file_date (pfile, fname, angle_brackets); + if (ordering < 0) + cpp_error (pfile, CPP_DL_WARNING, "cannot find source file %s", fname); + else if (ordering > 0) + { + cpp_error (pfile, CPP_DL_WARNING, + "current file is older than %s", fname); + if (cpp_get_token (pfile)->type != CPP_EOF) + { + _cpp_backup_tokens (pfile, 1); + do_diagnostic (pfile, CPP_DL_WARNING, 0); + } + } + + free ((void *) fname); +} + +/* Get a token but skip padding. */ +static const cpp_token * +get_token_no_padding (cpp_reader *pfile) +{ + for (;;) + { + const cpp_token *result = cpp_get_token (pfile); + if (result->type != CPP_PADDING) + return result; + } +} + +/* Check syntax is "(string-literal)". Returns the string on success, + or NULL on failure. */ +static const cpp_token * +get__Pragma_string (cpp_reader *pfile) +{ + const cpp_token *string; + + if (get_token_no_padding (pfile)->type != CPP_OPEN_PAREN) + return NULL; + + string = get_token_no_padding (pfile); + if (string->type != CPP_STRING && string->type != CPP_WSTRING) + return NULL; + + if (get_token_no_padding (pfile)->type != CPP_CLOSE_PAREN) + return NULL; + + return string; +} + +/* Destringize IN into a temporary buffer, by removing the first \ of + \" and \\ sequences, and process the result as a #pragma directive. */ +static void +destringize_and_run (cpp_reader *pfile, const cpp_string *in) +{ + const unsigned char *src, *limit; + char *dest, *result; + + dest = result = alloca (in->len - 1); + src = in->text + 1 + (in->text[0] == 'L'); + limit = in->text + in->len - 1; + while (src < limit) + { + /* We know there is a character following the backslash. */ + if (*src == '\\' && (src[1] == '\\' || src[1] == '"')) + src++; + *dest++ = *src++; + } + *dest = '\n'; + + /* Ugh; an awful kludge. We are really not set up to be lexing + tokens when in the middle of a macro expansion. Use a new + context to force cpp_get_token to lex, and so skip_rest_of_line + doesn't go beyond the end of the text. Also, remember the + current lexing position so we can return to it later. + + Something like line-at-a-time lexing should remove the need for + this. */ + { + cpp_context *saved_context = pfile->context; + cpp_token *saved_cur_token = pfile->cur_token; + tokenrun *saved_cur_run = pfile->cur_run; + + pfile->context = xnew (cpp_context); + pfile->context->macro = 0; + pfile->context->prev = 0; + run_directive (pfile, T_PRAGMA, result, dest - result); + free (pfile->context); + pfile->context = saved_context; + pfile->cur_token = saved_cur_token; + pfile->cur_run = saved_cur_run; + } + + /* See above comment. For the moment, we'd like + + token1 _Pragma ("foo") token2 + + to be output as + + token1 + # 7 "file.c" + #pragma foo + # 7 "file.c" + token2 + + Getting the line markers is a little tricky. */ + if (pfile->cb.line_change) + pfile->cb.line_change (pfile, pfile->cur_token, false); +} + +/* Handle the _Pragma operator. */ +void +_cpp_do__Pragma (cpp_reader *pfile) +{ + const cpp_token *string = get__Pragma_string (pfile); + + if (string) + destringize_and_run (pfile, &string->val.str); + else + cpp_error (pfile, CPP_DL_ERROR, + "_Pragma takes a parenthesized string literal"); +} + +/* Ignore #sccs on all systems. */ +static void +do_sccs (cpp_reader *pfile ATTRIBUTE_UNUSED) +{ +} + +/* Handle #ifdef. */ +static void +do_ifdef (cpp_reader *pfile) +{ + int skip = 1; + + if (! pfile->state.skipping) + { + const cpp_hashnode *node = lex_macro_node (pfile); + + if (node) + { + skip = node->type != NT_MACRO; + _cpp_mark_macro_used (node); + check_eol (pfile); + } + } + + push_conditional (pfile, skip, T_IFDEF, 0); +} + +/* Handle #ifndef. */ +static void +do_ifndef (cpp_reader *pfile) +{ + int skip = 1; + const cpp_hashnode *node = 0; + + if (! pfile->state.skipping) + { + node = lex_macro_node (pfile); + + if (node) + { + skip = node->type == NT_MACRO; + _cpp_mark_macro_used (node); + check_eol (pfile); + } + } + + push_conditional (pfile, skip, T_IFNDEF, node); +} + +/* _cpp_parse_expr puts a macro in a "#if !defined ()" expression in + pfile->mi_ind_cmacro so we can handle multiple-include + optimizations. If macro expansion occurs in the expression, we + cannot treat it as a controlling conditional, since the expansion + could change in the future. That is handled by cpp_get_token. */ +static void +do_if (cpp_reader *pfile) +{ + int skip = 1; + + if (! pfile->state.skipping) + skip = _cpp_parse_expr (pfile) == false; + + push_conditional (pfile, skip, T_IF, pfile->mi_ind_cmacro); +} + +/* Flip skipping state if appropriate and continue without changing + if_stack; this is so that the error message for missing #endif's + etc. will point to the original #if. */ +static void +do_else (cpp_reader *pfile) +{ + cpp_buffer *buffer = pfile->buffer; + struct if_stack *ifs = buffer->if_stack; + + if (ifs == NULL) + cpp_error (pfile, CPP_DL_ERROR, "#else without #if"); + else + { + if (ifs->type == T_ELSE) + { + cpp_error (pfile, CPP_DL_ERROR, "#else after #else"); + cpp_error_with_line (pfile, CPP_DL_ERROR, ifs->line, 0, + "the conditional began here"); + } + ifs->type = T_ELSE; + + /* Skip any future (erroneous) #elses or #elifs. */ + pfile->state.skipping = ifs->skip_elses; + ifs->skip_elses = true; + + /* Invalidate any controlling macro. */ + ifs->mi_cmacro = 0; + + /* Only check EOL if was not originally skipping. */ + if (!ifs->was_skipping && CPP_OPTION (pfile, warn_endif_labels)) + check_eol (pfile); + } +} + +/* Handle a #elif directive by not changing if_stack either. See the + comment above do_else. */ +static void +do_elif (cpp_reader *pfile) +{ + cpp_buffer *buffer = pfile->buffer; + struct if_stack *ifs = buffer->if_stack; + + if (ifs == NULL) + cpp_error (pfile, CPP_DL_ERROR, "#elif without #if"); + else + { + if (ifs->type == T_ELSE) + { + cpp_error (pfile, CPP_DL_ERROR, "#elif after #else"); + cpp_error_with_line (pfile, CPP_DL_ERROR, ifs->line, 0, + "the conditional began here"); + } + ifs->type = T_ELIF; + + /* Only evaluate this if we aren't skipping elses. During + evaluation, set skipping to false to get lexer warnings. */ + if (ifs->skip_elses) + pfile->state.skipping = 1; + else + { + pfile->state.skipping = 0; + pfile->state.skipping = ! _cpp_parse_expr (pfile); + ifs->skip_elses = ! pfile->state.skipping; + } + + /* Invalidate any controlling macro. */ + ifs->mi_cmacro = 0; + } +} + +/* #endif pops the if stack and resets pfile->state.skipping. */ +static void +do_endif (cpp_reader *pfile) +{ + cpp_buffer *buffer = pfile->buffer; + struct if_stack *ifs = buffer->if_stack; + + if (ifs == NULL) + cpp_error (pfile, CPP_DL_ERROR, "#endif without #if"); + else + { + /* Only check EOL if was not originally skipping. */ + if (!ifs->was_skipping && CPP_OPTION (pfile, warn_endif_labels)) + check_eol (pfile); + + /* If potential control macro, we go back outside again. */ + if (ifs->next == 0 && ifs->mi_cmacro) + { + pfile->mi_valid = true; + pfile->mi_cmacro = ifs->mi_cmacro; + } + + buffer->if_stack = ifs->next; + pfile->state.skipping = ifs->was_skipping; + obstack_free (&pfile->buffer_ob, ifs); + } +} + +/* Push an if_stack entry for a preprocessor conditional, and set + pfile->state.skipping to SKIP. If TYPE indicates the conditional + is #if or #ifndef, CMACRO is a potentially controlling macro, and + we need to check here that we are at the top of the file. */ +static void +push_conditional (cpp_reader *pfile, int skip, int type, + const cpp_hashnode *cmacro) +{ + struct if_stack *ifs; + cpp_buffer *buffer = pfile->buffer; + + ifs = xobnew (&pfile->buffer_ob, struct if_stack); + ifs->line = pfile->directive_line; + ifs->next = buffer->if_stack; + ifs->skip_elses = pfile->state.skipping || !skip; + ifs->was_skipping = pfile->state.skipping; + ifs->type = type; + /* This condition is effectively a test for top-of-file. */ + if (pfile->mi_valid && pfile->mi_cmacro == 0) + ifs->mi_cmacro = cmacro; + else + ifs->mi_cmacro = 0; + + pfile->state.skipping = skip; + buffer->if_stack = ifs; +} + +/* Read the tokens of the answer into the macro pool, in a directive + of type TYPE. Only commit the memory if we intend it as permanent + storage, i.e. the #assert case. Returns 0 on success, and sets + ANSWERP to point to the answer. */ +static int +parse_answer (cpp_reader *pfile, struct answer **answerp, int type) +{ + const cpp_token *paren; + struct answer *answer; + unsigned int acount; + + /* In a conditional, it is legal to not have an open paren. We + should save the following token in this case. */ + paren = cpp_get_token (pfile); + + /* If not a paren, see if we're OK. */ + if (paren->type != CPP_OPEN_PAREN) + { + /* In a conditional no answer is a test for any answer. It + could be followed by any token. */ + if (type == T_IF) + { + _cpp_backup_tokens (pfile, 1); + return 0; + } + + /* #unassert with no answer is valid - it removes all answers. */ + if (type == T_UNASSERT && paren->type == CPP_EOF) + return 0; + + cpp_error (pfile, CPP_DL_ERROR, "missing '(' after predicate"); + return 1; + } + + for (acount = 0;; acount++) + { + size_t room_needed; + const cpp_token *token = cpp_get_token (pfile); + cpp_token *dest; + + if (token->type == CPP_CLOSE_PAREN) + break; + + if (token->type == CPP_EOF) + { + cpp_error (pfile, CPP_DL_ERROR, "missing ')' to complete answer"); + return 1; + } + + /* struct answer includes the space for one token. */ + room_needed = (sizeof (struct answer) + acount * sizeof (cpp_token)); + + if (BUFF_ROOM (pfile->a_buff) < room_needed) + _cpp_extend_buff (pfile, &pfile->a_buff, sizeof (struct answer)); + + dest = &((struct answer *) BUFF_FRONT (pfile->a_buff))->first[acount]; + *dest = *token; + + /* Drop whitespace at start, for answer equivalence purposes. */ + if (acount == 0) + dest->flags &= ~PREV_WHITE; + } + + if (acount == 0) + { + cpp_error (pfile, CPP_DL_ERROR, "predicate's answer is empty"); + return 1; + } + + answer = (struct answer *) BUFF_FRONT (pfile->a_buff); + answer->count = acount; + answer->next = NULL; + *answerp = answer; + + return 0; +} + +/* Parses an assertion directive of type TYPE, returning a pointer to + the hash node of the predicate, or 0 on error. If an answer was + supplied, it is placed in ANSWERP, otherwise it is set to 0. */ +static cpp_hashnode * +parse_assertion (cpp_reader *pfile, struct answer **answerp, int type) +{ + cpp_hashnode *result = 0; + const cpp_token *predicate; + + /* We don't expand predicates or answers. */ + pfile->state.prevent_expansion++; + + *answerp = 0; + predicate = cpp_get_token (pfile); + if (predicate->type == CPP_EOF) + cpp_error (pfile, CPP_DL_ERROR, "assertion without predicate"); + else if (predicate->type != CPP_NAME) + cpp_error (pfile, CPP_DL_ERROR, "predicate must be an identifier"); + else if (parse_answer (pfile, answerp, type) == 0) + { + unsigned int len = NODE_LEN (predicate->val.node); + unsigned char *sym = alloca (len + 1); + + /* Prefix '#' to get it out of macro namespace. */ + sym[0] = '#'; + memcpy (sym + 1, NODE_NAME (predicate->val.node), len); + result = cpp_lookup (pfile, sym, len + 1); + } + + pfile->state.prevent_expansion--; + return result; +} + +/* Returns a pointer to the pointer to CANDIDATE in the answer chain, + or a pointer to NULL if the answer is not in the chain. */ +static struct answer ** +find_answer (cpp_hashnode *node, const struct answer *candidate) +{ + unsigned int i; + struct answer **result; + + for (result = &node->value.answers; *result; result = &(*result)->next) + { + struct answer *answer = *result; + + if (answer->count == candidate->count) + { + for (i = 0; i < answer->count; i++) + if (! _cpp_equiv_tokens (&answer->first[i], &candidate->first[i])) + break; + + if (i == answer->count) + break; + } + } + + return result; +} + +/* Test an assertion within a preprocessor conditional. Returns + nonzero on failure, zero on success. On success, the result of + the test is written into VALUE, otherwise the value 0. */ +int +_cpp_test_assertion (cpp_reader *pfile, unsigned int *value) +{ + struct answer *answer; + cpp_hashnode *node; + + node = parse_assertion (pfile, &answer, T_IF); + + /* For recovery, an erroneous assertion expression is handled as a + failing assertion. */ + *value = 0; + + if (node) + *value = (node->type == NT_ASSERTION && + (answer == 0 || *find_answer (node, answer) != 0)); + else if (pfile->cur_token[-1].type == CPP_EOF) + _cpp_backup_tokens (pfile, 1); + + /* We don't commit the memory for the answer - it's temporary only. */ + return node == 0; +} + +/* Handle #assert. */ +static void +do_assert (cpp_reader *pfile) +{ + struct answer *new_answer; + cpp_hashnode *node; + + node = parse_assertion (pfile, &new_answer, T_ASSERT); + if (node) + { + /* Place the new answer in the answer list. First check there + is not a duplicate. */ + new_answer->next = 0; + if (node->type == NT_ASSERTION) + { + if (*find_answer (node, new_answer)) + { + cpp_error (pfile, CPP_DL_WARNING, "\"%s\" re-asserted", + NODE_NAME (node) + 1); + return; + } + new_answer->next = node->value.answers; + } + + node->type = NT_ASSERTION; + node->value.answers = new_answer; + BUFF_FRONT (pfile->a_buff) += (sizeof (struct answer) + + (new_answer->count - 1) + * sizeof (cpp_token)); + check_eol (pfile); + } +} + +/* Handle #unassert. */ +static void +do_unassert (cpp_reader *pfile) +{ + cpp_hashnode *node; + struct answer *answer; + + node = parse_assertion (pfile, &answer, T_UNASSERT); + /* It isn't an error to #unassert something that isn't asserted. */ + if (node && node->type == NT_ASSERTION) + { + if (answer) + { + struct answer **p = find_answer (node, answer), *temp; + + /* Remove the answer from the list. */ + temp = *p; + if (temp) + *p = temp->next; + + /* Did we free the last answer? */ + if (node->value.answers == 0) + node->type = NT_VOID; + + check_eol (pfile); + } + else + _cpp_free_definition (node); + } + + /* We don't commit the memory for the answer - it's temporary only. */ +} + +/* These are for -D, -U, -A. */ + +/* Process the string STR as if it appeared as the body of a #define. + If STR is just an identifier, define it with value 1. + If STR has anything after the identifier, then it should + be identifier=definition. */ +void +cpp_define (cpp_reader *pfile, const char *str) +{ + char *buf, *p; + size_t count; + + /* Copy the entire option so we can modify it. + Change the first "=" in the string to a space. If there is none, + tack " 1" on the end. */ + + count = strlen (str); + buf = alloca (count + 3); + memcpy (buf, str, count); + + p = strchr (str, '='); + if (p) + buf[p - str] = ' '; + else + { + buf[count++] = ' '; + buf[count++] = '1'; + } + buf[count] = '\n'; + + run_directive (pfile, T_DEFINE, buf, count); +} + +/* Slight variant of the above for use by initialize_builtins. */ +void +_cpp_define_builtin (cpp_reader *pfile, const char *str) +{ + size_t len = strlen (str); + char *buf = alloca (len + 1); + memcpy (buf, str, len); + buf[len] = '\n'; + run_directive (pfile, T_DEFINE, buf, len); +} + +/* Process MACRO as if it appeared as the body of an #undef. */ +void +cpp_undef (cpp_reader *pfile, const char *macro) +{ + size_t len = strlen (macro); + char *buf = alloca (len + 1); + memcpy (buf, macro, len); + buf[len] = '\n'; + run_directive (pfile, T_UNDEF, buf, len); +} + +/* Process the string STR as if it appeared as the body of a #assert. */ +void +cpp_assert (cpp_reader *pfile, const char *str) +{ + handle_assertion (pfile, str, T_ASSERT); +} + +/* Process STR as if it appeared as the body of an #unassert. */ +void +cpp_unassert (cpp_reader *pfile, const char *str) +{ + handle_assertion (pfile, str, T_UNASSERT); +} + +/* Common code for cpp_assert (-A) and cpp_unassert (-A-). */ +static void +handle_assertion (cpp_reader *pfile, const char *str, int type) +{ + size_t count = strlen (str); + const char *p = strchr (str, '='); + + /* Copy the entire option so we can modify it. Change the first + "=" in the string to a '(', and tack a ')' on the end. */ + char *buf = alloca (count + 2); + + memcpy (buf, str, count); + if (p) + { + buf[p - str] = '('; + buf[count++] = ')'; + } + buf[count] = '\n'; + str = buf; + + run_directive (pfile, type, str, count); +} + +/* The number of errors for a given reader. */ +unsigned int +cpp_errors (cpp_reader *pfile) +{ + return pfile->errors; +} + +/* The options structure. */ +cpp_options * +cpp_get_options (cpp_reader *pfile) +{ + return &pfile->opts; +} + +/* The callbacks structure. */ +cpp_callbacks * +cpp_get_callbacks (cpp_reader *pfile) +{ + return &pfile->cb; +} + +/* Copy the given callbacks structure to our own. */ +void +cpp_set_callbacks (cpp_reader *pfile, cpp_callbacks *cb) +{ + pfile->cb = *cb; +} + +/* Push a new buffer on the buffer stack. Returns the new buffer; it + doesn't fail. It does not generate a file change call back; that + is the responsibility of the caller. */ +cpp_buffer * +cpp_push_buffer (cpp_reader *pfile, const uchar *buffer, size_t len, + int from_stage3) +{ + cpp_buffer *new = xobnew (&pfile->buffer_ob, cpp_buffer); + + /* Clears, amongst other things, if_stack and mi_cmacro. */ + memset (new, 0, sizeof (cpp_buffer)); + + new->next_line = new->buf = buffer; + new->rlimit = buffer + len; + new->from_stage3 = from_stage3; + new->prev = pfile->buffer; + new->need_line = true; + + pfile->buffer = new; + + return new; +} + +/* Pops a single buffer, with a file change call-back if appropriate. + Then pushes the next -include file, if any remain. */ +void +_cpp_pop_buffer (cpp_reader *pfile) +{ + cpp_buffer *buffer = pfile->buffer; + struct _cpp_file *inc = buffer->file; + struct if_stack *ifs; + + /* Walk back up the conditional stack till we reach its level at + entry to this file, issuing error messages. */ + for (ifs = buffer->if_stack; ifs; ifs = ifs->next) + cpp_error_with_line (pfile, CPP_DL_ERROR, ifs->line, 0, + "unterminated #%s", dtable[ifs->type].name); + + /* In case of a missing #endif. */ + pfile->state.skipping = 0; + + /* _cpp_do_file_change expects pfile->buffer to be the new one. */ + pfile->buffer = buffer->prev; + + free (buffer->notes); + + /* Free the buffer object now; we may want to push a new buffer + in _cpp_push_next_include_file. */ + obstack_free (&pfile->buffer_ob, buffer); + + if (inc) + { + _cpp_pop_file_buffer (pfile, inc); + + _cpp_do_file_change (pfile, LC_LEAVE, 0, 0, 0); + } +} + +/* Enter all recognized directives in the hash table. */ +void +_cpp_init_directives (cpp_reader *pfile) +{ + unsigned int i; + cpp_hashnode *node; + + for (i = 0; i < (unsigned int) N_DIRECTIVES; i++) + { + node = cpp_lookup (pfile, dtable[i].name, dtable[i].length); + node->is_directive = 1; + node->directive_index = i; + } +} diff --git a/libcpp/errors.c b/libcpp/errors.c new file mode 100644 index 00000000000..5d53c21b28d --- /dev/null +++ b/libcpp/errors.c @@ -0,0 +1,182 @@ +/* Default error handlers for CPP Library. + Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1998, 1999, 2000, + 2001, 2002, 2004 Free Software Foundation, Inc. + Written by Per Bothner, 1994. + Based on CCCP program by Paul Rubin, June 1986 + Adapted to ANSI C, Richard Stallman, Jan 1987 + +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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + In other words, you are welcome to use, share and improve this program. + You are forbidden to forbid anyone else to use, share and improve + what you give them. Help stamp out software-hoarding! */ + +#include "config.h" +#include "system.h" +#include "cpplib.h" +#include "internal.h" + +static void print_location (cpp_reader *, source_location, unsigned int); + +/* Print the logical file location (LINE, COL) in preparation for a + diagnostic. Outputs the #include chain if it has changed. A line + of zero suppresses the include stack, and outputs the program name + instead. */ +static void +print_location (cpp_reader *pfile, source_location line, unsigned int col) +{ + if (line == 0) + fprintf (stderr, "%s: ", progname); + else + { + const struct line_map *map; + unsigned int lin; + + map = linemap_lookup (pfile->line_table, line); + linemap_print_containing_files (pfile->line_table, map); + + lin = SOURCE_LINE (map, line); + if (col == 0) + { + col = SOURCE_COLUMN (map, line); + if (col == 0) + col = 1; + } + + if (lin == 0) + fprintf (stderr, "%s:", map->to_file); + else if (CPP_OPTION (pfile, show_column) == 0) + fprintf (stderr, "%s:%u:", map->to_file, lin); + else + fprintf (stderr, "%s:%u:%u:", map->to_file, lin, col); + + fputc (' ', stderr); + } +} + +/* Set up for a diagnostic: print the file and line, bump the error + counter, etc. SRC_LOC is the logical line number; zero means to print + at the location of the previously lexed token, which tends to be + the correct place by default. The column number can be specified either + using COLUMN or (if COLUMN==0) extracting SOURCE_COLUMN from SRC_LOC. + (This may seem redundant, but is useful when pre-scanning (cleaning) a line, + when we haven't yet verified whether the current line_map has a + big enough max_column_hint.) + + Returns 0 if the error has been suppressed. */ +int +_cpp_begin_message (cpp_reader *pfile, int code, + source_location src_loc, unsigned int column) +{ + int level = CPP_DL_EXTRACT (code); + + switch (level) + { + case CPP_DL_WARNING: + case CPP_DL_PEDWARN: + if (cpp_in_system_header (pfile) + && ! CPP_OPTION (pfile, warn_system_headers)) + return 0; + /* Fall through. */ + + case CPP_DL_WARNING_SYSHDR: + if (CPP_OPTION (pfile, warnings_are_errors) + || (level == CPP_DL_PEDWARN && CPP_OPTION (pfile, pedantic_errors))) + { + if (CPP_OPTION (pfile, inhibit_errors)) + return 0; + level = CPP_DL_ERROR; + pfile->errors++; + } + else if (CPP_OPTION (pfile, inhibit_warnings)) + return 0; + break; + + case CPP_DL_ERROR: + if (CPP_OPTION (pfile, inhibit_errors)) + return 0; + /* ICEs cannot be inhibited. */ + case CPP_DL_ICE: + pfile->errors++; + break; + } + + print_location (pfile, src_loc, column); + if (CPP_DL_WARNING_P (level)) + fputs (_("warning: "), stderr); + else if (level == CPP_DL_ICE) + fputs (_("internal error: "), stderr); + + return 1; +} + +/* Don't remove the blank before do, as otherwise the exgettext + script will mistake this as a function definition */ +#define v_message(msgid, ap) \ + do { vfprintf (stderr, _(msgid), ap); putc ('\n', stderr); } while (0) + +/* Exported interface. */ + +/* Print an error at the location of the previously lexed token. */ +void +cpp_error (cpp_reader * pfile, int level, const char *msgid, ...) +{ + source_location src_loc; + va_list ap; + + va_start (ap, msgid); + + if (CPP_OPTION (pfile, traditional)) + { + if (pfile->state.in_directive) + src_loc = pfile->directive_line; + else + src_loc = pfile->line_table->highest_line; + } + else + { + src_loc = pfile->cur_token[-1].src_loc; + } + + if (_cpp_begin_message (pfile, level, src_loc, 0)) + v_message (msgid, ap); + + va_end (ap); +} + +/* Print an error at a specific location. */ +void +cpp_error_with_line (cpp_reader *pfile, int level, + source_location src_loc, unsigned int column, + const char *msgid, ...) +{ + va_list ap; + + va_start (ap, msgid); + + if (_cpp_begin_message (pfile, level, src_loc, column)) + v_message (msgid, ap); + + va_end (ap); +} + +void +cpp_errno (cpp_reader *pfile, int level, const char *msgid) +{ + if (msgid[0] == '\0') + msgid = _("stdout"); + + cpp_error (pfile, level, "%s: %s", msgid, xstrerror (errno)); +} diff --git a/libcpp/expr.c b/libcpp/expr.c new file mode 100644 index 00000000000..f49bd082858 --- /dev/null +++ b/libcpp/expr.c @@ -0,0 +1,1540 @@ +/* Parse C expressions for cpplib. + Copyright (C) 1987, 1992, 1994, 1995, 1997, 1998, 1999, 2000, 2001, + 2002, 2004 Free Software Foundation. + Contributed by Per Bothner, 1994. + +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, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include "config.h" +#include "system.h" +#include "cpplib.h" +#include "internal.h" + +#define PART_PRECISION (sizeof (cpp_num_part) * CHAR_BIT) +#define HALF_MASK (~(cpp_num_part) 0 >> (PART_PRECISION / 2)) +#define LOW_PART(num_part) (num_part & HALF_MASK) +#define HIGH_PART(num_part) (num_part >> (PART_PRECISION / 2)) + +struct op +{ + const cpp_token *token; /* The token forming op (for diagnostics). */ + cpp_num value; /* The value logically "right" of op. */ + enum cpp_ttype op; +}; + +/* Some simple utility routines on double integers. */ +#define num_zerop(num) ((num.low | num.high) == 0) +#define num_eq(num1, num2) (num1.low == num2.low && num1.high == num2.high) +static bool num_positive (cpp_num, size_t); +static bool num_greater_eq (cpp_num, cpp_num, size_t); +static cpp_num num_trim (cpp_num, size_t); +static cpp_num num_part_mul (cpp_num_part, cpp_num_part); + +static cpp_num num_unary_op (cpp_reader *, cpp_num, enum cpp_ttype); +static cpp_num num_binary_op (cpp_reader *, cpp_num, cpp_num, enum cpp_ttype); +static cpp_num num_negate (cpp_num, size_t); +static cpp_num num_bitwise_op (cpp_reader *, cpp_num, cpp_num, enum cpp_ttype); +static cpp_num num_inequality_op (cpp_reader *, cpp_num, cpp_num, + enum cpp_ttype); +static cpp_num num_equality_op (cpp_reader *, cpp_num, cpp_num, + enum cpp_ttype); +static cpp_num num_mul (cpp_reader *, cpp_num, cpp_num); +static cpp_num num_div_op (cpp_reader *, cpp_num, cpp_num, enum cpp_ttype); +static cpp_num num_lshift (cpp_num, size_t, size_t); +static cpp_num num_rshift (cpp_num, size_t, size_t); + +static cpp_num append_digit (cpp_num, int, int, size_t); +static cpp_num parse_defined (cpp_reader *); +static cpp_num eval_token (cpp_reader *, const cpp_token *); +static struct op *reduce (cpp_reader *, struct op *, enum cpp_ttype); +static unsigned int interpret_float_suffix (const uchar *, size_t); +static unsigned int interpret_int_suffix (const uchar *, size_t); +static void check_promotion (cpp_reader *, const struct op *); + +/* Token type abuse to create unary plus and minus operators. */ +#define CPP_UPLUS (CPP_LAST_CPP_OP + 1) +#define CPP_UMINUS (CPP_LAST_CPP_OP + 2) + +/* With -O2, gcc appears to produce nice code, moving the error + message load and subsequent jump completely out of the main path. */ +#define SYNTAX_ERROR(msgid) \ + do { cpp_error (pfile, CPP_DL_ERROR, msgid); goto syntax_error; } while(0) +#define SYNTAX_ERROR2(msgid, arg) \ + do { cpp_error (pfile, CPP_DL_ERROR, msgid, arg); goto syntax_error; } \ + while(0) + +/* Subroutine of cpp_classify_number. S points to a float suffix of + length LEN, possibly zero. Returns 0 for an invalid suffix, or a + flag vector describing the suffix. */ +static unsigned int +interpret_float_suffix (const uchar *s, size_t len) +{ + size_t f = 0, l = 0, i = 0; + + while (len--) + switch (s[len]) + { + case 'f': case 'F': f++; break; + case 'l': case 'L': l++; break; + case 'i': case 'I': + case 'j': case 'J': i++; break; + default: + return 0; + } + + if (f + l > 1 || i > 1) + return 0; + + return ((i ? CPP_N_IMAGINARY : 0) + | (f ? CPP_N_SMALL : + l ? CPP_N_LARGE : CPP_N_MEDIUM)); +} + +/* Subroutine of cpp_classify_number. S points to an integer suffix + of length LEN, possibly zero. Returns 0 for an invalid suffix, or a + flag vector describing the suffix. */ +static unsigned int +interpret_int_suffix (const uchar *s, size_t len) +{ + size_t u, l, i; + + u = l = i = 0; + + while (len--) + switch (s[len]) + { + case 'u': case 'U': u++; break; + case 'i': case 'I': + case 'j': case 'J': i++; break; + case 'l': case 'L': l++; + /* If there are two Ls, they must be adjacent and the same case. */ + if (l == 2 && s[len] != s[len + 1]) + return 0; + break; + default: + return 0; + } + + if (l > 2 || u > 1 || i > 1) + return 0; + + return ((i ? CPP_N_IMAGINARY : 0) + | (u ? CPP_N_UNSIGNED : 0) + | ((l == 0) ? CPP_N_SMALL + : (l == 1) ? CPP_N_MEDIUM : CPP_N_LARGE)); +} + +/* Categorize numeric constants according to their field (integer, + floating point, or invalid), radix (decimal, octal, hexadecimal), + and type suffixes. */ +unsigned int +cpp_classify_number (cpp_reader *pfile, const cpp_token *token) +{ + const uchar *str = token->val.str.text; + const uchar *limit; + unsigned int max_digit, result, radix; + enum {NOT_FLOAT = 0, AFTER_POINT, AFTER_EXPON} float_flag; + + /* If the lexer has done its job, length one can only be a single + digit. Fast-path this very common case. */ + if (token->val.str.len == 1) + return CPP_N_INTEGER | CPP_N_SMALL | CPP_N_DECIMAL; + + limit = str + token->val.str.len; + float_flag = NOT_FLOAT; + max_digit = 0; + radix = 10; + + /* First, interpret the radix. */ + if (*str == '0') + { + radix = 8; + str++; + + /* Require at least one hex digit to classify it as hex. */ + if ((*str == 'x' || *str == 'X') + && (str[1] == '.' || ISXDIGIT (str[1]))) + { + radix = 16; + str++; + } + } + + /* Now scan for a well-formed integer or float. */ + for (;;) + { + unsigned int c = *str++; + + if (ISDIGIT (c) || (ISXDIGIT (c) && radix == 16)) + { + c = hex_value (c); + if (c > max_digit) + max_digit = c; + } + else if (c == '.') + { + if (float_flag == NOT_FLOAT) + float_flag = AFTER_POINT; + else + SYNTAX_ERROR ("too many decimal points in number"); + } + else if ((radix <= 10 && (c == 'e' || c == 'E')) + || (radix == 16 && (c == 'p' || c == 'P'))) + { + float_flag = AFTER_EXPON; + break; + } + else + { + /* Start of suffix. */ + str--; + break; + } + } + + if (float_flag != NOT_FLOAT && radix == 8) + radix = 10; + + if (max_digit >= radix) + SYNTAX_ERROR2 ("invalid digit \"%c\" in octal constant", '0' + max_digit); + + if (float_flag != NOT_FLOAT) + { + if (radix == 16 && CPP_PEDANTIC (pfile) && !CPP_OPTION (pfile, c99)) + cpp_error (pfile, CPP_DL_PEDWARN, + "use of C99 hexadecimal floating constant"); + + if (float_flag == AFTER_EXPON) + { + if (*str == '+' || *str == '-') + str++; + + /* Exponent is decimal, even if string is a hex float. */ + if (!ISDIGIT (*str)) + SYNTAX_ERROR ("exponent has no digits"); + + do + str++; + while (ISDIGIT (*str)); + } + else if (radix == 16) + SYNTAX_ERROR ("hexadecimal floating constants require an exponent"); + + result = interpret_float_suffix (str, limit - str); + if (result == 0) + { + cpp_error (pfile, CPP_DL_ERROR, + "invalid suffix \"%.*s\" on floating constant", + (int) (limit - str), str); + return CPP_N_INVALID; + } + + /* Traditional C didn't accept any floating suffixes. */ + if (limit != str + && CPP_WTRADITIONAL (pfile) + && ! cpp_sys_macro_p (pfile)) + cpp_error (pfile, CPP_DL_WARNING, + "traditional C rejects the \"%.*s\" suffix", + (int) (limit - str), str); + + result |= CPP_N_FLOATING; + } + else + { + result = interpret_int_suffix (str, limit - str); + if (result == 0) + { + cpp_error (pfile, CPP_DL_ERROR, + "invalid suffix \"%.*s\" on integer constant", + (int) (limit - str), str); + return CPP_N_INVALID; + } + + /* Traditional C only accepted the 'L' suffix. + Suppress warning about 'LL' with -Wno-long-long. */ + if (CPP_WTRADITIONAL (pfile) && ! cpp_sys_macro_p (pfile)) + { + int u_or_i = (result & (CPP_N_UNSIGNED|CPP_N_IMAGINARY)); + int large = (result & CPP_N_WIDTH) == CPP_N_LARGE; + + if (u_or_i || (large && CPP_OPTION (pfile, warn_long_long))) + cpp_error (pfile, CPP_DL_WARNING, + "traditional C rejects the \"%.*s\" suffix", + (int) (limit - str), str); + } + + if ((result & CPP_N_WIDTH) == CPP_N_LARGE + && ! CPP_OPTION (pfile, c99) + && CPP_OPTION (pfile, warn_long_long)) + cpp_error (pfile, CPP_DL_PEDWARN, + "use of C99 long long integer constant"); + + result |= CPP_N_INTEGER; + } + + if ((result & CPP_N_IMAGINARY) && CPP_PEDANTIC (pfile)) + cpp_error (pfile, CPP_DL_PEDWARN, + "imaginary constants are a GCC extension"); + + if (radix == 10) + result |= CPP_N_DECIMAL; + else if (radix == 16) + result |= CPP_N_HEX; + else + result |= CPP_N_OCTAL; + + return result; + + syntax_error: + return CPP_N_INVALID; +} + +/* cpp_interpret_integer converts an integer constant into a cpp_num, + of precision options->precision. + + We do not provide any interface for decimal->float conversion, + because the preprocessor doesn't need it and we don't want to + drag in GCC's floating point emulator. */ +cpp_num +cpp_interpret_integer (cpp_reader *pfile, const cpp_token *token, + unsigned int type) +{ + const uchar *p, *end; + cpp_num result; + + result.low = 0; + result.high = 0; + result.unsignedp = !!(type & CPP_N_UNSIGNED); + result.overflow = false; + + p = token->val.str.text; + end = p + token->val.str.len; + + /* Common case of a single digit. */ + if (token->val.str.len == 1) + result.low = p[0] - '0'; + else + { + cpp_num_part max; + size_t precision = CPP_OPTION (pfile, precision); + unsigned int base = 10, c = 0; + bool overflow = false; + + if ((type & CPP_N_RADIX) == CPP_N_OCTAL) + { + base = 8; + p++; + } + else if ((type & CPP_N_RADIX) == CPP_N_HEX) + { + base = 16; + p += 2; + } + + /* We can add a digit to numbers strictly less than this without + needing the precision and slowness of double integers. */ + max = ~(cpp_num_part) 0; + if (precision < PART_PRECISION) + max >>= PART_PRECISION - precision; + max = (max - base + 1) / base + 1; + + for (; p < end; p++) + { + c = *p; + + if (ISDIGIT (c) || (base == 16 && ISXDIGIT (c))) + c = hex_value (c); + else + break; + + /* Strict inequality for when max is set to zero. */ + if (result.low < max) + result.low = result.low * base + c; + else + { + result = append_digit (result, c, base, precision); + overflow |= result.overflow; + max = 0; + } + } + + if (overflow) + cpp_error (pfile, CPP_DL_PEDWARN, + "integer constant is too large for its type"); + /* If too big to be signed, consider it unsigned. Only warn for + decimal numbers. Traditional numbers were always signed (but + we still honor an explicit U suffix); but we only have + traditional semantics in directives. */ + else if (!result.unsignedp + && !(CPP_OPTION (pfile, traditional) + && pfile->state.in_directive) + && !num_positive (result, precision)) + { + if (base == 10) + cpp_error (pfile, CPP_DL_WARNING, + "integer constant is so large that it is unsigned"); + result.unsignedp = true; + } + } + + return result; +} + +/* Append DIGIT to NUM, a number of PRECISION bits being read in base BASE. */ +static cpp_num +append_digit (cpp_num num, int digit, int base, size_t precision) +{ + cpp_num result; + unsigned int shift = 3 + (base == 16); + bool overflow; + cpp_num_part add_high, add_low; + + /* Multiply by 8 or 16. Catching this overflow here means we don't + need to worry about add_high overflowing. */ + overflow = !!(num.high >> (PART_PRECISION - shift)); + result.high = num.high << shift; + result.low = num.low << shift; + result.high |= num.low >> (PART_PRECISION - shift); + result.unsignedp = num.unsignedp; + + if (base == 10) + { + add_low = num.low << 1; + add_high = (num.high << 1) + (num.low >> (PART_PRECISION - 1)); + } + else + add_high = add_low = 0; + + if (add_low + digit < add_low) + add_high++; + add_low += digit; + + if (result.low + add_low < result.low) + add_high++; + if (result.high + add_high < result.high) + overflow = true; + + result.low += add_low; + result.high += add_high; + result.overflow = overflow; + + /* The above code catches overflow of a cpp_num type. This catches + overflow of the (possibly shorter) target precision. */ + num.low = result.low; + num.high = result.high; + result = num_trim (result, precision); + if (!num_eq (result, num)) + result.overflow = true; + + return result; +} + +/* Handle meeting "defined" in a preprocessor expression. */ +static cpp_num +parse_defined (cpp_reader *pfile) +{ + cpp_num result; + int paren = 0; + cpp_hashnode *node = 0; + const cpp_token *token; + cpp_context *initial_context = pfile->context; + + /* Don't expand macros. */ + pfile->state.prevent_expansion++; + + token = cpp_get_token (pfile); + if (token->type == CPP_OPEN_PAREN) + { + paren = 1; + token = cpp_get_token (pfile); + } + + if (token->type == CPP_NAME) + { + node = token->val.node; + if (paren && cpp_get_token (pfile)->type != CPP_CLOSE_PAREN) + { + cpp_error (pfile, CPP_DL_ERROR, "missing ')' after \"defined\""); + node = 0; + } + } + else + { + cpp_error (pfile, CPP_DL_ERROR, + "operator \"defined\" requires an identifier"); + if (token->flags & NAMED_OP) + { + cpp_token op; + + op.flags = 0; + op.type = token->type; + cpp_error (pfile, CPP_DL_ERROR, + "(\"%s\" is an alternative token for \"%s\" in C++)", + cpp_token_as_text (pfile, token), + cpp_token_as_text (pfile, &op)); + } + } + + if (node) + { + if (pfile->context != initial_context && CPP_PEDANTIC (pfile)) + cpp_error (pfile, CPP_DL_WARNING, + "this use of \"defined\" may not be portable"); + + _cpp_mark_macro_used (node); + + /* A possible controlling macro of the form #if !defined (). + _cpp_parse_expr checks there was no other junk on the line. */ + pfile->mi_ind_cmacro = node; + } + + pfile->state.prevent_expansion--; + + result.unsignedp = false; + result.high = 0; + result.overflow = false; + result.low = node && node->type == NT_MACRO; + return result; +} + +/* Convert a token into a CPP_NUMBER (an interpreted preprocessing + number or character constant, or the result of the "defined" or "#" + operators). */ +static cpp_num +eval_token (cpp_reader *pfile, const cpp_token *token) +{ + cpp_num result; + unsigned int temp; + int unsignedp = 0; + + result.unsignedp = false; + result.overflow = false; + + switch (token->type) + { + case CPP_NUMBER: + temp = cpp_classify_number (pfile, token); + switch (temp & CPP_N_CATEGORY) + { + case CPP_N_FLOATING: + cpp_error (pfile, CPP_DL_ERROR, + "floating constant in preprocessor expression"); + break; + case CPP_N_INTEGER: + if (!(temp & CPP_N_IMAGINARY)) + return cpp_interpret_integer (pfile, token, temp); + cpp_error (pfile, CPP_DL_ERROR, + "imaginary number in preprocessor expression"); + break; + + case CPP_N_INVALID: + /* Error already issued. */ + break; + } + result.high = result.low = 0; + break; + + case CPP_WCHAR: + case CPP_CHAR: + { + cppchar_t cc = cpp_interpret_charconst (pfile, token, + &temp, &unsignedp); + + result.high = 0; + result.low = cc; + /* Sign-extend the result if necessary. */ + if (!unsignedp && (cppchar_signed_t) cc < 0) + { + if (PART_PRECISION > BITS_PER_CPPCHAR_T) + result.low |= ~(~(cpp_num_part) 0 + >> (PART_PRECISION - BITS_PER_CPPCHAR_T)); + result.high = ~(cpp_num_part) 0; + result = num_trim (result, CPP_OPTION (pfile, precision)); + } + } + break; + + case CPP_NAME: + if (token->val.node == pfile->spec_nodes.n_defined) + return parse_defined (pfile); + else if (CPP_OPTION (pfile, cplusplus) + && (token->val.node == pfile->spec_nodes.n_true + || token->val.node == pfile->spec_nodes.n_false)) + { + result.high = 0; + result.low = (token->val.node == pfile->spec_nodes.n_true); + } + else + { + result.high = 0; + result.low = 0; + if (CPP_OPTION (pfile, warn_undef) && !pfile->state.skip_eval) + cpp_error (pfile, CPP_DL_WARNING, "\"%s\" is not defined", + NODE_NAME (token->val.node)); + } + break; + + default: /* CPP_HASH */ + _cpp_test_assertion (pfile, &temp); + result.high = 0; + result.low = temp; + } + + result.unsignedp = !!unsignedp; + return result; +} + +/* Operator precedence and flags table. + +After an operator is returned from the lexer, if it has priority less +than the operator on the top of the stack, we reduce the stack by one +operator and repeat the test. Since equal priorities do not reduce, +this is naturally right-associative. + +We handle left-associative operators by decrementing the priority of +just-lexed operators by one, but retaining the priority of operators +already on the stack. + +The remaining cases are '(' and ')'. We handle '(' by skipping the +reduction phase completely. ')' is given lower priority than +everything else, including '(', effectively forcing a reduction of the +parenthesized expression. If there is a matching '(', the routine +reduce() exits immediately. If the normal exit route sees a ')', then +there cannot have been a matching '(' and an error message is output. + +The parser assumes all shifted operators require a left operand unless +the flag NO_L_OPERAND is set. These semantics are automatic; any +extra semantics need to be handled with operator-specific code. */ + +/* Flags. If CHECK_PROMOTION, we warn if the effective sign of an + operand changes because of integer promotions. */ +#define NO_L_OPERAND (1 << 0) +#define LEFT_ASSOC (1 << 1) +#define CHECK_PROMOTION (1 << 2) + +/* Operator to priority map. Must be in the same order as the first + N entries of enum cpp_ttype. */ +static const struct operator +{ + uchar prio; + uchar flags; +} optab[] = +{ + /* EQ */ {0, 0}, /* Shouldn't happen. */ + /* NOT */ {16, NO_L_OPERAND}, + /* GREATER */ {12, LEFT_ASSOC | CHECK_PROMOTION}, + /* LESS */ {12, LEFT_ASSOC | CHECK_PROMOTION}, + /* PLUS */ {14, LEFT_ASSOC | CHECK_PROMOTION}, + /* MINUS */ {14, LEFT_ASSOC | CHECK_PROMOTION}, + /* MULT */ {15, LEFT_ASSOC | CHECK_PROMOTION}, + /* DIV */ {15, LEFT_ASSOC | CHECK_PROMOTION}, + /* MOD */ {15, LEFT_ASSOC | CHECK_PROMOTION}, + /* AND */ {9, LEFT_ASSOC | CHECK_PROMOTION}, + /* OR */ {7, LEFT_ASSOC | CHECK_PROMOTION}, + /* XOR */ {8, LEFT_ASSOC | CHECK_PROMOTION}, + /* RSHIFT */ {13, LEFT_ASSOC}, + /* LSHIFT */ {13, LEFT_ASSOC}, + + /* MIN */ {10, LEFT_ASSOC | CHECK_PROMOTION}, + /* MAX */ {10, LEFT_ASSOC | CHECK_PROMOTION}, + + /* COMPL */ {16, NO_L_OPERAND}, + /* AND_AND */ {6, LEFT_ASSOC}, + /* OR_OR */ {5, LEFT_ASSOC}, + /* QUERY */ {3, 0}, + /* COLON */ {4, LEFT_ASSOC | CHECK_PROMOTION}, + /* COMMA */ {2, LEFT_ASSOC}, + /* OPEN_PAREN */ {1, NO_L_OPERAND}, + /* CLOSE_PAREN */ {0, 0}, + /* EOF */ {0, 0}, + /* EQ_EQ */ {11, LEFT_ASSOC}, + /* NOT_EQ */ {11, LEFT_ASSOC}, + /* GREATER_EQ */ {12, LEFT_ASSOC | CHECK_PROMOTION}, + /* LESS_EQ */ {12, LEFT_ASSOC | CHECK_PROMOTION}, + /* UPLUS */ {16, NO_L_OPERAND}, + /* UMINUS */ {16, NO_L_OPERAND} +}; + +/* Parse and evaluate a C expression, reading from PFILE. + Returns the truth value of the expression. + + The implementation is an operator precedence parser, i.e. a + bottom-up parser, using a stack for not-yet-reduced tokens. + + The stack base is op_stack, and the current stack pointer is 'top'. + There is a stack element for each operator (only), and the most + recently pushed operator is 'top->op'. An operand (value) is + stored in the 'value' field of the stack element of the operator + that precedes it. */ +bool +_cpp_parse_expr (cpp_reader *pfile) +{ + struct op *top = pfile->op_stack; + unsigned int lex_count; + bool saw_leading_not, want_value = true; + + pfile->state.skip_eval = 0; + + /* Set up detection of #if ! defined(). */ + pfile->mi_ind_cmacro = 0; + saw_leading_not = false; + lex_count = 0; + + /* Lowest priority operator prevents further reductions. */ + top->op = CPP_EOF; + + for (;;) + { + struct op op; + + lex_count++; + op.token = cpp_get_token (pfile); + op.op = op.token->type; + + switch (op.op) + { + /* These tokens convert into values. */ + case CPP_NUMBER: + case CPP_CHAR: + case CPP_WCHAR: + case CPP_NAME: + case CPP_HASH: + if (!want_value) + SYNTAX_ERROR2 ("missing binary operator before token \"%s\"", + cpp_token_as_text (pfile, op.token)); + want_value = false; + top->value = eval_token (pfile, op.token); + continue; + + case CPP_NOT: + saw_leading_not = lex_count == 1; + break; + case CPP_PLUS: + if (want_value) + op.op = CPP_UPLUS; + break; + case CPP_MINUS: + if (want_value) + op.op = CPP_UMINUS; + break; + + default: + if ((int) op.op <= (int) CPP_EQ || (int) op.op >= (int) CPP_PLUS_EQ) + SYNTAX_ERROR2 ("token \"%s\" is not valid in preprocessor expressions", + cpp_token_as_text (pfile, op.token)); + break; + } + + /* Check we have a value or operator as appropriate. */ + if (optab[op.op].flags & NO_L_OPERAND) + { + if (!want_value) + SYNTAX_ERROR2 ("missing binary operator before token \"%s\"", + cpp_token_as_text (pfile, op.token)); + } + else if (want_value) + { + /* Ordering here is subtle and intended to favor the + missing parenthesis diagnostics over alternatives. */ + if (op.op == CPP_CLOSE_PAREN) + { + if (top->op == CPP_OPEN_PAREN) + SYNTAX_ERROR ("void expression between '(' and ')'"); + } + else if (top->op == CPP_EOF) + SYNTAX_ERROR ("#if with no expression"); + if (top->op != CPP_EOF && top->op != CPP_OPEN_PAREN) + SYNTAX_ERROR2 ("operator '%s' has no right operand", + cpp_token_as_text (pfile, top->token)); + } + + top = reduce (pfile, top, op.op); + if (!top) + goto syntax_error; + + if (op.op == CPP_EOF) + break; + + switch (op.op) + { + case CPP_CLOSE_PAREN: + continue; + case CPP_OR_OR: + if (!num_zerop (top->value)) + pfile->state.skip_eval++; + break; + case CPP_AND_AND: + case CPP_QUERY: + if (num_zerop (top->value)) + pfile->state.skip_eval++; + break; + case CPP_COLON: + if (top->op != CPP_QUERY) + SYNTAX_ERROR (" ':' without preceding '?'"); + if (!num_zerop (top[-1].value)) /* Was '?' condition true? */ + pfile->state.skip_eval++; + else + pfile->state.skip_eval--; + default: + break; + } + + want_value = true; + + /* Check for and handle stack overflow. */ + if (++top == pfile->op_limit) + top = _cpp_expand_op_stack (pfile); + + top->op = op.op; + top->token = op.token; + } + + /* The controlling macro expression is only valid if we called lex 3 + times: <!> <defined expression> and <EOF>. push_conditional () + checks that we are at top-of-file. */ + if (pfile->mi_ind_cmacro && !(saw_leading_not && lex_count == 3)) + pfile->mi_ind_cmacro = 0; + + if (top != pfile->op_stack) + { + cpp_error (pfile, CPP_DL_ICE, "unbalanced stack in #if"); + syntax_error: + return false; /* Return false on syntax error. */ + } + + return !num_zerop (top->value); +} + +/* Reduce the operator / value stack if possible, in preparation for + pushing operator OP. Returns NULL on error, otherwise the top of + the stack. */ +static struct op * +reduce (cpp_reader *pfile, struct op *top, enum cpp_ttype op) +{ + unsigned int prio; + + if (top->op <= CPP_EQ || top->op > CPP_LAST_CPP_OP + 2) + { + bad_op: + cpp_error (pfile, CPP_DL_ICE, "impossible operator '%u'", top->op); + return 0; + } + + if (op == CPP_OPEN_PAREN) + return top; + + /* Decrement the priority of left-associative operators to force a + reduction with operators of otherwise equal priority. */ + prio = optab[op].prio - ((optab[op].flags & LEFT_ASSOC) != 0); + while (prio < optab[top->op].prio) + { + if (CPP_OPTION (pfile, warn_num_sign_change) + && optab[top->op].flags & CHECK_PROMOTION) + check_promotion (pfile, top); + + switch (top->op) + { + case CPP_UPLUS: + case CPP_UMINUS: + case CPP_NOT: + case CPP_COMPL: + top[-1].value = num_unary_op (pfile, top->value, top->op); + break; + + case CPP_PLUS: + case CPP_MINUS: + case CPP_RSHIFT: + case CPP_LSHIFT: + case CPP_MIN: + case CPP_MAX: + case CPP_COMMA: + top[-1].value = num_binary_op (pfile, top[-1].value, + top->value, top->op); + break; + + case CPP_GREATER: + case CPP_LESS: + case CPP_GREATER_EQ: + case CPP_LESS_EQ: + top[-1].value + = num_inequality_op (pfile, top[-1].value, top->value, top->op); + break; + + case CPP_EQ_EQ: + case CPP_NOT_EQ: + top[-1].value + = num_equality_op (pfile, top[-1].value, top->value, top->op); + break; + + case CPP_AND: + case CPP_OR: + case CPP_XOR: + top[-1].value + = num_bitwise_op (pfile, top[-1].value, top->value, top->op); + break; + + case CPP_MULT: + top[-1].value = num_mul (pfile, top[-1].value, top->value); + break; + + case CPP_DIV: + case CPP_MOD: + top[-1].value = num_div_op (pfile, top[-1].value, + top->value, top->op); + break; + + case CPP_OR_OR: + top--; + if (!num_zerop (top->value)) + pfile->state.skip_eval--; + top->value.low = (!num_zerop (top->value) + || !num_zerop (top[1].value)); + top->value.high = 0; + top->value.unsignedp = false; + top->value.overflow = false; + continue; + + case CPP_AND_AND: + top--; + if (num_zerop (top->value)) + pfile->state.skip_eval--; + top->value.low = (!num_zerop (top->value) + && !num_zerop (top[1].value)); + top->value.high = 0; + top->value.unsignedp = false; + top->value.overflow = false; + continue; + + case CPP_OPEN_PAREN: + if (op != CPP_CLOSE_PAREN) + { + cpp_error (pfile, CPP_DL_ERROR, "missing ')' in expression"); + return 0; + } + top--; + top->value = top[1].value; + return top; + + case CPP_COLON: + top -= 2; + if (!num_zerop (top->value)) + { + pfile->state.skip_eval--; + top->value = top[1].value; + } + else + top->value = top[2].value; + top->value.unsignedp = (top[1].value.unsignedp + || top[2].value.unsignedp); + continue; + + case CPP_QUERY: + cpp_error (pfile, CPP_DL_ERROR, "'?' without following ':'"); + return 0; + + default: + goto bad_op; + } + + top--; + if (top->value.overflow && !pfile->state.skip_eval) + cpp_error (pfile, CPP_DL_PEDWARN, + "integer overflow in preprocessor expression"); + } + + if (op == CPP_CLOSE_PAREN) + { + cpp_error (pfile, CPP_DL_ERROR, "missing '(' in expression"); + return 0; + } + + return top; +} + +/* Returns the position of the old top of stack after expansion. */ +struct op * +_cpp_expand_op_stack (cpp_reader *pfile) +{ + size_t old_size = (size_t) (pfile->op_limit - pfile->op_stack); + size_t new_size = old_size * 2 + 20; + + pfile->op_stack = xrealloc (pfile->op_stack, new_size * sizeof (struct op)); + pfile->op_limit = pfile->op_stack + new_size; + + return pfile->op_stack + old_size; +} + +/* Emits a warning if the effective sign of either operand of OP + changes because of integer promotions. */ +static void +check_promotion (cpp_reader *pfile, const struct op *op) +{ + if (op->value.unsignedp == op[-1].value.unsignedp) + return; + + if (op->value.unsignedp) + { + if (!num_positive (op[-1].value, CPP_OPTION (pfile, precision))) + cpp_error (pfile, CPP_DL_WARNING, + "the left operand of \"%s\" changes sign when promoted", + cpp_token_as_text (pfile, op->token)); + } + else if (!num_positive (op->value, CPP_OPTION (pfile, precision))) + cpp_error (pfile, CPP_DL_WARNING, + "the right operand of \"%s\" changes sign when promoted", + cpp_token_as_text (pfile, op->token)); +} + +/* Clears the unused high order bits of the number pointed to by PNUM. */ +static cpp_num +num_trim (cpp_num num, size_t precision) +{ + if (precision > PART_PRECISION) + { + precision -= PART_PRECISION; + if (precision < PART_PRECISION) + num.high &= ((cpp_num_part) 1 << precision) - 1; + } + else + { + if (precision < PART_PRECISION) + num.low &= ((cpp_num_part) 1 << precision) - 1; + num.high = 0; + } + + return num; +} + +/* True iff A (presumed signed) >= 0. */ +static bool +num_positive (cpp_num num, size_t precision) +{ + if (precision > PART_PRECISION) + { + precision -= PART_PRECISION; + return (num.high & (cpp_num_part) 1 << (precision - 1)) == 0; + } + + return (num.low & (cpp_num_part) 1 << (precision - 1)) == 0; +} + +/* Sign extend a number, with PRECISION significant bits and all + others assumed clear, to fill out a cpp_num structure. */ +cpp_num +cpp_num_sign_extend (cpp_num num, size_t precision) +{ + if (!num.unsignedp) + { + if (precision > PART_PRECISION) + { + precision -= PART_PRECISION; + if (precision < PART_PRECISION + && (num.high & (cpp_num_part) 1 << (precision - 1))) + num.high |= ~(~(cpp_num_part) 0 >> (PART_PRECISION - precision)); + } + else if (num.low & (cpp_num_part) 1 << (precision - 1)) + { + if (precision < PART_PRECISION) + num.low |= ~(~(cpp_num_part) 0 >> (PART_PRECISION - precision)); + num.high = ~(cpp_num_part) 0; + } + } + + return num; +} + +/* Returns the negative of NUM. */ +static cpp_num +num_negate (cpp_num num, size_t precision) +{ + cpp_num copy; + + copy = num; + num.high = ~num.high; + num.low = ~num.low; + if (++num.low == 0) + num.high++; + num = num_trim (num, precision); + num.overflow = (!num.unsignedp && num_eq (num, copy) && !num_zerop (num)); + + return num; +} + +/* Returns true if A >= B. */ +static bool +num_greater_eq (cpp_num pa, cpp_num pb, size_t precision) +{ + bool unsignedp; + + unsignedp = pa.unsignedp || pb.unsignedp; + + if (!unsignedp) + { + /* Both numbers have signed type. If they are of different + sign, the answer is the sign of A. */ + unsignedp = num_positive (pa, precision); + + if (unsignedp != num_positive (pb, precision)) + return unsignedp; + + /* Otherwise we can do an unsigned comparison. */ + } + + return (pa.high > pb.high) || (pa.high == pb.high && pa.low >= pb.low); +} + +/* Returns LHS OP RHS, where OP is a bit-wise operation. */ +static cpp_num +num_bitwise_op (cpp_reader *pfile ATTRIBUTE_UNUSED, + cpp_num lhs, cpp_num rhs, enum cpp_ttype op) +{ + lhs.overflow = false; + lhs.unsignedp = lhs.unsignedp || rhs.unsignedp; + + /* As excess precision is zeroed, there is no need to num_trim () as + these operations cannot introduce a set bit there. */ + if (op == CPP_AND) + { + lhs.low &= rhs.low; + lhs.high &= rhs.high; + } + else if (op == CPP_OR) + { + lhs.low |= rhs.low; + lhs.high |= rhs.high; + } + else + { + lhs.low ^= rhs.low; + lhs.high ^= rhs.high; + } + + return lhs; +} + +/* Returns LHS OP RHS, where OP is an inequality. */ +static cpp_num +num_inequality_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, + enum cpp_ttype op) +{ + bool gte = num_greater_eq (lhs, rhs, CPP_OPTION (pfile, precision)); + + if (op == CPP_GREATER_EQ) + lhs.low = gte; + else if (op == CPP_LESS) + lhs.low = !gte; + else if (op == CPP_GREATER) + lhs.low = gte && !num_eq (lhs, rhs); + else /* CPP_LESS_EQ. */ + lhs.low = !gte || num_eq (lhs, rhs); + + lhs.high = 0; + lhs.overflow = false; + lhs.unsignedp = false; + return lhs; +} + +/* Returns LHS OP RHS, where OP is == or !=. */ +static cpp_num +num_equality_op (cpp_reader *pfile ATTRIBUTE_UNUSED, + cpp_num lhs, cpp_num rhs, enum cpp_ttype op) +{ + /* Work around a 3.0.4 bug; see PR 6950. */ + bool eq = num_eq (lhs, rhs); + if (op == CPP_NOT_EQ) + eq = !eq; + lhs.low = eq; + lhs.high = 0; + lhs.overflow = false; + lhs.unsignedp = false; + return lhs; +} + +/* Shift NUM, of width PRECISION, right by N bits. */ +static cpp_num +num_rshift (cpp_num num, size_t precision, size_t n) +{ + cpp_num_part sign_mask; + bool x = num_positive (num, precision); + + if (num.unsignedp || x) + sign_mask = 0; + else + sign_mask = ~(cpp_num_part) 0; + + if (n >= precision) + num.high = num.low = sign_mask; + else + { + /* Sign-extend. */ + if (precision < PART_PRECISION) + num.high = sign_mask, num.low |= sign_mask << precision; + else if (precision < 2 * PART_PRECISION) + num.high |= sign_mask << (precision - PART_PRECISION); + + if (n >= PART_PRECISION) + { + n -= PART_PRECISION; + num.low = num.high; + num.high = sign_mask; + } + + if (n) + { + num.low = (num.low >> n) | (num.high << (PART_PRECISION - n)); + num.high = (num.high >> n) | (sign_mask << (PART_PRECISION - n)); + } + } + + num = num_trim (num, precision); + num.overflow = false; + return num; +} + +/* Shift NUM, of width PRECISION, left by N bits. */ +static cpp_num +num_lshift (cpp_num num, size_t precision, size_t n) +{ + if (n >= precision) + { + num.overflow = !num.unsignedp && !num_zerop (num); + num.high = num.low = 0; + } + else + { + cpp_num orig, maybe_orig; + size_t m = n; + + orig = num; + if (m >= PART_PRECISION) + { + m -= PART_PRECISION; + num.high = num.low; + num.low = 0; + } + if (m) + { + num.high = (num.high << m) | (num.low >> (PART_PRECISION - m)); + num.low <<= m; + } + num = num_trim (num, precision); + + if (num.unsignedp) + num.overflow = false; + else + { + maybe_orig = num_rshift (num, precision, n); + num.overflow = !num_eq (orig, maybe_orig); + } + } + + return num; +} + +/* The four unary operators: +, -, ! and ~. */ +static cpp_num +num_unary_op (cpp_reader *pfile, cpp_num num, enum cpp_ttype op) +{ + switch (op) + { + case CPP_UPLUS: + if (CPP_WTRADITIONAL (pfile) && !pfile->state.skip_eval) + cpp_error (pfile, CPP_DL_WARNING, + "traditional C rejects the unary plus operator"); + num.overflow = false; + break; + + case CPP_UMINUS: + num = num_negate (num, CPP_OPTION (pfile, precision)); + break; + + case CPP_COMPL: + num.high = ~num.high; + num.low = ~num.low; + num = num_trim (num, CPP_OPTION (pfile, precision)); + num.overflow = false; + break; + + default: /* case CPP_NOT: */ + num.low = num_zerop (num); + num.high = 0; + num.overflow = false; + num.unsignedp = false; + break; + } + + return num; +} + +/* The various binary operators. */ +static cpp_num +num_binary_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op) +{ + cpp_num result; + size_t precision = CPP_OPTION (pfile, precision); + bool gte; + size_t n; + + switch (op) + { + /* Shifts. */ + case CPP_LSHIFT: + case CPP_RSHIFT: + if (!rhs.unsignedp && !num_positive (rhs, precision)) + { + /* A negative shift is a positive shift the other way. */ + if (op == CPP_LSHIFT) + op = CPP_RSHIFT; + else + op = CPP_LSHIFT; + rhs = num_negate (rhs, precision); + } + if (rhs.high) + n = ~0; /* Maximal. */ + else + n = rhs.low; + if (op == CPP_LSHIFT) + lhs = num_lshift (lhs, precision, n); + else + lhs = num_rshift (lhs, precision, n); + break; + + /* Min / Max. */ + case CPP_MIN: + case CPP_MAX: + { + bool unsignedp = lhs.unsignedp || rhs.unsignedp; + + gte = num_greater_eq (lhs, rhs, precision); + if (op == CPP_MIN) + gte = !gte; + if (!gte) + lhs = rhs; + lhs.unsignedp = unsignedp; + } + break; + + /* Arithmetic. */ + case CPP_MINUS: + rhs = num_negate (rhs, precision); + case CPP_PLUS: + result.low = lhs.low + rhs.low; + result.high = lhs.high + rhs.high; + if (result.low < lhs.low) + result.high++; + result.unsignedp = lhs.unsignedp || rhs.unsignedp; + result.overflow = false; + + result = num_trim (result, precision); + if (!result.unsignedp) + { + bool lhsp = num_positive (lhs, precision); + result.overflow = (lhsp == num_positive (rhs, precision) + && lhsp != num_positive (result, precision)); + } + return result; + + /* Comma. */ + default: /* case CPP_COMMA: */ + if (CPP_PEDANTIC (pfile) && (!CPP_OPTION (pfile, c99) + || !pfile->state.skip_eval)) + cpp_error (pfile, CPP_DL_PEDWARN, + "comma operator in operand of #if"); + lhs = rhs; + break; + } + + return lhs; +} + +/* Multiplies two unsigned cpp_num_parts to give a cpp_num. This + cannot overflow. */ +static cpp_num +num_part_mul (cpp_num_part lhs, cpp_num_part rhs) +{ + cpp_num result; + cpp_num_part middle[2], temp; + + result.low = LOW_PART (lhs) * LOW_PART (rhs); + result.high = HIGH_PART (lhs) * HIGH_PART (rhs); + + middle[0] = LOW_PART (lhs) * HIGH_PART (rhs); + middle[1] = HIGH_PART (lhs) * LOW_PART (rhs); + + temp = result.low; + result.low += LOW_PART (middle[0]) << (PART_PRECISION / 2); + if (result.low < temp) + result.high++; + + temp = result.low; + result.low += LOW_PART (middle[1]) << (PART_PRECISION / 2); + if (result.low < temp) + result.high++; + + result.high += HIGH_PART (middle[0]); + result.high += HIGH_PART (middle[1]); + result.unsignedp = true; + result.overflow = false; + + return result; +} + +/* Multiply two preprocessing numbers. */ +static cpp_num +num_mul (cpp_reader *pfile, cpp_num lhs, cpp_num rhs) +{ + cpp_num result, temp; + bool unsignedp = lhs.unsignedp || rhs.unsignedp; + bool overflow, negate = false; + size_t precision = CPP_OPTION (pfile, precision); + + /* Prepare for unsigned multiplication. */ + if (!unsignedp) + { + if (!num_positive (lhs, precision)) + negate = !negate, lhs = num_negate (lhs, precision); + if (!num_positive (rhs, precision)) + negate = !negate, rhs = num_negate (rhs, precision); + } + + overflow = lhs.high && rhs.high; + result = num_part_mul (lhs.low, rhs.low); + + temp = num_part_mul (lhs.high, rhs.low); + result.high += temp.low; + if (temp.high) + overflow = true; + + temp = num_part_mul (lhs.low, rhs.high); + result.high += temp.low; + if (temp.high) + overflow = true; + + temp.low = result.low, temp.high = result.high; + result = num_trim (result, precision); + if (!num_eq (result, temp)) + overflow = true; + + if (negate) + result = num_negate (result, precision); + + if (unsignedp) + result.overflow = false; + else + result.overflow = overflow || (num_positive (result, precision) ^ !negate + && !num_zerop (result)); + result.unsignedp = unsignedp; + + return result; +} + +/* Divide two preprocessing numbers, returning the answer or the + remainder depending upon OP. */ +static cpp_num +num_div_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op) +{ + cpp_num result, sub; + cpp_num_part mask; + bool unsignedp = lhs.unsignedp || rhs.unsignedp; + bool negate = false, lhs_neg = false; + size_t i, precision = CPP_OPTION (pfile, precision); + + /* Prepare for unsigned division. */ + if (!unsignedp) + { + if (!num_positive (lhs, precision)) + negate = !negate, lhs_neg = true, lhs = num_negate (lhs, precision); + if (!num_positive (rhs, precision)) + negate = !negate, rhs = num_negate (rhs, precision); + } + + /* Find the high bit. */ + if (rhs.high) + { + i = precision - 1; + mask = (cpp_num_part) 1 << (i - PART_PRECISION); + for (; ; i--, mask >>= 1) + if (rhs.high & mask) + break; + } + else if (rhs.low) + { + if (precision > PART_PRECISION) + i = precision - PART_PRECISION - 1; + else + i = precision - 1; + mask = (cpp_num_part) 1 << i; + for (; ; i--, mask >>= 1) + if (rhs.low & mask) + break; + } + else + { + if (!pfile->state.skip_eval) + cpp_error (pfile, CPP_DL_ERROR, "division by zero in #if"); + return lhs; + } + + /* First nonzero bit of RHS is bit I. Do naive division by + shifting the RHS fully left, and subtracting from LHS if LHS is + at least as big, and then repeating but with one less shift. + This is not very efficient, but is easy to understand. */ + + rhs.unsignedp = true; + lhs.unsignedp = true; + i = precision - i - 1; + sub = num_lshift (rhs, precision, i); + + result.high = result.low = 0; + for (;;) + { + if (num_greater_eq (lhs, sub, precision)) + { + lhs = num_binary_op (pfile, lhs, sub, CPP_MINUS); + if (i >= PART_PRECISION) + result.high |= (cpp_num_part) 1 << (i - PART_PRECISION); + else + result.low |= (cpp_num_part) 1 << i; + } + if (i-- == 0) + break; + sub.low = (sub.low >> 1) | (sub.high << (PART_PRECISION - 1)); + sub.high >>= 1; + } + + /* We divide so that the remainder has the sign of the LHS. */ + if (op == CPP_DIV) + { + result.unsignedp = unsignedp; + result.overflow = false; + if (!unsignedp) + { + if (negate) + result = num_negate (result, precision); + result.overflow = num_positive (result, precision) ^ !negate; + } + + return result; + } + + /* CPP_MOD. */ + lhs.unsignedp = unsignedp; + lhs.overflow = false; + if (lhs_neg) + lhs = num_negate (lhs, precision); + + return lhs; +} diff --git a/libcpp/files.c b/libcpp/files.c new file mode 100644 index 00000000000..7d7b271da0e --- /dev/null +++ b/libcpp/files.c @@ -0,0 +1,1560 @@ +/* Part of CPP library. File handling. + Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1998, + 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Written by Per Bothner, 1994. + Based on CCCP program by Paul Rubin, June 1986 + Adapted to ANSI C, Richard Stallman, Jan 1987 + Split out of cpplib.c, Zack Weinberg, Oct 1998 + Reimplemented, Neil Booth, Jul 2003 + +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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "config.h" +#include "system.h" +#include "cpplib.h" +#include "internal.h" +#include "mkdeps.h" +#include "hashtab.h" +#include "md5.h" +#include <dirent.h> + +/* Variable length record files on VMS will have a stat size that includes + record control characters that won't be included in the read size. */ +#ifdef VMS +# define FAB_C_VAR 2 /* variable length records (see Starlet fabdef.h) */ +# define STAT_SIZE_RELIABLE(ST) ((ST).st_fab_rfm != FAB_C_VAR) +#else +# define STAT_SIZE_RELIABLE(ST) true +#endif + +#ifdef __DJGPP__ + /* For DJGPP redirected input is opened in text mode. */ +# define set_stdin_to_binary_mode() \ + if (! isatty (0)) setmode (0, O_BINARY) +#else +# define set_stdin_to_binary_mode() /* Nothing */ +#endif + +/* This structure represents a file searched for by CPP, whether it + exists or not. An instance may be pointed to by more than one + file_hash_entry; at present no reference count is kept. */ +struct _cpp_file +{ + /* Filename as given to #include or command line switch. */ + const char *name; + + /* The full path used to find the file. */ + const char *path; + + /* The full path of the pch file. */ + const char *pchname; + + /* The file's path with the basename stripped. NULL if it hasn't + been calculated yet. */ + const char *dir_name; + + /* Chain through all files. */ + struct _cpp_file *next_file; + + /* The contents of NAME after calling read_file(). */ + const uchar *buffer; + + /* The macro, if any, preventing re-inclusion. */ + const cpp_hashnode *cmacro; + + /* The directory in the search path where FILE was found. Used for + #include_next and determining whether a header is a system + header. */ + cpp_dir *dir; + + /* As filled in by stat(2) for the file. */ + struct stat st; + + /* File descriptor. Invalid if -1, otherwise open. */ + int fd; + + /* Zero if this file was successfully opened and stat()-ed, + otherwise errno obtained from failure. */ + int err_no; + + /* Number of times the file has been stacked for preprocessing. */ + unsigned short stack_count; + + /* If opened with #import or contains #pragma once. */ + bool once_only; + + /* If read() failed before. */ + bool dont_read; + + /* If this file is the main file. */ + bool main_file; + + /* If BUFFER above contains the true contents of the file. */ + bool buffer_valid; + + /* File is a PCH (on return from find_include_file). */ + bool pch; +}; + +/* A singly-linked list for all searches for a given file name, with + its head pointed to by a slot in FILE_HASH. The file name is what + appeared between the quotes in a #include directive; it can be + determined implicitly from the hash table location or explicitly + from FILE->name. + + FILE is a structure containing details about the file that was + found with that search, or details of how the search failed. + + START_DIR is the starting location of the search in the include + chain. The current directories for "" includes are also hashed in + the hash table and therefore unique. Files that are looked up + without using a search path, such as absolute filenames and file + names from the command line share a special starting directory so + they don't cause cache hits with normal include-chain lookups. + + If START_DIR is NULL then the entry is for a directory, not a file, + and the directory is in DIR. Since the starting point in a file + lookup chain is never NULL, this means that simple pointer + comparisons against START_DIR can be made to determine cache hits + in file lookups. + + If a cache lookup fails because of e.g. an extra "./" in the path, + then nothing will break. It is just less efficient as CPP will + have to do more work re-preprocessing the file, and/or comparing + its contents against earlier once-only files. +*/ +struct file_hash_entry +{ + struct file_hash_entry *next; + cpp_dir *start_dir; + union + { + _cpp_file *file; + cpp_dir *dir; + } u; +}; + +static bool open_file (_cpp_file *file); +static bool pch_open_file (cpp_reader *pfile, _cpp_file *file, + bool *invalid_pch); +static bool find_file_in_dir (cpp_reader *pfile, _cpp_file *file, + bool *invalid_pch); +static bool read_file_guts (cpp_reader *pfile, _cpp_file *file); +static bool read_file (cpp_reader *pfile, _cpp_file *file); +static bool should_stack_file (cpp_reader *, _cpp_file *file, bool import); +static struct cpp_dir *search_path_head (cpp_reader *, const char *fname, + int angle_brackets, enum include_type); +static const char *dir_name_of_file (_cpp_file *file); +static void open_file_failed (cpp_reader *pfile, _cpp_file *file); +static struct file_hash_entry *search_cache (struct file_hash_entry *head, + const cpp_dir *start_dir); +static _cpp_file *make_cpp_file (cpp_reader *, cpp_dir *, const char *fname); +static cpp_dir *make_cpp_dir (cpp_reader *, const char *dir_name, int sysp); +static void allocate_file_hash_entries (cpp_reader *pfile); +static struct file_hash_entry *new_file_hash_entry (cpp_reader *pfile); +static int report_missing_guard (void **slot, void *b); +static hashval_t file_hash_hash (const void *p); +static int file_hash_eq (const void *p, const void *q); +static char *read_filename_string (int ch, FILE *f); +static void read_name_map (cpp_dir *dir); +static char *remap_filename (cpp_reader *pfile, _cpp_file *file); +static char *append_file_to_dir (const char *fname, cpp_dir *dir); +static bool validate_pch (cpp_reader *, _cpp_file *file, const char *pchname); +static int pchf_adder (void **slot, void *data); +static int pchf_save_compare (const void *e1, const void *e2); +static int pchf_compare (const void *d_p, const void *e_p); +static bool check_file_against_entries (cpp_reader *, _cpp_file *, bool); + +/* Given a filename in FILE->PATH, with the empty string interpreted + as <stdin>, open it. + + On success FILE contains an open file descriptor and stat + information for the file. On failure the file descriptor is -1 and + the appropriate errno is also stored in FILE. Returns TRUE iff + successful. + + We used to open files in nonblocking mode, but that caused more + problems than it solved. Do take care not to acquire a controlling + terminal by mistake (this can't happen on sane systems, but + paranoia is a virtue). + + Use the three-argument form of open even though we aren't + specifying O_CREAT, to defend against broken system headers. + + O_BINARY tells some runtime libraries (notably DJGPP) not to do + newline translation; we can handle DOS line breaks just fine + ourselves. */ +static bool +open_file (_cpp_file *file) +{ + if (file->path[0] == '\0') + { + file->fd = 0; + set_stdin_to_binary_mode (); + } + else + file->fd = open (file->path, O_RDONLY | O_NOCTTY | O_BINARY, 0666); + + if (file->fd != -1) + { + if (fstat (file->fd, &file->st) == 0) + { + if (!S_ISDIR (file->st.st_mode)) + { + file->err_no = 0; + return true; + } + + /* Ignore a directory and continue the search. The file we're + looking for may be elsewhere in the search path. */ + errno = ENOENT; + } + + close (file->fd); + file->fd = -1; + } + else if (errno == ENOTDIR) + errno = ENOENT; + + file->err_no = errno; + + return false; +} + +/* Temporary PCH intercept of opening a file. Try to find a PCH file + based on FILE->name and FILE->dir, and test those found for + validity using PFILE->cb.valid_pch. Return true iff a valid file is + found. Set *INVALID_PCH if a PCH file is found but wasn't valid. */ + +static bool +pch_open_file (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch) +{ + static const char extension[] = ".gch"; + const char *path = file->path; + size_t len, flen; + char *pchname; + struct stat st; + bool valid = false; + + /* No PCH on <stdin> or if not requested. */ + if (file->name[0] == '\0' || !pfile->cb.valid_pch) + return false; + + flen = strlen (path); + len = flen + sizeof (extension); + pchname = xmalloc (len); + memcpy (pchname, path, flen); + memcpy (pchname + flen, extension, sizeof (extension)); + + if (stat (pchname, &st) == 0) + { + DIR *pchdir; + struct dirent *d; + size_t dlen, plen = len; + + if (!S_ISDIR (st.st_mode)) + valid = validate_pch (pfile, file, pchname); + else if ((pchdir = opendir (pchname)) != NULL) + { + pchname[plen - 1] = '/'; + while ((d = readdir (pchdir)) != NULL) + { + dlen = strlen (d->d_name) + 1; + if ((strcmp (d->d_name, ".") == 0) + || (strcmp (d->d_name, "..") == 0)) + continue; + if (dlen + plen > len) + { + len += dlen + 64; + pchname = xrealloc (pchname, len); + } + memcpy (pchname + plen, d->d_name, dlen); + valid = validate_pch (pfile, file, pchname); + if (valid) + break; + } + closedir (pchdir); + } + if (valid) + file->pch = true; + else + *invalid_pch = true; + } + + if (valid) + file->pchname = pchname; + else + free (pchname); + + return valid; +} + +/* Try to open the path FILE->name appended to FILE->dir. This is + where remap and PCH intercept the file lookup process. Return true + if the file was found, whether or not the open was successful. + Set *INVALID_PCH to true if a PCH file is found but wasn't valid. */ + +static bool +find_file_in_dir (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch) +{ + char *path; + + if (CPP_OPTION (pfile, remap) && (path = remap_filename (pfile, file))) + ; + else + if (file->dir->construct) + path = file->dir->construct (file->name, file->dir); + else + path = append_file_to_dir (file->name, file->dir); + + if (path) + { + file->path = path; + if (pch_open_file (pfile, file, invalid_pch)) + return true; + + if (open_file (file)) + return true; + + if (file->err_no != ENOENT) + { + open_file_failed (pfile, file); + return true; + } + + free (path); + file->path = file->name; + } + else + { + file->err_no = ENOENT; + file->path = NULL; + } + + return false; +} + +/* Return tue iff the missing_header callback found the given HEADER. */ +static bool +search_path_exhausted (cpp_reader *pfile, const char *header, _cpp_file *file) +{ + missing_header_cb func = pfile->cb.missing_header; + + /* When the regular search path doesn't work, try context dependent + headers search paths. */ + if (func + && file->dir == NULL) + { + if ((file->path = func (pfile, header, &file->dir)) != NULL) + { + if (open_file (file)) + return true; + free ((void *)file->path); + } + file->path = file->name; + } + + return false; +} + +bool +_cpp_find_failed (_cpp_file *file) +{ + return file->err_no != 0; +} + +/* Given a filename FNAME search for such a file in the include path + starting from START_DIR. If FNAME is the empty string it is + interpreted as STDIN if START_DIR is PFILE->no_search_path. + + If the file is not found in the file cache fall back to the O/S and + add the result to our cache. + + If the file was not found in the filesystem, or there was an error + opening it, then ERR_NO is nonzero and FD is -1. If the file was + found, then ERR_NO is zero and FD could be -1 or an open file + descriptor. FD can be -1 if the file was found in the cache and + had previously been closed. To open it again pass the return value + to open_file(). +*/ +_cpp_file * +_cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, bool fake) +{ + struct file_hash_entry *entry, **hash_slot; + _cpp_file *file; + bool invalid_pch = false; + + /* Ensure we get no confusion between cached files and directories. */ + if (start_dir == NULL) + cpp_error (pfile, CPP_DL_ICE, "NULL directory in find_file"); + + hash_slot = (struct file_hash_entry **) + htab_find_slot_with_hash (pfile->file_hash, fname, + htab_hash_string (fname), + INSERT); + + /* First check the cache before we resort to memory allocation. */ + entry = search_cache (*hash_slot, start_dir); + if (entry) + return entry->u.file; + + file = make_cpp_file (pfile, start_dir, fname); + + /* Try each path in the include chain. */ + for (; !fake ;) + { + if (find_file_in_dir (pfile, file, &invalid_pch)) + break; + + file->dir = file->dir->next; + if (file->dir == NULL) + { + if (search_path_exhausted (pfile, fname, file)) + return file; + + open_file_failed (pfile, file); + if (invalid_pch) + { + cpp_error (pfile, CPP_DL_ERROR, + "one or more PCH files were found, but they were invalid"); + if (!cpp_get_options (pfile)->warn_invalid_pch) + cpp_error (pfile, CPP_DL_ERROR, + "use -Winvalid-pch for more information"); + } + break; + } + + /* Only check the cache for the starting location (done above) + and the quote and bracket chain heads because there are no + other possible starting points for searches. */ + if (file->dir != pfile->bracket_include + && file->dir != pfile->quote_include) + continue; + + entry = search_cache (*hash_slot, file->dir); + if (entry) + break; + } + + if (entry) + { + /* Cache for START_DIR too, sharing the _cpp_file structure. */ + free ((char *) file->name); + free (file); + file = entry->u.file; + } + else + { + /* This is a new file; put it in the list. */ + file->next_file = pfile->all_files; + pfile->all_files = file; + } + + /* Store this new result in the hash table. */ + entry = new_file_hash_entry (pfile); + entry->next = *hash_slot; + entry->start_dir = start_dir; + entry->u.file = file; + *hash_slot = entry; + + return file; +} + +/* Read a file into FILE->buffer, returning true on success. + + If FILE->fd is something weird, like a block device, we don't want + to read it at all. Don't even try to figure out what something is, + except for plain files and block devices, since there is no + reliable portable way of doing this. + + FIXME: Flush file cache and try again if we run out of memory. */ +static bool +read_file_guts (cpp_reader *pfile, _cpp_file *file) +{ + ssize_t size, total, count; + uchar *buf; + bool regular; + + if (S_ISBLK (file->st.st_mode)) + { + cpp_error (pfile, CPP_DL_ERROR, "%s is a block device", file->path); + return false; + } + + regular = S_ISREG (file->st.st_mode); + if (regular) + { + /* off_t might have a wider range than ssize_t - in other words, + the max size of a file might be bigger than the address + space. We can't handle a file that large. (Anyone with + a single source file bigger than 2GB needs to rethink + their coding style.) Some systems (e.g. AIX 4.1) define + SSIZE_MAX to be much smaller than the actual range of the + type. Use INTTYPE_MAXIMUM unconditionally to ensure this + does not bite us. */ + if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) + { + cpp_error (pfile, CPP_DL_ERROR, "%s is too large", file->path); + return false; + } + + size = file->st.st_size; + } + else + /* 8 kilobytes is a sensible starting size. It ought to be bigger + than the kernel pipe buffer, and it's definitely bigger than + the majority of C source files. */ + size = 8 * 1024; + + buf = xmalloc (size + 1); + total = 0; + while ((count = read (file->fd, buf + total, size - total)) > 0) + { + total += count; + + if (total == size) + { + if (regular) + break; + size *= 2; + buf = xrealloc (buf, size + 1); + } + } + + if (count < 0) + { + cpp_errno (pfile, CPP_DL_ERROR, file->path); + return false; + } + + if (regular && total != size && STAT_SIZE_RELIABLE (file->st)) + cpp_error (pfile, CPP_DL_WARNING, + "%s is shorter than expected", file->path); + + file->buffer = _cpp_convert_input (pfile, CPP_OPTION (pfile, input_charset), + buf, size, total, &file->st.st_size); + file->buffer_valid = true; + + return true; +} + +/* Convenience wrapper around read_file_guts that opens the file if + necessary and closes the file descriptor after reading. FILE must + have been passed through find_file() at some stage. */ +static bool +read_file (cpp_reader *pfile, _cpp_file *file) +{ + /* If we already have its contents in memory, succeed immediately. */ + if (file->buffer_valid) + return true; + + /* If an earlier read failed for some reason don't try again. */ + if (file->dont_read || file->err_no) + return false; + + if (file->fd == -1 && !open_file (file)) + { + open_file_failed (pfile, file); + return false; + } + + file->dont_read = !read_file_guts (pfile, file); + close (file->fd); + file->fd = -1; + + return !file->dont_read; +} + +/* Returns TRUE if FILE's contents have been successfully placed in + FILE->buffer and the file should be stacked, otherwise false. */ +static bool +should_stack_file (cpp_reader *pfile, _cpp_file *file, bool import) +{ + _cpp_file *f; + + /* Skip once-only files. */ + if (file->once_only) + return false; + + /* We must mark the file once-only if #import now, before header + guard checks. Otherwise, undefining the header guard might + cause the file to be re-stacked. */ + if (import) + { + _cpp_mark_file_once_only (pfile, file); + + /* Don't stack files that have been stacked before. */ + if (file->stack_count) + return false; + } + + /* Skip if the file had a header guard and the macro is defined. + PCH relies on this appearing before the PCH handler below. */ + if (file->cmacro && file->cmacro->type == NT_MACRO) + return false; + + /* Handle PCH files immediately; don't stack them. */ + if (file->pch) + { + pfile->cb.read_pch (pfile, file->path, file->fd, file->pchname); + close (file->fd); + file->fd = -1; + return false; + } + + if (!read_file (pfile, file)) + return false; + + /* Check the file against the PCH file. This is done before + checking against files we've already seen, since it may save on + I/O. */ + if (check_file_against_entries (pfile, file, import)) + { + /* If this isn't a #import, but yet we can't include the file, + that means that it was #import-ed in the PCH file, + so we can never include it again. */ + if (! import) + _cpp_mark_file_once_only (pfile, file); + return false; + } + + /* Now we've read the file's contents, we can stack it if there + are no once-only files. */ + if (!pfile->seen_once_only) + return true; + + /* We may have read the file under a different name. Look + for likely candidates and compare file contents to be sure. */ + for (f = pfile->all_files; f; f = f->next_file) + { + if (f == file) + continue; + + if ((import || f->once_only) + && f->err_no == 0 + && f->st.st_mtime == file->st.st_mtime + && f->st.st_size == file->st.st_size + && read_file (pfile, f) + /* Size might have changed in read_file(). */ + && f->st.st_size == file->st.st_size + && !memcmp (f->buffer, file->buffer, f->st.st_size)) + break; + } + + return f == NULL; +} + +/* Place the file referenced by FILE into a new buffer on the buffer + stack if possible. IMPORT is true if this stacking attempt is + because of a #import directive. Returns true if a buffer is + stacked. */ +bool +_cpp_stack_file (cpp_reader *pfile, _cpp_file *file, bool import) +{ + cpp_buffer *buffer; + int sysp; + + if (!should_stack_file (pfile, file, import)) + return false; + + if (pfile->buffer == NULL || file->dir == NULL) + sysp = 0; + else + sysp = MAX (pfile->buffer->sysp, file->dir->sysp); + + /* Add the file to the dependencies on its first inclusion. */ + if (CPP_OPTION (pfile, deps.style) > !!sysp && !file->stack_count) + { + if (!file->main_file || !CPP_OPTION (pfile, deps.ignore_main_file)) + deps_add_dep (pfile->deps, file->path); + } + + /* Clear buffer_valid since _cpp_clean_line messes it up. */ + file->buffer_valid = false; + file->stack_count++; + + /* Stack the buffer. */ + buffer = cpp_push_buffer (pfile, file->buffer, file->st.st_size, + CPP_OPTION (pfile, preprocessed)); + buffer->file = file; + buffer->sysp = sysp; + + /* Initialize controlling macro state. */ + pfile->mi_valid = true; + pfile->mi_cmacro = 0; + + /* Generate the call back. */ + _cpp_do_file_change (pfile, LC_ENTER, file->path, 1, sysp); + + return true; +} + +/* Mark FILE to be included once only. */ +void +_cpp_mark_file_once_only (cpp_reader *pfile, _cpp_file *file) +{ + pfile->seen_once_only = true; + file->once_only = true; +} + +/* Return the directory from which searching for FNAME should start, + considering the directive TYPE and ANGLE_BRACKETS. If there is + nothing left in the path, returns NULL. */ +static struct cpp_dir * +search_path_head (cpp_reader *pfile, const char *fname, int angle_brackets, + enum include_type type) +{ + cpp_dir *dir; + _cpp_file *file; + + if (IS_ABSOLUTE_PATH (fname)) + return &pfile->no_search_path; + + /* pfile->buffer is NULL when processing an -include command-line flag. */ + file = pfile->buffer == NULL ? pfile->main_file : pfile->buffer->file; + + /* For #include_next, skip in the search path past the dir in which + the current file was found, but if it was found via an absolute + path use the normal search logic. */ + if (type == IT_INCLUDE_NEXT && file->dir) + dir = file->dir->next; + else if (angle_brackets) + dir = pfile->bracket_include; + else if (type == IT_CMDLINE) + /* -include and -imacros use the #include "" chain with the + preprocessor's cwd prepended. */ + return make_cpp_dir (pfile, "./", false); + else if (pfile->quote_ignores_source_dir) + dir = pfile->quote_include; + else + return make_cpp_dir (pfile, dir_name_of_file (file), + pfile->buffer ? pfile->buffer->sysp : 0); + + if (dir == NULL) + cpp_error (pfile, CPP_DL_ERROR, + "no include path in which to search for %s", fname); + + return dir; +} + +/* Strip the basename from the file's path. It ends with a slash if + of nonzero length. Note that this procedure also works for + <stdin>, which is represented by the empty string. */ +static const char * +dir_name_of_file (_cpp_file *file) +{ + if (!file->dir_name) + { + size_t len = lbasename (file->path) - file->path; + char *dir_name = xmalloc (len + 1); + + memcpy (dir_name, file->path, len); + dir_name[len] = '\0'; + file->dir_name = dir_name; + } + + return file->dir_name; +} + +/* Handles #include-family directives (distinguished by TYPE), + including HEADER, and the command line -imacros and -include. + Returns true if a buffer was stacked. */ +bool +_cpp_stack_include (cpp_reader *pfile, const char *fname, int angle_brackets, + enum include_type type) +{ + struct cpp_dir *dir; + _cpp_file *file; + + dir = search_path_head (pfile, fname, angle_brackets, type); + if (!dir) + return false; + + file = _cpp_find_file (pfile, fname, dir, false); + + /* Compensate for the increment in linemap_add. In the case of a + normal #include, we're currently at the start of the line + *following* the #include. A separate source_location for this + location makes no sense (until we do the LC_LEAVE), and + complicates LAST_SOURCE_LINE_LOCATION. This does not apply if we + found a PCH file (in which case linemap_add is not called) or we + were included from the command-line. */ + if (! file->pch && file->err_no == 0 && type != IT_CMDLINE) + pfile->line_table->highest_location--; + + return _cpp_stack_file (pfile, file, type == IT_IMPORT); +} + +/* Could not open FILE. The complication is dependency output. */ +static void +open_file_failed (cpp_reader *pfile, _cpp_file *file) +{ + int sysp = pfile->line_table->highest_line > 1 && pfile->buffer ? pfile->buffer->sysp : 0; + bool print_dep = CPP_OPTION (pfile, deps.style) > !!sysp; + + errno = file->err_no; + if (print_dep && CPP_OPTION (pfile, deps.missing_files) && errno == ENOENT) + deps_add_dep (pfile->deps, file->name); + else + { + /* If we are outputting dependencies but not for this file then + don't error because we can still produce correct output. */ + if (CPP_OPTION (pfile, deps.style) && ! print_dep) + cpp_errno (pfile, CPP_DL_WARNING, file->path); + else + cpp_errno (pfile, CPP_DL_ERROR, file->path); + } +} + +/* Search in the chain beginning at HEAD for a file whose search path + started at START_DIR != NULL. */ +static struct file_hash_entry * +search_cache (struct file_hash_entry *head, const cpp_dir *start_dir) +{ + while (head && head->start_dir != start_dir) + head = head->next; + + return head; +} + +/* Allocate a new _cpp_file structure. */ +static _cpp_file * +make_cpp_file (cpp_reader *pfile, cpp_dir *dir, const char *fname) +{ + _cpp_file *file; + + file = xcalloc (1, sizeof (_cpp_file)); + file->main_file = !pfile->buffer; + file->fd = -1; + file->dir = dir; + file->name = xstrdup (fname); + + return file; +} + +/* A hash of directory names. The directory names are the path names + of files which contain a #include "", the included file name is + appended to this directories. + + To avoid duplicate entries we follow the convention that all + non-empty directory names should end in a '/'. DIR_NAME must be + stored in permanently allocated memory. */ +static cpp_dir * +make_cpp_dir (cpp_reader *pfile, const char *dir_name, int sysp) +{ + struct file_hash_entry *entry, **hash_slot; + cpp_dir *dir; + + hash_slot = (struct file_hash_entry **) + htab_find_slot_with_hash (pfile->file_hash, dir_name, + htab_hash_string (dir_name), + INSERT); + + /* Have we already hashed this directory? */ + for (entry = *hash_slot; entry; entry = entry->next) + if (entry->start_dir == NULL) + return entry->u.dir; + + dir = xcalloc (1, sizeof (cpp_dir)); + dir->next = pfile->quote_include; + dir->name = (char *) dir_name; + dir->len = strlen (dir_name); + dir->sysp = sysp; + dir->construct = 0; + + /* Store this new result in the hash table. */ + entry = new_file_hash_entry (pfile); + entry->next = *hash_slot; + entry->start_dir = NULL; + entry->u.dir = dir; + *hash_slot = entry; + + return dir; +} + +/* Create a new block of memory for file hash entries. */ +static void +allocate_file_hash_entries (cpp_reader *pfile) +{ + pfile->file_hash_entries_used = 0; + pfile->file_hash_entries_allocated = 127; + pfile->file_hash_entries = xmalloc + (pfile->file_hash_entries_allocated * sizeof (struct file_hash_entry)); +} + +/* Return a new file hash entry. */ +static struct file_hash_entry * +new_file_hash_entry (cpp_reader *pfile) +{ + if (pfile->file_hash_entries_used == pfile->file_hash_entries_allocated) + allocate_file_hash_entries (pfile); + + return &pfile->file_hash_entries[pfile->file_hash_entries_used++]; +} + +/* Returns TRUE if a file FNAME has ever been successfully opened. + This routine is not intended to correctly handle filenames aliased + by links or redundant . or .. traversals etc. */ +bool +cpp_included (cpp_reader *pfile, const char *fname) +{ + struct file_hash_entry *entry; + + entry = htab_find_with_hash (pfile->file_hash, fname, + htab_hash_string (fname)); + + while (entry && (entry->start_dir == NULL || entry->u.file->err_no)) + entry = entry->next; + + return entry != NULL; +} + +/* Calculate the hash value of a file hash entry P. */ + +static hashval_t +file_hash_hash (const void *p) +{ + struct file_hash_entry *entry = (struct file_hash_entry *) p; + const char *hname; + if (entry->start_dir) + hname = entry->u.file->name; + else + hname = entry->u.dir->name; + + return htab_hash_string (hname); +} + +/* Compare a string Q against a file hash entry P. */ +static int +file_hash_eq (const void *p, const void *q) +{ + struct file_hash_entry *entry = (struct file_hash_entry *) p; + const char *fname = (const char *) q; + const char *hname; + + if (entry->start_dir) + hname = entry->u.file->name; + else + hname = entry->u.dir->name; + + return strcmp (hname, fname) == 0; +} + +/* Initialize everything in this source file. */ +void +_cpp_init_files (cpp_reader *pfile) +{ + pfile->file_hash = htab_create_alloc (127, file_hash_hash, file_hash_eq, + NULL, xcalloc, free); + allocate_file_hash_entries (pfile); +} + +/* Finalize everything in this source file. */ +void +_cpp_cleanup_files (cpp_reader *pfile) +{ + htab_delete (pfile->file_hash); +} + +/* Enter a file name in the hash for the sake of cpp_included. */ +void +_cpp_fake_include (cpp_reader *pfile, const char *fname) +{ + _cpp_find_file (pfile, fname, pfile->buffer->file->dir, true); +} + +/* Not everyone who wants to set system-header-ness on a buffer can + see the details of a buffer. This is an exported interface because + fix-header needs it. */ +void +cpp_make_system_header (cpp_reader *pfile, int syshdr, int externc) +{ + int flags = 0; + const struct line_maps *line_table = pfile->line_table; + const struct line_map *map = &line_table->maps[line_table->used-1]; + + /* 1 = system header, 2 = system header to be treated as C. */ + if (syshdr) + flags = 1 + (externc != 0); + pfile->buffer->sysp = flags; + _cpp_do_file_change (pfile, LC_RENAME, map->to_file, + SOURCE_LINE (map, pfile->line_table->highest_line), flags); +} + +/* Allow the client to change the current file. Used by the front end + to achieve pseudo-file names like <built-in>. + If REASON is LC_LEAVE, then NEW_NAME must be NULL. */ +void +cpp_change_file (cpp_reader *pfile, enum lc_reason reason, + const char *new_name) +{ + _cpp_do_file_change (pfile, reason, new_name, 1, 0); +} + +/* Callback function for htab_traverse. */ +static int +report_missing_guard (void **slot, void *b) +{ + struct file_hash_entry *entry = (struct file_hash_entry *) *slot; + int *bannerp = (int *) b; + + /* Skip directories. */ + if (entry->start_dir != NULL) + { + _cpp_file *file = entry->u.file; + + /* We don't want MI guard advice for the main file. */ + if (file->cmacro == NULL && file->stack_count == 1 && !file->main_file) + { + if (*bannerp == 0) + { + fputs (_("Multiple include guards may be useful for:\n"), + stderr); + *bannerp = 1; + } + + fputs (entry->u.file->path, stderr); + putc ('\n', stderr); + } + } + + return 0; +} + +/* Report on all files that might benefit from a multiple include guard. + Triggered by -H. */ +void +_cpp_report_missing_guards (cpp_reader *pfile) +{ + int banner = 0; + + htab_traverse (pfile->file_hash, report_missing_guard, &banner); +} + +/* Locate HEADER, and determine whether it is newer than the current + file. If it cannot be located or dated, return -1, if it is + newer, return 1, otherwise 0. */ +int +_cpp_compare_file_date (cpp_reader *pfile, const char *fname, + int angle_brackets) +{ + _cpp_file *file; + struct cpp_dir *dir; + + dir = search_path_head (pfile, fname, angle_brackets, IT_INCLUDE); + if (!dir) + return -1; + + file = _cpp_find_file (pfile, fname, dir, false); + if (file->err_no) + return -1; + + if (file->fd != -1) + { + close (file->fd); + file->fd = -1; + } + + return file->st.st_mtime > pfile->buffer->file->st.st_mtime; +} + +/* Pushes the given file onto the buffer stack. Returns nonzero if + successful. */ +bool +cpp_push_include (cpp_reader *pfile, const char *fname) +{ + return _cpp_stack_include (pfile, fname, false, IT_CMDLINE); +} + +/* Do appropriate cleanup when a file INC's buffer is popped off the + input stack. */ +void +_cpp_pop_file_buffer (cpp_reader *pfile, _cpp_file *file) +{ + /* Record the inclusion-preventing macro, which could be NULL + meaning no controlling macro. */ + if (pfile->mi_valid && file->cmacro == NULL) + file->cmacro = pfile->mi_cmacro; + + /* Invalidate control macros in the #including file. */ + pfile->mi_valid = false; + + if (file->buffer) + { + free ((void *) file->buffer); + file->buffer = NULL; + } +} + +/* Set the include chain for "" to QUOTE, for <> to BRACKET. If + QUOTE_IGNORES_SOURCE_DIR, then "" includes do not look in the + directory of the including file. + + If BRACKET does not lie in the QUOTE chain, it is set to QUOTE. */ +void +cpp_set_include_chains (cpp_reader *pfile, cpp_dir *quote, cpp_dir *bracket, + int quote_ignores_source_dir) +{ + pfile->quote_include = quote; + pfile->bracket_include = quote; + pfile->quote_ignores_source_dir = quote_ignores_source_dir; + + for (; quote; quote = quote->next) + { + quote->name_map = NULL; + quote->len = strlen (quote->name); + if (quote == bracket) + pfile->bracket_include = bracket; + } +} + +/* Append the file name to the directory to create the path, but don't + turn / into // or // into ///; // may be a namespace escape. */ +static char * +append_file_to_dir (const char *fname, cpp_dir *dir) +{ + size_t dlen, flen; + char *path; + + dlen = dir->len; + flen = strlen (fname); + path = xmalloc (dlen + 1 + flen + 1); + memcpy (path, dir->name, dlen); + if (dlen && path[dlen - 1] != '/') + path[dlen++] = '/'; + memcpy (&path[dlen], fname, flen + 1); + + return path; +} + +/* Read a space delimited string of unlimited length from a stdio + file F. */ +static char * +read_filename_string (int ch, FILE *f) +{ + char *alloc, *set; + int len; + + len = 20; + set = alloc = xmalloc (len + 1); + if (! is_space (ch)) + { + *set++ = ch; + while ((ch = getc (f)) != EOF && ! is_space (ch)) + { + if (set - alloc == len) + { + len *= 2; + alloc = xrealloc (alloc, len + 1); + set = alloc + len / 2; + } + *set++ = ch; + } + } + *set = '\0'; + ungetc (ch, f); + return alloc; +} + +/* Read the file name map file for DIR. */ +static void +read_name_map (cpp_dir *dir) +{ + static const char FILE_NAME_MAP_FILE[] = "header.gcc"; + char *name; + FILE *f; + size_t len, count = 0, room = 9; + + len = dir->len; + name = alloca (len + sizeof (FILE_NAME_MAP_FILE) + 1); + memcpy (name, dir->name, len); + if (len && name[len - 1] != '/') + name[len++] = '/'; + strcpy (name + len, FILE_NAME_MAP_FILE); + f = fopen (name, "r"); + + dir->name_map = xmalloc (room * sizeof (char *)); + + /* Silently return NULL if we cannot open. */ + if (f) + { + int ch; + + while ((ch = getc (f)) != EOF) + { + char *to; + + if (is_space (ch)) + continue; + + if (count + 2 > room) + { + room += 8; + dir->name_map = xrealloc (dir->name_map, room * sizeof (char *)); + } + + dir->name_map[count] = read_filename_string (ch, f); + while ((ch = getc (f)) != EOF && is_hspace (ch)) + ; + + to = read_filename_string (ch, f); + if (IS_ABSOLUTE_PATH (to)) + dir->name_map[count + 1] = to; + else + { + dir->name_map[count + 1] = append_file_to_dir (to, dir); + free (to); + } + + count += 2; + while ((ch = getc (f)) != '\n') + if (ch == EOF) + break; + } + + fclose (f); + } + + /* Terminate the list of maps. */ + dir->name_map[count] = NULL; +} + +/* Remap a FILE's name based on the file_name_map, if any, for + FILE->dir. If the file name has any directory separators, + recursively check those directories too. */ +static char * +remap_filename (cpp_reader *pfile, _cpp_file *file) +{ + const char *fname, *p; + char *new_dir; + cpp_dir *dir; + size_t index, len; + + dir = file->dir; + fname = file->name; + + for (;;) + { + if (!dir->name_map) + read_name_map (dir); + + for (index = 0; dir->name_map[index]; index += 2) + if (!strcmp (dir->name_map[index], fname)) + return xstrdup (dir->name_map[index + 1]); + + p = strchr (fname, '/'); + if (!p || p == fname) + return NULL; + + len = dir->len + (p - fname + 1); + new_dir = xmalloc (len + 1); + memcpy (new_dir, dir->name, dir->len); + memcpy (new_dir + dir->len, fname, p - fname + 1); + new_dir[len] = '\0'; + + dir = make_cpp_dir (pfile, new_dir, dir->sysp); + fname = p + 1; + } +} + +/* Returns true if PCHNAME is a valid PCH file for FILE. */ +static bool +validate_pch (cpp_reader *pfile, _cpp_file *file, const char *pchname) +{ + const char *saved_path = file->path; + bool valid = false; + + file->path = pchname; + if (open_file (file)) + { + valid = 1 & pfile->cb.valid_pch (pfile, pchname, file->fd); + + if (!valid) + { + close (file->fd); + file->fd = -1; + } + + if (CPP_OPTION (pfile, print_include_names)) + { + unsigned int i; + for (i = 1; i < pfile->line_table->depth; i++) + putc ('.', stderr); + fprintf (stderr, "%c %s\n", + valid ? '!' : 'x', pchname); + } + } + + file->path = saved_path; + return valid; +} + +/* Get the path associated with the _cpp_file F. The path includes + the base name from the include directive and the directory it was + found in via the search path. */ + +const char * +cpp_get_path (struct _cpp_file *f) +{ + return f->path; +} + +/* Get the directory associated with the _cpp_file F. */ + +cpp_dir * +cpp_get_dir (struct _cpp_file *f) +{ + return f->dir; +} + +/* Get the cpp_buffer currently associated with the cpp_reader + PFILE. */ + +cpp_buffer * +cpp_get_buffer (cpp_reader *pfile) +{ + return pfile->buffer; +} + +/* Get the _cpp_file associated with the cpp_buffer B. */ + +_cpp_file * +cpp_get_file (cpp_buffer *b) +{ + return b->file; +} + +/* Get the previous cpp_buffer given a cpp_buffer B. The previous + buffer is the buffer that included the given buffer. */ + +cpp_buffer * +cpp_get_prev (cpp_buffer *b) +{ + return b->prev; +} + +/* This data structure holds the list of header files that were seen + while the PCH was being built. The 'entries' field is kept sorted + in memcmp() order; yes, this means that on little-endian systems, + it's sorted initially by the least-significant byte of 'size', but + that's OK. The code does rely on having entries with the same size + next to each other. */ + +struct pchf_data { + /* Number of pchf_entry structures. */ + size_t count; + + /* Are there any values with once_only set? + This is used as an optimisation, it means we don't have to search + the structure if we're processing a regular #include. */ + bool have_once_only; + + struct pchf_entry { + /* The size of this file. This is used to save running a MD5 checksum + if the sizes don't match. */ + off_t size; + /* The MD5 checksum of this file. */ + unsigned char sum[16]; + /* Is this file to be included only once? */ + bool once_only; + } entries[1]; +}; + +static struct pchf_data *pchf; + +/* Data for pchf_addr. */ +struct pchf_adder_info +{ + cpp_reader *pfile; + struct pchf_data *d; +}; + +/* A hash traversal function to add entries into DATA->D. */ + +static int +pchf_adder (void **slot, void *data) +{ + struct file_hash_entry *h = (struct file_hash_entry *) *slot; + struct pchf_adder_info *i = (struct pchf_adder_info *) data; + + if (h->start_dir != NULL && h->u.file->stack_count != 0) + { + struct pchf_data *d = i->d; + _cpp_file *f = h->u.file; + size_t count = d->count++; + + /* This should probably never happen, since if a read error occurred + the PCH file shouldn't be written... */ + if (f->dont_read || f->err_no) + return 1; + + d->entries[count].once_only = f->once_only; + /* |= is avoided in the next line because of an HP C compiler bug */ + d->have_once_only = d->have_once_only | f->once_only; + if (f->buffer_valid) + md5_buffer ((const char *)f->buffer, + f->st.st_size, d->entries[count].sum); + else + { + FILE *ff; + int oldfd = f->fd; + + if (!open_file (f)) + { + open_file_failed (i->pfile, f); + return 0; + } + ff = fdopen (f->fd, "rb"); + md5_stream (ff, d->entries[count].sum); + fclose (ff); + f->fd = oldfd; + } + d->entries[count].size = f->st.st_size; + } + return 1; +} + +/* A qsort ordering function for pchf_entry structures. */ + +static int +pchf_save_compare (const void *e1, const void *e2) +{ + return memcmp (e1, e2, sizeof (struct pchf_entry)); +} + +/* Create and write to F a pchf_data structure. */ + +bool +_cpp_save_file_entries (cpp_reader *pfile, FILE *f) +{ + size_t count = 0; + struct pchf_data *result; + size_t result_size; + struct pchf_adder_info pai; + + count = htab_elements (pfile->file_hash); + result_size = (sizeof (struct pchf_data) + + sizeof (struct pchf_entry) * (count - 1)); + result = xcalloc (result_size, 1); + + result->count = 0; + result->have_once_only = false; + + pai.pfile = pfile; + pai.d = result; + htab_traverse (pfile->file_hash, pchf_adder, &pai); + + result_size = (sizeof (struct pchf_data) + + sizeof (struct pchf_entry) * (result->count - 1)); + + qsort (result->entries, result->count, sizeof (struct pchf_entry), + pchf_save_compare); + + return fwrite (result, result_size, 1, f) == 1; +} + +/* Read the pchf_data structure from F. */ + +bool +_cpp_read_file_entries (cpp_reader *pfile ATTRIBUTE_UNUSED, FILE *f) +{ + struct pchf_data d; + + if (fread (&d, sizeof (struct pchf_data) - sizeof (struct pchf_entry), 1, f) + != 1) + return false; + + pchf = xmalloc (sizeof (struct pchf_data) + + sizeof (struct pchf_entry) * (d.count - 1)); + memcpy (pchf, &d, sizeof (struct pchf_data) - sizeof (struct pchf_entry)); + if (fread (pchf->entries, sizeof (struct pchf_entry), d.count, f) + != d.count) + return false; + return true; +} + +/* The parameters for pchf_compare. */ + +struct pchf_compare_data +{ + /* The size of the file we're looking for. */ + off_t size; + + /* The MD5 checksum of the file, if it's been computed. */ + unsigned char sum[16]; + + /* Is SUM valid? */ + bool sum_computed; + + /* Do we need to worry about entries that don't have ONCE_ONLY set? */ + bool check_included; + + /* The file that we're searching for. */ + _cpp_file *f; +}; + +/* bsearch comparison function; look for D_P in E_P. */ + +static int +pchf_compare (const void *d_p, const void *e_p) +{ + const struct pchf_entry *e = (const struct pchf_entry *)e_p; + struct pchf_compare_data *d = (struct pchf_compare_data *)d_p; + int result; + + result = memcmp (&d->size, &e->size, sizeof (off_t)); + if (result != 0) + return result; + + if (! d->sum_computed) + { + _cpp_file *const f = d->f; + + md5_buffer ((const char *)f->buffer, f->st.st_size, d->sum); + d->sum_computed = true; + } + + result = memcmp (d->sum, e->sum, 16); + if (result != 0) + return result; + + if (d->check_included || e->once_only) + return 0; + else + return 1; +} + +/* Check that F is not in a list read from a PCH file (if any). + Assumes that f->buffer_valid is true. Return TRUE if the file + should not be read. */ + +static bool +check_file_against_entries (cpp_reader *pfile ATTRIBUTE_UNUSED, + _cpp_file *f, + bool check_included) +{ + struct pchf_compare_data d; + + if (pchf == NULL + || (! check_included && ! pchf->have_once_only)) + return false; + + d.size = f->st.st_size; + d.sum_computed = false; + d.f = f; + d.check_included = check_included; + return bsearch (&d, pchf->entries, pchf->count, sizeof (struct pchf_entry), + pchf_compare) != NULL; +} diff --git a/libcpp/identifiers.c b/libcpp/identifiers.c new file mode 100644 index 00000000000..a6b35b4e57c --- /dev/null +++ b/libcpp/identifiers.c @@ -0,0 +1,118 @@ +/* Hash tables for the CPP library. + Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1998, + 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Written by Per Bothner, 1994. + Based on CCCP program by Paul Rubin, June 1986 + Adapted to ANSI C, Richard Stallman, Jan 1987 + +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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + In other words, you are welcome to use, share and improve this program. + You are forbidden to forbid anyone else to use, share and improve + what you give them. Help stamp out software-hoarding! */ + +#include "config.h" +#include "system.h" +#include "cpplib.h" +#include "internal.h" + +static cpp_hashnode *alloc_node (hash_table *); + +/* Return an identifier node for hashtable.c. Used by cpplib except + when integrated with the C front ends. */ +static cpp_hashnode * +alloc_node (hash_table *table) +{ + cpp_hashnode *node; + + node = obstack_alloc (&table->pfile->hash_ob, sizeof (cpp_hashnode)); + memset (node, 0, sizeof (cpp_hashnode)); + return node; +} + +/* Set up the identifier hash table. Use TABLE if non-null, otherwise + create our own. */ +void +_cpp_init_hashtable (cpp_reader *pfile, hash_table *table) +{ + struct spec_nodes *s; + + if (table == NULL) + { + pfile->our_hashtable = 1; + table = ht_create (13); /* 8K (=2^13) entries. */ + table->alloc_node = (hashnode (*) (hash_table *)) alloc_node; + + _obstack_begin (&pfile->hash_ob, 0, 0, + (void *(*) (long)) xmalloc, + (void (*) (void *)) free); + } + + table->pfile = pfile; + pfile->hash_table = table; + + /* Now we can initialize things that use the hash table. */ + _cpp_init_directives (pfile); + _cpp_init_internal_pragmas (pfile); + + s = &pfile->spec_nodes; + s->n_defined = cpp_lookup (pfile, DSC("defined")); + s->n_true = cpp_lookup (pfile, DSC("true")); + s->n_false = cpp_lookup (pfile, DSC("false")); + s->n__VA_ARGS__ = cpp_lookup (pfile, DSC("__VA_ARGS__")); + s->n__VA_ARGS__->flags |= NODE_DIAGNOSTIC; +} + +/* Tear down the identifier hash table. */ +void +_cpp_destroy_hashtable (cpp_reader *pfile) +{ + if (pfile->our_hashtable) + { + ht_destroy (pfile->hash_table); + obstack_free (&pfile->hash_ob, 0); + } +} + +/* Returns the hash entry for the STR of length LEN, creating one + if necessary. */ +cpp_hashnode * +cpp_lookup (cpp_reader *pfile, const unsigned char *str, unsigned int len) +{ + /* ht_lookup cannot return NULL. */ + return CPP_HASHNODE (ht_lookup (pfile->hash_table, str, len, HT_ALLOC)); +} + +/* Determine whether the str STR, of length LEN, is a defined macro. */ +int +cpp_defined (cpp_reader *pfile, const unsigned char *str, int len) +{ + cpp_hashnode *node; + + node = CPP_HASHNODE (ht_lookup (pfile->hash_table, str, len, HT_NO_INSERT)); + + /* If it's of type NT_MACRO, it cannot be poisoned. */ + return node && node->type == NT_MACRO; +} + +/* For all nodes in the hashtable, callback CB with parameters PFILE, + the node, and V. */ +void +cpp_forall_identifiers (cpp_reader *pfile, cpp_cb cb, void *v) +{ + /* We don't need a proxy since the hash table's identifier comes + first in cpp_hashnode. */ + ht_forall (pfile->hash_table, (ht_cb) cb, v); +} diff --git a/libcpp/include/ChangeLog b/libcpp/include/ChangeLog new file mode 100644 index 00000000000..f6c47fa6daf --- /dev/null +++ b/libcpp/include/ChangeLog @@ -0,0 +1,7 @@ +2004-05-23 Paolo Bonzini <bonzini@gnu.org> + + * cpplib.h: Moved from gcc. Change header guard name. + * line-map.h: Moved from gcc. Change header guard name. + * mkdeps.h: Moved from gcc. Change header guard name. + * symtab.h: Moved from gcc/hashtable.h. Change header + guard name. diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h new file mode 100644 index 00000000000..7f2010483d3 --- /dev/null +++ b/libcpp/include/cpplib.h @@ -0,0 +1,773 @@ +/* Definitions for CPP library. + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Free Software Foundation, Inc. + Written by Per Bothner, 1994-95. + +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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + In other words, you are welcome to use, share and improve this program. + You are forbidden to forbid anyone else to use, share and improve + what you give them. Help stamp out software-hoarding! */ +#ifndef LIBCPP_CPPLIB_H +#define LIBCPP_CPPLIB_H + +#include <sys/types.h> +#include "symtab.h" +#include "line-map.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct cpp_reader cpp_reader; +typedef struct cpp_buffer cpp_buffer; +typedef struct cpp_options cpp_options; +typedef struct cpp_token cpp_token; +typedef struct cpp_string cpp_string; +typedef struct cpp_hashnode cpp_hashnode; +typedef struct cpp_macro cpp_macro; +typedef struct cpp_callbacks cpp_callbacks; +typedef struct cpp_dir cpp_dir; + +struct answer; +struct _cpp_file; + +/* The first three groups, apart from '=', can appear in preprocessor + expressions (+= and -= are used to indicate unary + and - resp.). + This allows a lookup table to be implemented in _cpp_parse_expr. + + The first group, to CPP_LAST_EQ, can be immediately followed by an + '='. The lexer needs operators ending in '=', like ">>=", to be in + the same order as their counterparts without the '=', like ">>". */ + +/* Positions in the table. */ +#define CPP_LAST_EQ CPP_MAX +#define CPP_FIRST_DIGRAPH CPP_HASH +#define CPP_LAST_PUNCTUATOR CPP_DOT_STAR +#define CPP_LAST_CPP_OP CPP_LESS_EQ + +#define TTYPE_TABLE \ + OP(CPP_EQ = 0, "=") \ + OP(CPP_NOT, "!") \ + OP(CPP_GREATER, ">") /* compare */ \ + OP(CPP_LESS, "<") \ + OP(CPP_PLUS, "+") /* math */ \ + OP(CPP_MINUS, "-") \ + OP(CPP_MULT, "*") \ + OP(CPP_DIV, "/") \ + OP(CPP_MOD, "%") \ + OP(CPP_AND, "&") /* bit ops */ \ + OP(CPP_OR, "|") \ + OP(CPP_XOR, "^") \ + OP(CPP_RSHIFT, ">>") \ + OP(CPP_LSHIFT, "<<") \ + OP(CPP_MIN, "<?") /* extension */ \ + OP(CPP_MAX, ">?") \ +\ + OP(CPP_COMPL, "~") \ + OP(CPP_AND_AND, "&&") /* logical */ \ + OP(CPP_OR_OR, "||") \ + OP(CPP_QUERY, "?") \ + OP(CPP_COLON, ":") \ + OP(CPP_COMMA, ",") /* grouping */ \ + OP(CPP_OPEN_PAREN, "(") \ + OP(CPP_CLOSE_PAREN, ")") \ + TK(CPP_EOF, SPELL_NONE) \ + OP(CPP_EQ_EQ, "==") /* compare */ \ + OP(CPP_NOT_EQ, "!=") \ + OP(CPP_GREATER_EQ, ">=") \ + OP(CPP_LESS_EQ, "<=") \ +\ + /* These two are unary + / - in preprocessor expressions. */ \ + OP(CPP_PLUS_EQ, "+=") /* math */ \ + OP(CPP_MINUS_EQ, "-=") \ +\ + OP(CPP_MULT_EQ, "*=") \ + OP(CPP_DIV_EQ, "/=") \ + OP(CPP_MOD_EQ, "%=") \ + OP(CPP_AND_EQ, "&=") /* bit ops */ \ + OP(CPP_OR_EQ, "|=") \ + OP(CPP_XOR_EQ, "^=") \ + OP(CPP_RSHIFT_EQ, ">>=") \ + OP(CPP_LSHIFT_EQ, "<<=") \ + OP(CPP_MIN_EQ, "<?=") /* extension */ \ + OP(CPP_MAX_EQ, ">?=") \ + /* Digraphs together, beginning with CPP_FIRST_DIGRAPH. */ \ + OP(CPP_HASH, "#") /* digraphs */ \ + OP(CPP_PASTE, "##") \ + OP(CPP_OPEN_SQUARE, "[") \ + OP(CPP_CLOSE_SQUARE, "]") \ + OP(CPP_OPEN_BRACE, "{") \ + OP(CPP_CLOSE_BRACE, "}") \ + /* The remainder of the punctuation. Order is not significant. */ \ + OP(CPP_SEMICOLON, ";") /* structure */ \ + OP(CPP_ELLIPSIS, "...") \ + OP(CPP_PLUS_PLUS, "++") /* increment */ \ + OP(CPP_MINUS_MINUS, "--") \ + OP(CPP_DEREF, "->") /* accessors */ \ + OP(CPP_DOT, ".") \ + OP(CPP_SCOPE, "::") \ + OP(CPP_DEREF_STAR, "->*") \ + OP(CPP_DOT_STAR, ".*") \ + OP(CPP_ATSIGN, "@") /* used in Objective-C */ \ +\ + TK(CPP_NAME, SPELL_IDENT) /* word */ \ + TK(CPP_AT_NAME, SPELL_IDENT) /* @word - Objective-C */ \ + TK(CPP_NUMBER, SPELL_LITERAL) /* 34_be+ta */ \ +\ + TK(CPP_CHAR, SPELL_LITERAL) /* 'char' */ \ + TK(CPP_WCHAR, SPELL_LITERAL) /* L'char' */ \ + TK(CPP_OTHER, SPELL_LITERAL) /* stray punctuation */ \ +\ + TK(CPP_STRING, SPELL_LITERAL) /* "string" */ \ + TK(CPP_WSTRING, SPELL_LITERAL) /* L"string" */ \ + TK(CPP_OBJC_STRING, SPELL_LITERAL) /* @"string" - Objective-C */ \ + TK(CPP_HEADER_NAME, SPELL_LITERAL) /* <stdio.h> in #include */ \ +\ + TK(CPP_COMMENT, SPELL_LITERAL) /* Only if output comments. */ \ + /* SPELL_LITERAL happens to DTRT. */ \ + TK(CPP_MACRO_ARG, SPELL_NONE) /* Macro argument. */ \ + TK(CPP_PADDING, SPELL_NONE) /* Whitespace for cpp0. */ + +#define OP(e, s) e, +#define TK(e, s) e, +enum cpp_ttype +{ + TTYPE_TABLE + N_TTYPES +}; +#undef OP +#undef TK + +/* C language kind, used when calling cpp_reader_init. */ +enum c_lang {CLK_GNUC89 = 0, CLK_GNUC99, CLK_STDC89, CLK_STDC94, CLK_STDC99, + CLK_GNUCXX, CLK_CXX98, CLK_ASM}; + +/* Payload of a NUMBER, STRING, CHAR or COMMENT token. */ +struct cpp_string +{ + unsigned int len; + const unsigned char *text; +}; + +/* Flags for the cpp_token structure. */ +#define PREV_WHITE (1 << 0) /* If whitespace before this token. */ +#define DIGRAPH (1 << 1) /* If it was a digraph. */ +#define STRINGIFY_ARG (1 << 2) /* If macro argument to be stringified. */ +#define PASTE_LEFT (1 << 3) /* If on LHS of a ## operator. */ +#define NAMED_OP (1 << 4) /* C++ named operators. */ +#define NO_EXPAND (1 << 5) /* Do not macro-expand this token. */ +#define BOL (1 << 6) /* Token at beginning of line. */ + +/* A preprocessing token. This has been carefully packed and should + occupy 16 bytes on 32-bit hosts and 24 bytes on 64-bit hosts. */ +struct cpp_token +{ + source_location src_loc; /* Location of first char of token. */ + ENUM_BITFIELD(cpp_ttype) type : CHAR_BIT; /* token type */ + unsigned char flags; /* flags - see above */ + + union + { + cpp_hashnode *node; /* An identifier. */ + const cpp_token *source; /* Inherit padding from this token. */ + struct cpp_string str; /* A string, or number. */ + unsigned int arg_no; /* Argument no. for a CPP_MACRO_ARG. */ + } val; +}; + +/* A type wide enough to hold any multibyte source character. + cpplib's character constant interpreter requires an unsigned type. + Also, a typedef for the signed equivalent. + The width of this type is capped at 32 bits; there do exist targets + where wchar_t is 64 bits, but only in a non-default mode, and there + would be no meaningful interpretation for a wchar_t value greater + than 2^32 anyway -- the widest wide-character encoding around is + ISO 10646, which stops at 2^31. */ +#if CHAR_BIT * SIZEOF_INT >= 32 +# define CPPCHAR_SIGNED_T int +#elif CHAR_BIT * SIZEOF_LONG >= 32 +# define CPPCHAR_SIGNED_T long +#else +# error "Cannot find a least-32-bit signed integer type" +#endif +typedef unsigned CPPCHAR_SIGNED_T cppchar_t; +typedef CPPCHAR_SIGNED_T cppchar_signed_t; + +/* This structure is nested inside struct cpp_reader, and + carries all the options visible to the command line. */ +struct cpp_options +{ + /* Characters between tab stops. */ + unsigned int tabstop; + + /* The language we're preprocessing. */ + enum c_lang lang; + + /* Nonzero means use extra default include directories for C++. */ + unsigned char cplusplus; + + /* Nonzero means handle cplusplus style comments. */ + unsigned char cplusplus_comments; + + /* Nonzero means define __OBJC__, treat @ as a special token, and + use the OBJC[PLUS]_INCLUDE_PATH environment variable. */ + unsigned char objc; + + /* Nonzero means don't copy comments into the output file. */ + unsigned char discard_comments; + + /* Nonzero means don't copy comments into the output file during + macro expansion. */ + unsigned char discard_comments_in_macro_exp; + + /* Nonzero means process the ISO trigraph sequences. */ + unsigned char trigraphs; + + /* Nonzero means process the ISO digraph sequences. */ + unsigned char digraphs; + + /* Nonzero means to allow hexadecimal floats and LL suffixes. */ + unsigned char extended_numbers; + + /* Nonzero means print names of header files (-H). */ + unsigned char print_include_names; + + /* Nonzero means cpp_pedwarn causes a hard error. */ + unsigned char pedantic_errors; + + /* Nonzero means don't print warning messages. */ + unsigned char inhibit_warnings; + + /* Nonzero means complain about deprecated features. */ + unsigned char warn_deprecated; + + /* Nonzero means don't suppress warnings from system headers. */ + unsigned char warn_system_headers; + + /* Nonzero means don't print error messages. Has no option to + select it, but can be set by a user of cpplib (e.g. fix-header). */ + unsigned char inhibit_errors; + + /* Nonzero means warn if slash-star appears in a comment. */ + unsigned char warn_comments; + + /* Nonzero means warn if a user-supplied include directory does not + exist. */ + unsigned char warn_missing_include_dirs; + + /* Nonzero means warn if there are any trigraphs. */ + unsigned char warn_trigraphs; + + /* Nonzero means warn about multicharacter charconsts. */ + unsigned char warn_multichar; + + /* Nonzero means warn about various incompatibilities with + traditional C. */ + unsigned char warn_traditional; + + /* Nonzero means warn about long long numeric constants. */ + unsigned char warn_long_long; + + /* Nonzero means warn about text after an #endif (or #else). */ + unsigned char warn_endif_labels; + + /* Nonzero means warn about implicit sign changes owing to integer + promotions. */ + unsigned char warn_num_sign_change; + + /* Zero means don't warn about __VA_ARGS__ usage in c89 pedantic mode. + Presumably the usage is protected by the appropriate #ifdef. */ + unsigned char warn_variadic_macros; + + /* Nonzero means turn warnings into errors. */ + unsigned char warnings_are_errors; + + /* Nonzero means we should look for header.gcc files that remap file + names. */ + unsigned char remap; + + /* Zero means dollar signs are punctuation. */ + unsigned char dollars_in_ident; + + /* True if we should warn about dollars in identifiers or numbers + for this translation unit. */ + unsigned char warn_dollars; + + /* Nonzero means warn if undefined identifiers are evaluated in an #if. */ + unsigned char warn_undef; + + /* Nonzero means warn of unused macros from the main file. */ + unsigned char warn_unused_macros; + + /* Nonzero for the 1999 C Standard, including corrigenda and amendments. */ + unsigned char c99; + + /* Nonzero if we are conforming to a specific C or C++ standard. */ + unsigned char std; + + /* Nonzero means give all the error messages the ANSI standard requires. */ + unsigned char pedantic; + + /* Nonzero means we're looking at already preprocessed code, so don't + bother trying to do macro expansion and whatnot. */ + unsigned char preprocessed; + + /* Print column number in error messages. */ + unsigned char show_column; + + /* Nonzero means handle C++ alternate operator names. */ + unsigned char operator_names; + + /* True for traditional preprocessing. */ + unsigned char traditional; + + /* Holds the name of the target (execution) character set. */ + const char *narrow_charset; + + /* Holds the name of the target wide character set. */ + const char *wide_charset; + + /* Holds the name of the input character set. */ + const char *input_charset; + + /* True to warn about precompiled header files we couldn't use. */ + bool warn_invalid_pch; + + /* True if dependencies should be restored from a precompiled header. */ + bool restore_pch_deps; + + /* Dependency generation. */ + struct + { + /* Style of header dependencies to generate. */ + enum {DEPS_NONE = 0, DEPS_USER, DEPS_SYSTEM } style; + + /* Assume missing files are generated files. */ + bool missing_files; + + /* Generate phony targets for each dependency apart from the first + one. */ + bool phony_targets; + + /* If true, no dependency is generated on the main file. */ + bool ignore_main_file; + } deps; + + /* Target-specific features set by the front end or client. */ + + /* Precision for target CPP arithmetic, target characters, target + ints and target wide characters, respectively. */ + size_t precision, char_precision, int_precision, wchar_precision; + + /* True means chars (wide chars) are unsigned. */ + bool unsigned_char, unsigned_wchar; + + /* True if the most significant byte in a word has the lowest + address in memory. */ + bool bytes_big_endian; + + /* Nonzero means __STDC__ should have the value 0 in system headers. */ + unsigned char stdc_0_in_system_headers; +}; + +/* Callback for header lookup for HEADER, which is the name of a + source file. It is used as a method of last resort to find headers + that are not otherwise found during the normal include processing. + The return value is the malloced name of a header to try and open, + if any, or NULL otherwise. This callback is called only if the + header is otherwise unfound. */ +typedef const char *(*missing_header_cb)(cpp_reader *, const char *header, cpp_dir **); + +/* Call backs to cpplib client. */ +struct cpp_callbacks +{ + /* Called when a new line of preprocessed output is started. */ + void (*line_change) (cpp_reader *, const cpp_token *, int); + + /* Called when switching to/from a new file. + The line_map is for the new file. It is NULL if there is no new file. + (In C this happens when done with <built-in>+<command line> and also + when done with a main file.) This can be used for resource cleanup. */ + void (*file_change) (cpp_reader *, const struct line_map *); + + void (*dir_change) (cpp_reader *, const char *); + void (*include) (cpp_reader *, unsigned int, const unsigned char *, + const char *, int); + void (*define) (cpp_reader *, unsigned int, cpp_hashnode *); + void (*undef) (cpp_reader *, unsigned int, cpp_hashnode *); + void (*ident) (cpp_reader *, unsigned int, const cpp_string *); + void (*def_pragma) (cpp_reader *, unsigned int); + int (*valid_pch) (cpp_reader *, const char *, int); + void (*read_pch) (cpp_reader *, const char *, int, const char *); + missing_header_cb missing_header; +}; + +/* Chain of directories to look for include files in. */ +struct cpp_dir +{ + /* NULL-terminated singly-linked list. */ + struct cpp_dir *next; + + /* NAME of the directory, NUL-terminated. */ + char *name; + unsigned int len; + + /* One if a system header, two if a system header that has extern + "C" guards for C++. */ + unsigned char sysp; + + /* Mapping of file names for this directory for MS-DOS and related + platforms. A NULL-terminated array of (from, to) pairs. */ + const char **name_map; + + /* Routine to construct pathname, given the search path name and the + HEADER we are trying to find, return a constructed pathname to + try and open. If this is NULL, the constructed pathname is as + constructed by append_file_to_dir. */ + char *(*construct) (const char *header, cpp_dir *dir); + + /* The C front end uses these to recognize duplicated + directories in the search path. */ + ino_t ino; + dev_t dev; + + /* Is this a user-supplied directory? */ + bool user_supplied_p; +}; + +/* Name under which this program was invoked. */ +extern const char *progname; + +/* The structure of a node in the hash table. The hash table has + entries for all identifiers: either macros defined by #define + commands (type NT_MACRO), assertions created with #assert + (NT_ASSERTION), or neither of the above (NT_VOID). Builtin macros + like __LINE__ are flagged NODE_BUILTIN. Poisoned identifiers are + flagged NODE_POISONED. NODE_OPERATOR (C++ only) indicates an + identifier that behaves like an operator such as "xor". + NODE_DIAGNOSTIC is for speed in lex_token: it indicates a + diagnostic may be required for this node. Currently this only + applies to __VA_ARGS__ and poisoned identifiers. */ + +/* Hash node flags. */ +#define NODE_OPERATOR (1 << 0) /* C++ named operator. */ +#define NODE_POISONED (1 << 1) /* Poisoned identifier. */ +#define NODE_BUILTIN (1 << 2) /* Builtin macro. */ +#define NODE_DIAGNOSTIC (1 << 3) /* Possible diagnostic when lexed. */ +#define NODE_WARN (1 << 4) /* Warn if redefined or undefined. */ +#define NODE_DISABLED (1 << 5) /* A disabled macro. */ +#define NODE_MACRO_ARG (1 << 6) /* Used during #define processing. */ + +/* Different flavors of hash node. */ +enum node_type +{ + NT_VOID = 0, /* No definition yet. */ + NT_MACRO, /* A macro of some form. */ + NT_ASSERTION /* Predicate for #assert. */ +}; + +/* Different flavors of builtin macro. _Pragma is an operator, but we + handle it with the builtin code for efficiency reasons. */ +enum builtin_type +{ + BT_SPECLINE = 0, /* `__LINE__' */ + BT_DATE, /* `__DATE__' */ + BT_FILE, /* `__FILE__' */ + BT_BASE_FILE, /* `__BASE_FILE__' */ + BT_INCLUDE_LEVEL, /* `__INCLUDE_LEVEL__' */ + BT_TIME, /* `__TIME__' */ + BT_STDC, /* `__STDC__' */ + BT_PRAGMA /* `_Pragma' operator */ +}; + +#define CPP_HASHNODE(HNODE) ((cpp_hashnode *) (HNODE)) +#define HT_NODE(NODE) ((ht_identifier *) (NODE)) +#define NODE_LEN(NODE) HT_LEN (&(NODE)->ident) +#define NODE_NAME(NODE) HT_STR (&(NODE)->ident) + +/* The common part of an identifier node shared amongst all 3 C front + ends. Also used to store CPP identifiers, which are a superset of + identifiers in the grammatical sense. */ +struct cpp_hashnode GTY(()) +{ + struct ht_identifier ident; + unsigned int is_directive : 1; + unsigned int directive_index : 7; /* If is_directive, + then index into directive table. + Otherwise, a NODE_OPERATOR. */ + unsigned char rid_code; /* Rid code - for front ends. */ + ENUM_BITFIELD(node_type) type : 8; /* CPP node type. */ + unsigned char flags; /* CPP flags. */ + + union _cpp_hashnode_value + { + /* If a macro. */ + cpp_macro * GTY((skip)) macro; + /* Answers to an assertion. */ + struct answer * GTY ((skip)) answers; + /* Code for a builtin macro. */ + enum builtin_type GTY ((tag ("1"))) builtin; + /* Macro argument index. */ + unsigned short GTY ((tag ("0"))) arg_index; + } GTY ((desc ("0"))) value; +}; + +/* Call this first to get a handle to pass to other functions. + + If you want cpplib to manage its own hashtable, pass in a NULL + pointer. Otherwise you should pass in an initialized hash table + that cpplib will share; this technique is used by the C front + ends. */ +extern cpp_reader *cpp_create_reader (enum c_lang, struct ht *, + struct line_maps *); + +/* Call this to change the selected language standard (e.g. because of + command line options). */ +extern void cpp_set_lang (cpp_reader *, enum c_lang); + +/* Add a dependency TARGET. Quote it for "make" if QUOTE. Can be + called any number of times before cpp_read_main_file(). If no + targets have been added before cpp_read_main_file(), then the + default target is used. */ +extern void cpp_add_dependency_target (cpp_reader *, const char *, int); + +/* Set the include paths. */ +extern void cpp_set_include_chains (cpp_reader *, cpp_dir *, cpp_dir *, int); + +/* Call these to get pointers to the options and callback structures + for a given reader. These pointers are good until you call + cpp_finish on that reader. You can either edit the callbacks + through the pointer returned from cpp_get_callbacks, or set them + with cpp_set_callbacks. */ +extern cpp_options *cpp_get_options (cpp_reader *); +extern cpp_callbacks *cpp_get_callbacks (cpp_reader *); +extern void cpp_set_callbacks (cpp_reader *, cpp_callbacks *); + +/* This function reads the file, but does not start preprocessing. It + returns the name of the original file; this is the same as the + input file, except for preprocessed input. This will generate at + least one file change callback, and possibly a line change callback + too. If there was an error opening the file, it returns NULL. */ +extern const char *cpp_read_main_file (cpp_reader *, const char *); + +/* Set up built-ins like __FILE__. */ +extern void cpp_init_builtins (cpp_reader *, int); + +/* This is called after options have been parsed, and partially + processed. */ +extern void cpp_post_options (cpp_reader *); + +/* Set up translation to the target character set. */ +extern void cpp_init_iconv (cpp_reader *); + +/* Call this to finish preprocessing. If you requested dependency + generation, pass an open stream to write the information to, + otherwise NULL. It is your responsibility to close the stream. + + Returns cpp_errors (pfile). */ +extern int cpp_finish (cpp_reader *, FILE *deps_stream); + +/* Call this to release the handle at the end of preprocessing. Any + use of the handle after this function returns is invalid. Returns + cpp_errors (pfile). */ +extern void cpp_destroy (cpp_reader *); + +/* Error count. */ +extern unsigned int cpp_errors (cpp_reader *); + +extern unsigned int cpp_token_len (const cpp_token *); +extern unsigned char *cpp_token_as_text (cpp_reader *, const cpp_token *); +extern unsigned char *cpp_spell_token (cpp_reader *, const cpp_token *, + unsigned char *); +extern void cpp_register_pragma (cpp_reader *, const char *, const char *, + void (*) (cpp_reader *)); +extern int cpp_avoid_paste (cpp_reader *, const cpp_token *, + const cpp_token *); +extern const cpp_token *cpp_get_token (cpp_reader *); +extern const unsigned char *cpp_macro_definition (cpp_reader *, + const cpp_hashnode *); +extern void _cpp_backup_tokens (cpp_reader *, unsigned int); + +/* Evaluate a CPP_CHAR or CPP_WCHAR token. */ +extern cppchar_t cpp_interpret_charconst (cpp_reader *, const cpp_token *, + unsigned int *, int *); +/* Evaluate a vector of CPP_STRING or CPP_WSTRING tokens. */ +extern bool cpp_interpret_string (cpp_reader *, + const cpp_string *, size_t, + cpp_string *, bool); +extern bool cpp_interpret_string_notranslate (cpp_reader *, + const cpp_string *, size_t, + cpp_string *, bool); + +/* Used to register macros and assertions, perhaps from the command line. + The text is the same as the command line argument. */ +extern void cpp_define (cpp_reader *, const char *); +extern void cpp_assert (cpp_reader *, const char *); +extern void cpp_undef (cpp_reader *, const char *); +extern void cpp_unassert (cpp_reader *, const char *); + +/* Undefine all macros and assertions. */ +extern void cpp_undef_all (cpp_reader *); + +extern cpp_buffer *cpp_push_buffer (cpp_reader *, const unsigned char *, + size_t, int); +extern int cpp_defined (cpp_reader *, const unsigned char *, int); + +/* A preprocessing number. Code assumes that any unused high bits of + the double integer are set to zero. */ +typedef unsigned HOST_WIDE_INT cpp_num_part; +typedef struct cpp_num cpp_num; +struct cpp_num +{ + cpp_num_part high; + cpp_num_part low; + bool unsignedp; /* True if value should be treated as unsigned. */ + bool overflow; /* True if the most recent calculation overflowed. */ +}; + +/* cpplib provides two interfaces for interpretation of preprocessing + numbers. + + cpp_classify_number categorizes numeric constants according to + their field (integer, floating point, or invalid), radix (decimal, + octal, hexadecimal), and type suffixes. */ + +#define CPP_N_CATEGORY 0x000F +#define CPP_N_INVALID 0x0000 +#define CPP_N_INTEGER 0x0001 +#define CPP_N_FLOATING 0x0002 + +#define CPP_N_WIDTH 0x00F0 +#define CPP_N_SMALL 0x0010 /* int, float. */ +#define CPP_N_MEDIUM 0x0020 /* long, double. */ +#define CPP_N_LARGE 0x0040 /* long long, long double. */ + +#define CPP_N_RADIX 0x0F00 +#define CPP_N_DECIMAL 0x0100 +#define CPP_N_HEX 0x0200 +#define CPP_N_OCTAL 0x0400 + +#define CPP_N_UNSIGNED 0x1000 /* Properties. */ +#define CPP_N_IMAGINARY 0x2000 + +/* Classify a CPP_NUMBER token. The return value is a combination of + the flags from the above sets. */ +extern unsigned cpp_classify_number (cpp_reader *, const cpp_token *); + +/* Evaluate a token classified as category CPP_N_INTEGER. */ +extern cpp_num cpp_interpret_integer (cpp_reader *, const cpp_token *, + unsigned int type); + +/* Sign extend a number, with PRECISION significant bits and all + others assumed clear, to fill out a cpp_num structure. */ +cpp_num cpp_num_sign_extend (cpp_num, size_t); + +/* Diagnostic levels. To get a diagnostic without associating a + position in the translation unit with it, use cpp_error_with_line + with a line number of zero. */ + +/* Warning, an error with -Werror. */ +#define CPP_DL_WARNING 0x00 +/* Same as CPP_DL_WARNING, except it is not suppressed in system headers. */ +#define CPP_DL_WARNING_SYSHDR 0x01 +/* Warning, an error with -pedantic-errors or -Werror. */ +#define CPP_DL_PEDWARN 0x02 +/* An error. */ +#define CPP_DL_ERROR 0x03 +/* An internal consistency check failed. Prints "internal error: ", + otherwise the same as CPP_DL_ERROR. */ +#define CPP_DL_ICE 0x04 +/* Extracts a diagnostic level from an int. */ +#define CPP_DL_EXTRACT(l) (l & 0xf) +/* Nonzero if a diagnostic level is one of the warnings. */ +#define CPP_DL_WARNING_P(l) (CPP_DL_EXTRACT (l) >= CPP_DL_WARNING \ + && CPP_DL_EXTRACT (l) <= CPP_DL_PEDWARN) + +/* N.B. The error-message-printer prototypes have not been nicely + formatted because exgettext needs to see 'msgid' on the same line + as the name of the function in order to work properly. Only the + string argument gets a name in an effort to keep the lines from + getting ridiculously oversized. */ + +/* Output a diagnostic of some kind. */ +extern void cpp_error (cpp_reader *, int, const char *msgid, ...) + ATTRIBUTE_PRINTF_3; + +/* Output a diagnostic with "MSGID: " preceding the + error string of errno. No location is printed. */ +extern void cpp_errno (cpp_reader *, int, const char *msgid); + +/* Same as cpp_error, except additionally specifies a position as a + (translation unit) physical line and physical column. If the line is + zero, then no location is printed. */ +extern void cpp_error_with_line (cpp_reader *, int, source_location, unsigned, + const char *msgid, ...) ATTRIBUTE_PRINTF_5; + +/* In cpplex.c */ +extern int cpp_ideq (const cpp_token *, const char *); +extern void cpp_output_line (cpp_reader *, FILE *); +extern void cpp_output_token (const cpp_token *, FILE *); +extern const char *cpp_type2name (enum cpp_ttype); +/* Returns the value of an escape sequence, truncated to the correct + target precision. PSTR points to the input pointer, which is just + after the backslash. LIMIT is how much text we have. WIDE is true + if the escape sequence is part of a wide character constant or + string literal. Handles all relevant diagnostics. */ +extern cppchar_t cpp_parse_escape (cpp_reader *, const unsigned char ** pstr, + const unsigned char *limit, int wide); + +/* In cpphash.c */ + +/* Lookup an identifier in the hashtable. Puts the identifier in the + table if it is not already there. */ +extern cpp_hashnode *cpp_lookup (cpp_reader *, const unsigned char *, + unsigned int); + +typedef int (*cpp_cb) (cpp_reader *, cpp_hashnode *, void *); +extern void cpp_forall_identifiers (cpp_reader *, cpp_cb, void *); + +/* In cppmacro.c */ +extern void cpp_scan_nooutput (cpp_reader *); +extern int cpp_sys_macro_p (cpp_reader *); +extern unsigned char *cpp_quote_string (unsigned char *, const unsigned char *, + unsigned int); + +/* In cppfiles.c */ +extern bool cpp_included (cpp_reader *, const char *); +extern void cpp_make_system_header (cpp_reader *, int, int); +extern bool cpp_push_include (cpp_reader *, const char *); +extern void cpp_change_file (cpp_reader *, enum lc_reason, const char *); +extern const char *cpp_get_path (struct _cpp_file *); +extern cpp_dir *cpp_get_dir (struct _cpp_file *); +extern cpp_buffer *cpp_get_buffer (cpp_reader *); +extern struct _cpp_file *cpp_get_file (cpp_buffer *); +extern cpp_buffer *cpp_get_prev (cpp_buffer *); + +/* In cpppch.c */ +struct save_macro_data; +extern int cpp_save_state (cpp_reader *, FILE *); +extern int cpp_write_pch_deps (cpp_reader *, FILE *); +extern int cpp_write_pch_state (cpp_reader *, FILE *); +extern int cpp_valid_state (cpp_reader *, const char *, int); +extern void cpp_prepare_state (cpp_reader *, struct save_macro_data **); +extern int cpp_read_state (cpp_reader *, const char *, FILE *, + struct save_macro_data *); + +#ifdef __cplusplus +} +#endif + +#endif /* ! LIBCPP_CPPLIB_H */ diff --git a/libcpp/include/line-map.h b/libcpp/include/line-map.h new file mode 100644 index 00000000000..839467734ef --- /dev/null +++ b/libcpp/include/line-map.h @@ -0,0 +1,182 @@ +/* Map logical line numbers to (source file, line number) pairs. + Copyright (C) 2001, 2003, 2004 + 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + In other words, you are welcome to use, share and improve this program. + You are forbidden to forbid anyone else to use, share and improve + what you give them. Help stamp out software-hoarding! */ + +#ifndef LIBCPP_LINE_MAP_H +#define LIBCPP_LINE_MAP_H + +/* Reason for adding a line change with add_line_map (). LC_ENTER is + when including a new file, e.g. a #include directive in C. + LC_LEAVE is when reaching a file's end. LC_RENAME is when a file + name or line number changes for neither of the above reasons + (e.g. a #line directive in C). */ +enum lc_reason {LC_ENTER = 0, LC_LEAVE, LC_RENAME}; + +/* A logical line/column number, i.e. an "index" into a line_map. */ +/* Long-term, we want to use this to replace struct location_s (in input.h), + and effectively typedef source_location location_t. */ +typedef unsigned int source_location; +typedef source_location fileline; /* deprecated name */ + +/* Physical source file TO_FILE at line TO_LINE at column 0 is represented + by the logical START_LOCATION. TO_LINE+L at column C is represented by + START_LOCATION+(L*(1<<column_bits))+C, as long as C<(1<<column_bits), + and the result_location is less than the next line_map's start_location. + (The top line is line 1 and the leftmost column is column 1; line/column 0 + means "entire file/line" or "unknown line/column" or "not applicable".) + INCLUDED_FROM is an index into the set that gives the line mapping + at whose end the current one was included. File(s) at the bottom + of the include stack have this set to -1. REASON is the reason for + creation of this line map, SYSP is one for a system header, two for + a C system header file that therefore needs to be extern "C" + protected in C++, and zero otherwise. */ +struct line_map +{ + const char *to_file; + unsigned int to_line; + source_location start_location; + int included_from; + ENUM_BITFIELD (lc_reason) reason : CHAR_BIT; + /* The sysp field isn't really needed now that it's in cpp_buffer. */ + unsigned char sysp; + /* Number of the low-order source_location bits used for a column number. */ + unsigned int column_bits : 8; +}; + +/* A set of chronological line_map structures. */ +struct line_maps +{ + struct line_map *maps; + unsigned int allocated; + unsigned int used; + + unsigned int cache; + + /* The most recently listed include stack, if any, starts with + LAST_LISTED as the topmost including file. -1 indicates nothing + has been listed yet. */ + int last_listed; + + /* Depth of the include stack, including the current file. */ + unsigned int depth; + + /* If true, prints an include trace a la -H. */ + bool trace_includes; + + /* Highest source_location "given out". */ + source_location highest_location; + + /* Start of line of highest source_location "given out". */ + source_location highest_line; + + /* The maximum column number we can quickly allocate. Higher numbers + may require allocating a new line_map. */ + unsigned int max_column_hint; +}; + +/* Initialize a line map set. */ +extern void linemap_init (struct line_maps *); + +/* Free a line map set. */ +extern void linemap_free (struct line_maps *); + +/* Check for and warn about line_maps entered but not exited. */ + +extern void linemap_check_files_exited (struct line_maps *); + +/* Return a source_location for the start (i.e. column==0) of + (physical) line TO_LINE in the current source file (as in the + most recent linemap_add). MAX_COLUMN_HINT is the highest column + number we expect to use in this line (but it does not change + the highest_location). */ + +extern source_location linemap_line_start +(struct line_maps *, unsigned int, unsigned int); + +/* Add a mapping of logical source line to physical source file and + line number. + + The text pointed to by TO_FILE must have a lifetime + at least as long as the final call to lookup_line (). An empty + TO_FILE means standard input. If reason is LC_LEAVE, and + TO_FILE is NULL, then TO_FILE, TO_LINE and SYSP are given their + natural values considering the file we are returning to. + + START_LOCATION should be monotonic increasing across calls to this + function. A call to this function can relocate the previous set of + maps, so any stored line_map pointers should not be used. */ +extern const struct line_map *linemap_add + (struct line_maps *, enum lc_reason, unsigned int sysp, + const char *to_file, unsigned int to_line); + +/* Given a logical line, returns the map from which the corresponding + (source file, line) pair can be deduced. */ +extern const struct line_map *linemap_lookup + (struct line_maps *, source_location); + +/* Print the file names and line numbers of the #include commands + which led to the map MAP, if any, to stderr. Nothing is output if + the most recently listed stack is the same as the current one. */ +extern void linemap_print_containing_files (struct line_maps *, + const struct line_map *); + +/* Converts a map and a source_location to source line. */ +#define SOURCE_LINE(MAP, LINE) \ + ((((LINE) - (MAP)->start_location) >> (MAP)->column_bits) + (MAP)->to_line) + +#define SOURCE_COLUMN(MAP, LINE) \ + (((LINE) - (MAP)->start_location) & ((1 << (MAP)->column_bits) - 1)) + +/* Returns the last source line within a map. This is the (last) line + of the #include, or other directive, that caused a map change. */ +#define LAST_SOURCE_LINE(MAP) \ + SOURCE_LINE (MAP, LAST_SOURCE_LINE_LOCATION (MAP)) +#define LAST_SOURCE_LINE_LOCATION(MAP) \ + ((((MAP)[1].start_location - 1 - (MAP)->start_location) \ + & ~((1 << (MAP)->column_bits) - 1)) \ + + (MAP)->start_location) + +/* Returns the map a given map was included from. */ +#define INCLUDED_FROM(SET, MAP) (&(SET)->maps[(MAP)->included_from]) + +/* Nonzero if the map is at the bottom of the include stack. */ +#define MAIN_FILE_P(MAP) ((MAP)->included_from < 0) + +/* Set LOC to a source position that is the same line as the most recent + linemap_line_start, but with the specified TO_COLUMN column number. */ + +#define LINEMAP_POSITION_FOR_COLUMN(LOC, SET, TO_COLUMN) { \ + unsigned int to_column = (TO_COLUMN); \ + struct line_maps *set = (SET); \ + if (__builtin_expect (to_column >= set->max_column_hint, 0)) \ + (LOC) = linemap_position_for_column (set, to_column); \ + else { \ + source_location r = set->highest_line; \ + r = r + to_column; \ + if (r >= set->highest_location) \ + set->highest_location = r; \ + (LOC) = r; \ + }} + + +extern source_location +linemap_position_for_column (struct line_maps *set, unsigned int to_column); +#endif /* !LIBCPP_LINE_MAP_H */ diff --git a/libcpp/include/mkdeps.h b/libcpp/include/mkdeps.h new file mode 100644 index 00000000000..b5f9a05ff80 --- /dev/null +++ b/libcpp/include/mkdeps.h @@ -0,0 +1,72 @@ +/* Dependency generator for Makefile fragments. + Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. + Contributed by Zack Weinberg, Mar 2000 + +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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + In other words, you are welcome to use, share and improve this program. + You are forbidden to forbid anyone else to use, share and improve + what you give them. Help stamp out software-hoarding! */ + +#ifndef LIBCPP_MKDEPS_H +#define LIBCPP_MKDEPS_H + +/* This is the data structure used by all the functions in mkdeps.c. + It's quite straightforward, but should be treated as opaque. */ + +struct deps; + +/* Create a deps buffer. */ +extern struct deps *deps_init (void); + +/* Destroy a deps buffer. */ +extern void deps_free (struct deps *); + +/* Add a target (appears on left side of the colon) to the deps list. Takes + a boolean indicating whether to quote the target for MAKE. */ +extern void deps_add_target (struct deps *, const char *, int); + +/* Sets the default target if none has been given already. An empty + string as the default target is interpreted as stdin. */ +extern void deps_add_default_target (struct deps *, const char *); + +/* Add a dependency (appears on the right side of the colon) to the + deps list. Dependencies will be printed in the order that they + were entered with this function. By convention, the first + dependency entered should be the primary source file. */ +extern void deps_add_dep (struct deps *, const char *); + +/* Write out a deps buffer to a specified file. The third argument + is the number of columns to word-wrap at (0 means don't wrap). */ +extern void deps_write (const struct deps *, FILE *, unsigned int); + +/* Write out a deps buffer to a file, in a form that can be read back + with deps_restore. Returns nonzero on error, in which case the + error number will be in errno. */ +extern int deps_save (struct deps *, FILE *); + +/* Read back dependency information written with deps_save into + the deps buffer. The third argument may be NULL, in which case + the dependency information is just skipped, or it may be a filename, + in which case that filename is skipped. */ +extern int deps_restore (struct deps *, FILE *, const char *); + +/* For each dependency *except the first*, emit a dummy rule for that + file, causing it to depend on nothing. This is used to work around + the intermediate-file deletion misfeature in Make, in some + automatic dependency schemes. */ +extern void deps_phony_targets (const struct deps *, FILE *); + +#endif /* ! LIBCPP_MKDEPS_H */ diff --git a/libcpp/include/symtab.h b/libcpp/include/symtab.h new file mode 100644 index 00000000000..8b793320b56 --- /dev/null +++ b/libcpp/include/symtab.h @@ -0,0 +1,81 @@ +/* Hash tables. + Copyright (C) 2000, 2001, 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef LIBCPP_SYMTAB_H +#define LIBCPP_SYMTAB_H + +#include "obstack.h" +#define GTY(x) /* nothing */ + +/* This is what each hash table entry points to. It may be embedded + deeply within another object. */ +typedef struct ht_identifier ht_identifier; +struct ht_identifier GTY(()) +{ + const unsigned char *str; + unsigned int len; + unsigned int hash_value; +}; + +#define HT_LEN(NODE) ((NODE)->len) +#define HT_STR(NODE) ((NODE)->str) + +typedef struct ht hash_table; +typedef struct ht_identifier *hashnode; + +enum ht_lookup_option {HT_NO_INSERT = 0, HT_ALLOC, HT_ALLOCED}; + +/* An identifier hash table for cpplib and the front ends. */ +struct ht +{ + /* Identifiers are allocated from here. */ + struct obstack stack; + + hashnode *entries; + /* Call back. */ + hashnode (*alloc_node) (hash_table *); + + unsigned int nslots; /* Total slots in the entries array. */ + unsigned int nelements; /* Number of live elements. */ + + /* Link to reader, if any. For the benefit of cpplib. */ + struct cpp_reader *pfile; + + /* Table usage statistics. */ + unsigned int searches; + unsigned int collisions; +}; + +/* Initialize the hashtable with 2 ^ order entries. */ +extern hash_table *ht_create (unsigned int order); + +/* Frees all memory associated with a hash table. */ +extern void ht_destroy (hash_table *); + +extern hashnode ht_lookup (hash_table *, const unsigned char *, + size_t, enum ht_lookup_option); + +/* For all nodes in TABLE, make a callback. The callback takes + TABLE->PFILE, the node, and a PTR, and the callback sequence stops + if the callback returns zero. */ +typedef int (*ht_cb) (struct cpp_reader *, hashnode, const void *); +extern void ht_forall (hash_table *, ht_cb, const void *); + +/* Dump allocation statistics to stderr. */ +extern void ht_dump_statistics (hash_table *); + +#endif /* LIBCPP_SYMTAB_H */ diff --git a/libcpp/init.c b/libcpp/init.c new file mode 100644 index 00000000000..d14da4d00ab --- /dev/null +++ b/libcpp/init.c @@ -0,0 +1,631 @@ +/* CPP Library. + Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Contributed by Per Bothner, 1994-95. + Based on CCCP program by Paul Rubin, June 1986 + Adapted to ANSI C, Richard Stallman, Jan 1987 + +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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "config.h" +#include "system.h" +#include "cpplib.h" +#include "internal.h" +#include "mkdeps.h" + +static void init_library (void); +static void mark_named_operators (cpp_reader *); +static void read_original_filename (cpp_reader *); +static void read_original_directory (cpp_reader *); +static void post_options (cpp_reader *); + +/* If we have designated initializers (GCC >2.7) these tables can be + initialized, constant data. Otherwise, they have to be filled in at + runtime. */ +#if HAVE_DESIGNATED_INITIALIZERS + +#define init_trigraph_map() /* Nothing. */ +#define TRIGRAPH_MAP \ +__extension__ const uchar _cpp_trigraph_map[UCHAR_MAX + 1] = { + +#define END }; +#define s(p, v) [p] = v, + +#else + +#define TRIGRAPH_MAP uchar _cpp_trigraph_map[UCHAR_MAX + 1] = { 0 }; \ + static void init_trigraph_map (void) { \ + unsigned char *x = _cpp_trigraph_map; + +#define END } +#define s(p, v) x[p] = v; + +#endif + +TRIGRAPH_MAP + s('=', '#') s(')', ']') s('!', '|') + s('(', '[') s('\'', '^') s('>', '}') + s('/', '\\') s('<', '{') s('-', '~') +END + +#undef s +#undef END +#undef TRIGRAPH_MAP + +/* A set of booleans indicating what CPP features each source language + requires. */ +struct lang_flags +{ + char c99; + char cplusplus; + char extended_numbers; + char std; + char cplusplus_comments; + char digraphs; +}; + +static const struct lang_flags lang_defaults[] = +{ /* c99 c++ xnum std // digr */ + /* GNUC89 */ { 0, 0, 1, 0, 1, 1 }, + /* GNUC99 */ { 1, 0, 1, 0, 1, 1 }, + /* STDC89 */ { 0, 0, 0, 1, 0, 0 }, + /* STDC94 */ { 0, 0, 0, 1, 0, 1 }, + /* STDC99 */ { 1, 0, 1, 1, 1, 1 }, + /* GNUCXX */ { 0, 1, 1, 0, 1, 1 }, + /* CXX98 */ { 0, 1, 1, 1, 1, 1 }, + /* ASM */ { 0, 0, 1, 0, 1, 0 } +}; + +/* Sets internal flags correctly for a given language. */ +void +cpp_set_lang (cpp_reader *pfile, enum c_lang lang) +{ + const struct lang_flags *l = &lang_defaults[(int) lang]; + + CPP_OPTION (pfile, lang) = lang; + + CPP_OPTION (pfile, c99) = l->c99; + CPP_OPTION (pfile, cplusplus) = l->cplusplus; + CPP_OPTION (pfile, extended_numbers) = l->extended_numbers; + CPP_OPTION (pfile, std) = l->std; + CPP_OPTION (pfile, trigraphs) = l->std; + CPP_OPTION (pfile, cplusplus_comments) = l->cplusplus_comments; + CPP_OPTION (pfile, digraphs) = l->digraphs; +} + +/* Initialize library global state. */ +static void +init_library (void) +{ + static int initialized = 0; + + if (! initialized) + { + initialized = 1; + + /* Set up the trigraph map. This doesn't need to do anything if + we were compiled with a compiler that supports C99 designated + initializers. */ + init_trigraph_map (); + +#ifdef ENABLE_NLS + (void) bindtextdomain ("gcc", LOCALEDIR); +#endif + } +} + +/* Initialize a cpp_reader structure. */ +cpp_reader * +cpp_create_reader (enum c_lang lang, hash_table *table, + struct line_maps *line_table) +{ + cpp_reader *pfile; + + /* Initialize this instance of the library if it hasn't been already. */ + init_library (); + + pfile = xcalloc (1, sizeof (cpp_reader)); + + cpp_set_lang (pfile, lang); + CPP_OPTION (pfile, warn_multichar) = 1; + CPP_OPTION (pfile, discard_comments) = 1; + CPP_OPTION (pfile, discard_comments_in_macro_exp) = 1; + CPP_OPTION (pfile, show_column) = 1; + CPP_OPTION (pfile, tabstop) = 8; + CPP_OPTION (pfile, operator_names) = 1; + CPP_OPTION (pfile, warn_trigraphs) = 2; + CPP_OPTION (pfile, warn_endif_labels) = 1; + CPP_OPTION (pfile, warn_deprecated) = 1; + CPP_OPTION (pfile, warn_long_long) = !CPP_OPTION (pfile, c99); + CPP_OPTION (pfile, dollars_in_ident) = 1; + CPP_OPTION (pfile, warn_dollars) = 1; + CPP_OPTION (pfile, warn_variadic_macros) = 1; + + /* Default CPP arithmetic to something sensible for the host for the + benefit of dumb users like fix-header. */ + CPP_OPTION (pfile, precision) = CHAR_BIT * sizeof (long); + CPP_OPTION (pfile, char_precision) = CHAR_BIT; + CPP_OPTION (pfile, wchar_precision) = CHAR_BIT * sizeof (int); + CPP_OPTION (pfile, int_precision) = CHAR_BIT * sizeof (int); + CPP_OPTION (pfile, unsigned_char) = 0; + CPP_OPTION (pfile, unsigned_wchar) = 1; + CPP_OPTION (pfile, bytes_big_endian) = 1; /* does not matter */ + + /* Default to no charset conversion. */ + CPP_OPTION (pfile, narrow_charset) = _cpp_default_encoding (); + CPP_OPTION (pfile, wide_charset) = 0; + + /* Default the input character set to UTF-8. */ + CPP_OPTION (pfile, input_charset) = _cpp_default_encoding (); + + /* A fake empty "directory" used as the starting point for files + looked up without a search path. Name cannot be '/' because we + don't want to prepend anything at all to filenames using it. All + other entries are correct zero-initialized. */ + pfile->no_search_path.name = (char *) ""; + + /* Initialize the line map. */ + pfile->line_table = line_table; + + /* Initialize lexer state. */ + pfile->state.save_comments = ! CPP_OPTION (pfile, discard_comments); + + /* Set up static tokens. */ + pfile->avoid_paste.type = CPP_PADDING; + pfile->avoid_paste.val.source = NULL; + pfile->eof.type = CPP_EOF; + pfile->eof.flags = 0; + + /* Create a token buffer for the lexer. */ + _cpp_init_tokenrun (&pfile->base_run, 250); + pfile->cur_run = &pfile->base_run; + pfile->cur_token = pfile->base_run.base; + + /* Initialize the base context. */ + pfile->context = &pfile->base_context; + pfile->base_context.macro = 0; + pfile->base_context.prev = pfile->base_context.next = 0; + + /* Aligned and unaligned storage. */ + pfile->a_buff = _cpp_get_buff (pfile, 0); + pfile->u_buff = _cpp_get_buff (pfile, 0); + + /* The expression parser stack. */ + _cpp_expand_op_stack (pfile); + + /* Initialize the buffer obstack. */ + _obstack_begin (&pfile->buffer_ob, 0, 0, + (void *(*) (long)) xmalloc, + (void (*) (void *)) free); + + _cpp_init_files (pfile); + + _cpp_init_hashtable (pfile, table); + + return pfile; +} + +/* Free resources used by PFILE. Accessing PFILE after this function + returns leads to undefined behavior. Returns the error count. */ +void +cpp_destroy (cpp_reader *pfile) +{ + cpp_context *context, *contextn; + tokenrun *run, *runn; + + free (pfile->op_stack); + + while (CPP_BUFFER (pfile) != NULL) + _cpp_pop_buffer (pfile); + + if (pfile->out.base) + free (pfile->out.base); + + if (pfile->macro_buffer) + { + free (pfile->macro_buffer); + pfile->macro_buffer = NULL; + pfile->macro_buffer_len = 0; + } + + if (pfile->deps) + deps_free (pfile->deps); + obstack_free (&pfile->buffer_ob, 0); + + _cpp_destroy_hashtable (pfile); + _cpp_cleanup_files (pfile); + _cpp_destroy_iconv (pfile); + + _cpp_free_buff (pfile->a_buff); + _cpp_free_buff (pfile->u_buff); + _cpp_free_buff (pfile->free_buffs); + + for (run = &pfile->base_run; run; run = runn) + { + runn = run->next; + free (run->base); + if (run != &pfile->base_run) + free (run); + } + + for (context = pfile->base_context.next; context; context = contextn) + { + contextn = context->next; + free (context); + } + + free (pfile); +} + +/* This structure defines one built-in identifier. A node will be + entered in the hash table under the name NAME, with value VALUE. + + There are two tables of these. builtin_array holds all the + "builtin" macros: these are handled by builtin_macro() in + cppmacro.c. Builtin is somewhat of a misnomer -- the property of + interest is that these macros require special code to compute their + expansions. The value is a "builtin_type" enumerator. + + operator_array holds the C++ named operators. These are keywords + which act as aliases for punctuators. In C++, they cannot be + altered through #define, and #if recognizes them as operators. In + C, these are not entered into the hash table at all (but see + <iso646.h>). The value is a token-type enumerator. */ +struct builtin +{ + const uchar *name; + unsigned short len; + unsigned short value; +}; + +#define B(n, t) { DSC(n), t } +static const struct builtin builtin_array[] = +{ + B("__TIME__", BT_TIME), + B("__DATE__", BT_DATE), + B("__FILE__", BT_FILE), + B("__BASE_FILE__", BT_BASE_FILE), + B("__LINE__", BT_SPECLINE), + B("__INCLUDE_LEVEL__", BT_INCLUDE_LEVEL), + /* Keep builtins not used for -traditional-cpp at the end, and + update init_builtins() if any more are added. */ + B("_Pragma", BT_PRAGMA), + B("__STDC__", BT_STDC), +}; + +static const struct builtin operator_array[] = +{ + B("and", CPP_AND_AND), + B("and_eq", CPP_AND_EQ), + B("bitand", CPP_AND), + B("bitor", CPP_OR), + B("compl", CPP_COMPL), + B("not", CPP_NOT), + B("not_eq", CPP_NOT_EQ), + B("or", CPP_OR_OR), + B("or_eq", CPP_OR_EQ), + B("xor", CPP_XOR), + B("xor_eq", CPP_XOR_EQ) +}; +#undef B + +/* Mark the C++ named operators in the hash table. */ +static void +mark_named_operators (cpp_reader *pfile) +{ + const struct builtin *b; + + for (b = operator_array; + b < (operator_array + ARRAY_SIZE (operator_array)); + b++) + { + cpp_hashnode *hp = cpp_lookup (pfile, b->name, b->len); + hp->flags |= NODE_OPERATOR; + hp->is_directive = 0; + hp->directive_index = b->value; + } +} + +/* Read the builtins table above and enter them, and language-specific + macros, into the hash table. HOSTED is true if this is a hosted + environment. */ +void +cpp_init_builtins (cpp_reader *pfile, int hosted) +{ + const struct builtin *b; + size_t n = ARRAY_SIZE (builtin_array); + + if (CPP_OPTION (pfile, traditional)) + n -= 2; + + for(b = builtin_array; b < builtin_array + n; b++) + { + cpp_hashnode *hp = cpp_lookup (pfile, b->name, b->len); + hp->type = NT_MACRO; + hp->flags |= NODE_BUILTIN | NODE_WARN; + hp->value.builtin = b->value; + } + + if (CPP_OPTION (pfile, cplusplus)) + _cpp_define_builtin (pfile, "__cplusplus 1"); + else if (CPP_OPTION (pfile, lang) == CLK_ASM) + _cpp_define_builtin (pfile, "__ASSEMBLER__ 1"); + else if (CPP_OPTION (pfile, lang) == CLK_STDC94) + _cpp_define_builtin (pfile, "__STDC_VERSION__ 199409L"); + else if (CPP_OPTION (pfile, c99)) + _cpp_define_builtin (pfile, "__STDC_VERSION__ 199901L"); + + if (hosted) + _cpp_define_builtin (pfile, "__STDC_HOSTED__ 1"); + else + _cpp_define_builtin (pfile, "__STDC_HOSTED__ 0"); + + if (CPP_OPTION (pfile, objc)) + _cpp_define_builtin (pfile, "__OBJC__ 1"); +} + +/* Sanity-checks are dependent on command-line options, so it is + called as a subroutine of cpp_read_main_file (). */ +#if ENABLE_CHECKING +static void sanity_checks (cpp_reader *); +static void sanity_checks (cpp_reader *pfile) +{ + cppchar_t test = 0; + size_t max_precision = 2 * CHAR_BIT * sizeof (cpp_num_part); + + /* Sanity checks for assumptions about CPP arithmetic and target + type precisions made by cpplib. */ + test--; + if (test < 1) + cpp_error (pfile, CPP_DL_ICE, "cppchar_t must be an unsigned type"); + + if (CPP_OPTION (pfile, precision) > max_precision) + cpp_error (pfile, CPP_DL_ICE, + "preprocessor arithmetic has maximum precision of %lu bits;" + " target requires %lu bits", + (unsigned long) max_precision, + (unsigned long) CPP_OPTION (pfile, precision)); + + if (CPP_OPTION (pfile, precision) < CPP_OPTION (pfile, int_precision)) + cpp_error (pfile, CPP_DL_ICE, + "CPP arithmetic must be at least as precise as a target int"); + + if (CPP_OPTION (pfile, char_precision) < 8) + cpp_error (pfile, CPP_DL_ICE, "target char is less than 8 bits wide"); + + if (CPP_OPTION (pfile, wchar_precision) < CPP_OPTION (pfile, char_precision)) + cpp_error (pfile, CPP_DL_ICE, + "target wchar_t is narrower than target char"); + + if (CPP_OPTION (pfile, int_precision) < CPP_OPTION (pfile, char_precision)) + cpp_error (pfile, CPP_DL_ICE, + "target int is narrower than target char"); + + /* This is assumed in eval_token() and could be fixed if necessary. */ + if (sizeof (cppchar_t) > sizeof (cpp_num_part)) + cpp_error (pfile, CPP_DL_ICE, + "CPP half-integer narrower than CPP character"); + + if (CPP_OPTION (pfile, wchar_precision) > BITS_PER_CPPCHAR_T) + cpp_error (pfile, CPP_DL_ICE, + "CPP on this host cannot handle wide character constants over" + " %lu bits, but the target requires %lu bits", + (unsigned long) BITS_PER_CPPCHAR_T, + (unsigned long) CPP_OPTION (pfile, wchar_precision)); +} +#else +# define sanity_checks(PFILE) +#endif + +/* Add a dependency target. Can be called any number of times before + cpp_read_main_file(). If no targets have been added before + cpp_read_main_file(), then the default target is used. */ +void +cpp_add_dependency_target (cpp_reader *pfile, const char *target, int quote) +{ + if (!pfile->deps) + pfile->deps = deps_init (); + + deps_add_target (pfile->deps, target, quote); +} + +/* This is called after options have been parsed, and partially + processed. */ +void +cpp_post_options (cpp_reader *pfile) +{ + sanity_checks (pfile); + + post_options (pfile); + + /* Mark named operators before handling command line macros. */ + if (CPP_OPTION (pfile, cplusplus) && CPP_OPTION (pfile, operator_names)) + mark_named_operators (pfile); +} + +/* Setup for processing input from the file named FNAME, or stdin if + it is the empty string. Return the original filename + on success (e.g. foo.i->foo.c), or NULL on failure. */ +const char * +cpp_read_main_file (cpp_reader *pfile, const char *fname) +{ + if (CPP_OPTION (pfile, deps.style) != DEPS_NONE) + { + if (!pfile->deps) + pfile->deps = deps_init (); + + /* Set the default target (if there is none already). */ + deps_add_default_target (pfile->deps, fname); + } + + pfile->main_file + = _cpp_find_file (pfile, fname, &pfile->no_search_path, false); + if (_cpp_find_failed (pfile->main_file)) + return NULL; + + _cpp_stack_file (pfile, pfile->main_file, false); + + /* For foo.i, read the original filename foo.c now, for the benefit + of the front ends. */ + if (CPP_OPTION (pfile, preprocessed)) + { + read_original_filename (pfile); + fname = pfile->line_table->maps[pfile->line_table->used-1].to_file; + } + return fname; +} + +/* For preprocessed files, if the first tokens are of the form # NUM. + handle the directive so we know the original file name. This will + generate file_change callbacks, which the front ends must handle + appropriately given their state of initialization. */ +static void +read_original_filename (cpp_reader *pfile) +{ + const cpp_token *token, *token1; + + /* Lex ahead; if the first tokens are of the form # NUM, then + process the directive, otherwise back up. */ + token = _cpp_lex_direct (pfile); + if (token->type == CPP_HASH) + { + token1 = _cpp_lex_direct (pfile); + _cpp_backup_tokens (pfile, 1); + + /* If it's a #line directive, handle it. */ + if (token1->type == CPP_NUMBER) + { + _cpp_handle_directive (pfile, token->flags & PREV_WHITE); + read_original_directory (pfile); + return; + } + } + + /* Backup as if nothing happened. */ + _cpp_backup_tokens (pfile, 1); +} + +/* For preprocessed files, if the tokens following the first filename + line is of the form # <line> "/path/name//", handle the + directive so we know the original current directory. */ +static void +read_original_directory (cpp_reader *pfile) +{ + const cpp_token *hash, *token; + + /* Lex ahead; if the first tokens are of the form # NUM, then + process the directive, otherwise back up. */ + hash = _cpp_lex_direct (pfile); + if (hash->type != CPP_HASH) + { + _cpp_backup_tokens (pfile, 1); + return; + } + + token = _cpp_lex_direct (pfile); + + if (token->type != CPP_NUMBER) + { + _cpp_backup_tokens (pfile, 2); + return; + } + + token = _cpp_lex_direct (pfile); + + if (token->type != CPP_STRING + || ! (token->val.str.len >= 5 + && token->val.str.text[token->val.str.len-2] == '/' + && token->val.str.text[token->val.str.len-3] == '/')) + { + _cpp_backup_tokens (pfile, 3); + return; + } + + if (pfile->cb.dir_change) + { + char *debugdir = alloca (token->val.str.len - 3); + + memcpy (debugdir, (const char *) token->val.str.text + 1, + token->val.str.len - 4); + debugdir[token->val.str.len - 4] = '\0'; + + pfile->cb.dir_change (pfile, debugdir); + } +} + +/* This is called at the end of preprocessing. It pops the last + buffer and writes dependency output, and returns the number of + errors. + + Maybe it should also reset state, such that you could call + cpp_start_read with a new filename to restart processing. */ +int +cpp_finish (cpp_reader *pfile, FILE *deps_stream) +{ + /* Warn about unused macros before popping the final buffer. */ + if (CPP_OPTION (pfile, warn_unused_macros)) + cpp_forall_identifiers (pfile, _cpp_warn_if_unused_macro, NULL); + + /* cpplex.c leaves the final buffer on the stack. This it so that + it returns an unending stream of CPP_EOFs to the client. If we + popped the buffer, we'd dereference a NULL buffer pointer and + segfault. It's nice to allow the client to do worry-free excess + cpp_get_token calls. */ + while (pfile->buffer) + _cpp_pop_buffer (pfile); + + /* Don't write the deps file if there are errors. */ + if (CPP_OPTION (pfile, deps.style) != DEPS_NONE + && deps_stream && pfile->errors == 0) + { + deps_write (pfile->deps, deps_stream, 72); + + if (CPP_OPTION (pfile, deps.phony_targets)) + deps_phony_targets (pfile->deps, deps_stream); + } + + /* Report on headers that could use multiple include guards. */ + if (CPP_OPTION (pfile, print_include_names)) + _cpp_report_missing_guards (pfile); + + return pfile->errors; +} + +static void +post_options (cpp_reader *pfile) +{ + /* -Wtraditional is not useful in C++ mode. */ + if (CPP_OPTION (pfile, cplusplus)) + CPP_OPTION (pfile, warn_traditional) = 0; + + /* Permanently disable macro expansion if we are rescanning + preprocessed text. Read preprocesed source in ISO mode. */ + if (CPP_OPTION (pfile, preprocessed)) + { + pfile->state.prevent_expansion = 1; + CPP_OPTION (pfile, traditional) = 0; + } + + if (CPP_OPTION (pfile, warn_trigraphs) == 2) + CPP_OPTION (pfile, warn_trigraphs) = !CPP_OPTION (pfile, trigraphs); + + if (CPP_OPTION (pfile, traditional)) + { + /* Traditional CPP does not accurately track column information. */ + CPP_OPTION (pfile, show_column) = 0; + CPP_OPTION (pfile, trigraphs) = 0; + CPP_OPTION (pfile, warn_trigraphs) = 0; + } +} diff --git a/libcpp/internal.h b/libcpp/internal.h new file mode 100644 index 00000000000..9cd9be57cc4 --- /dev/null +++ b/libcpp/internal.h @@ -0,0 +1,651 @@ +/* Part of CPP library. + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* This header defines all the internal data structures and functions + that need to be visible across files. It should not be used outside + cpplib. */ + +#ifndef LIBCPP_INTERNAL_H +#define LIBCPP_INTERNAL_H + +#include "symtab.h" + +#if defined HAVE_ICONV_H && defined HAVE_ICONV +#include <iconv.h> +#else +#define HAVE_ICONV 0 +typedef int iconv_t; /* dummy */ +#endif + +struct directive; /* Deliberately incomplete. */ +struct pending_option; +struct op; +struct _cpp_strbuf; + +typedef bool (*convert_f) (iconv_t, const unsigned char *, size_t, + struct _cpp_strbuf *); +struct cset_converter +{ + convert_f func; + iconv_t cd; +}; + +#ifndef HAVE_UCHAR +typedef unsigned char uchar; +#endif +#define U (const uchar *) /* Intended use: U"string" */ + +#define BITS_PER_CPPCHAR_T (CHAR_BIT * sizeof (cppchar_t)) + +/* Test if a sign is valid within a preprocessing number. */ +#define VALID_SIGN(c, prevc) \ + (((c) == '+' || (c) == '-') && \ + ((prevc) == 'e' || (prevc) == 'E' \ + || (((prevc) == 'p' || (prevc) == 'P') \ + && CPP_OPTION (pfile, extended_numbers)))) + +#define CPP_OPTION(PFILE, OPTION) ((PFILE)->opts.OPTION) +#define CPP_BUFFER(PFILE) ((PFILE)->buffer) +#define CPP_BUF_COLUMN(BUF, CUR) ((CUR) - (BUF)->line_base) +#define CPP_BUF_COL(BUF) CPP_BUF_COLUMN(BUF, (BUF)->cur) + +#define CPP_INCREMENT_LINE(PFILE, COLS_HINT) do { \ + const struct line_maps *line_table = PFILE->line_table; \ + const struct line_map *map = &line_table->maps[line_table->used-1]; \ + unsigned int line = SOURCE_LINE (map, line_table->highest_line); \ + linemap_line_start (PFILE->line_table, line + 1, COLS_HINT); \ + } while (0) + +/* Maximum nesting of cpp_buffers. We use a static limit, partly for + efficiency, and partly to limit runaway recursion. */ +#define CPP_STACK_MAX 200 + +/* Host alignment handling. */ +struct dummy +{ + char c; + union + { + double d; + int *p; + } u; +}; + +#define DEFAULT_ALIGNMENT offsetof (struct dummy, u) +#define CPP_ALIGN2(size, align) (((size) + ((align) - 1)) & ~((align) - 1)) +#define CPP_ALIGN(size) CPP_ALIGN2 (size, DEFAULT_ALIGNMENT) + +/* Each macro definition is recorded in a cpp_macro structure. + Variadic macros cannot occur with traditional cpp. */ +struct cpp_macro +{ + /* Parameters, if any. */ + cpp_hashnode **params; + + /* Replacement tokens (ISO) or replacement text (traditional). See + comment at top of cpptrad.c for how traditional function-like + macros are encoded. */ + union + { + cpp_token *tokens; + const uchar *text; + } exp; + + /* Definition line number. */ + fileline line; + + /* Number of tokens in expansion, or bytes for traditional macros. */ + unsigned int count; + + /* Number of parameters. */ + unsigned short paramc; + + /* If a function-like macro. */ + unsigned int fun_like : 1; + + /* If a variadic macro. */ + unsigned int variadic : 1; + + /* If macro defined in system header. */ + unsigned int syshdr : 1; + + /* Nonzero if it has been expanded or had its existence tested. */ + unsigned int used : 1; +}; + +#define _cpp_mark_macro_used(NODE) do { \ + if ((NODE)->type == NT_MACRO && !((NODE)->flags & NODE_BUILTIN)) \ + (NODE)->value.macro->used = 1; } while (0) + +/* A generic memory buffer, and operations on it. */ +typedef struct _cpp_buff _cpp_buff; +struct _cpp_buff +{ + struct _cpp_buff *next; + unsigned char *base, *cur, *limit; +}; + +extern _cpp_buff *_cpp_get_buff (cpp_reader *, size_t); +extern void _cpp_release_buff (cpp_reader *, _cpp_buff *); +extern void _cpp_extend_buff (cpp_reader *, _cpp_buff **, size_t); +extern _cpp_buff *_cpp_append_extend_buff (cpp_reader *, _cpp_buff *, size_t); +extern void _cpp_free_buff (_cpp_buff *); +extern unsigned char *_cpp_aligned_alloc (cpp_reader *, size_t); +extern unsigned char *_cpp_unaligned_alloc (cpp_reader *, size_t); + +#define BUFF_ROOM(BUFF) (size_t) ((BUFF)->limit - (BUFF)->cur) +#define BUFF_FRONT(BUFF) ((BUFF)->cur) +#define BUFF_LIMIT(BUFF) ((BUFF)->limit) + +/* #include types. */ +enum include_type {IT_INCLUDE, IT_INCLUDE_NEXT, IT_IMPORT, IT_CMDLINE}; + +union utoken +{ + const cpp_token *token; + const cpp_token **ptoken; +}; + +/* A "run" of tokens; part of a chain of runs. */ +typedef struct tokenrun tokenrun; +struct tokenrun +{ + tokenrun *next, *prev; + cpp_token *base, *limit; +}; + +/* Accessor macros for struct cpp_context. */ +#define FIRST(c) ((c)->u.iso.first) +#define LAST(c) ((c)->u.iso.last) +#define CUR(c) ((c)->u.trad.cur) +#define RLIMIT(c) ((c)->u.trad.rlimit) + +typedef struct cpp_context cpp_context; +struct cpp_context +{ + /* Doubly-linked list. */ + cpp_context *next, *prev; + + union + { + /* For ISO macro expansion. Contexts other than the base context + are contiguous tokens. e.g. macro expansions, expanded + argument tokens. */ + struct + { + union utoken first; + union utoken last; + } iso; + + /* For traditional macro expansion. */ + struct + { + const uchar *cur; + const uchar *rlimit; + } trad; + } u; + + /* If non-NULL, a buffer used for storage related to this context. + When the context is popped, the buffer is released. */ + _cpp_buff *buff; + + /* For a macro context, the macro node, otherwise NULL. */ + cpp_hashnode *macro; + + /* True if utoken element is token, else ptoken. */ + bool direct_p; +}; + +struct lexer_state +{ + /* Nonzero if first token on line is CPP_HASH. */ + unsigned char in_directive; + + /* Nonzero if in a directive that will handle padding tokens itself. + #include needs this to avoid problems with computed include and + spacing between tokens. */ + unsigned char directive_wants_padding; + + /* True if we are skipping a failed conditional group. */ + unsigned char skipping; + + /* Nonzero if in a directive that takes angle-bracketed headers. */ + unsigned char angled_headers; + + /* Nonzero if in a #if or #elif directive. */ + unsigned char in_expression; + + /* Nonzero to save comments. Turned off if discard_comments, and in + all directives apart from #define. */ + unsigned char save_comments; + + /* Nonzero if lexing __VA_ARGS__ is valid. */ + unsigned char va_args_ok; + + /* Nonzero if lexing poisoned identifiers is valid. */ + unsigned char poisoned_ok; + + /* Nonzero to prevent macro expansion. */ + unsigned char prevent_expansion; + + /* Nonzero when parsing arguments to a function-like macro. */ + unsigned char parsing_args; + + /* Nonzero to skip evaluating part of an expression. */ + unsigned int skip_eval; +}; + +/* Special nodes - identifiers with predefined significance. */ +struct spec_nodes +{ + cpp_hashnode *n_defined; /* defined operator */ + cpp_hashnode *n_true; /* C++ keyword true */ + cpp_hashnode *n_false; /* C++ keyword false */ + cpp_hashnode *n__VA_ARGS__; /* C99 vararg macros */ +}; + +typedef struct _cpp_line_note _cpp_line_note; +struct _cpp_line_note +{ + /* Location in the clean line the note refers to. */ + const uchar *pos; + + /* Type of note. The 9 'from' trigraph characters represent those + trigraphs, '\\' an escaped newline, ' ' an escaped newline with + intervening space, and anything else is invalid. */ + unsigned int type; +}; + +/* Represents the contents of a file cpplib has read in. */ +struct cpp_buffer +{ + const uchar *cur; /* Current location. */ + const uchar *line_base; /* Start of current physical line. */ + const uchar *next_line; /* Start of to-be-cleaned logical line. */ + + const uchar *buf; /* Entire character buffer. */ + const uchar *rlimit; /* Writable byte at end of file. */ + + _cpp_line_note *notes; /* Array of notes. */ + unsigned int cur_note; /* Next note to process. */ + unsigned int notes_used; /* Number of notes. */ + unsigned int notes_cap; /* Size of allocated array. */ + + struct cpp_buffer *prev; + + /* Pointer into the file table; non-NULL if this is a file buffer. + Used for include_next and to record control macros. */ + struct _cpp_file *file; + + /* Value of if_stack at start of this file. + Used to prohibit unmatched #endif (etc) in an include file. */ + struct if_stack *if_stack; + + /* True if we need to get the next clean line. */ + bool need_line; + + /* True if we have already warned about C++ comments in this file. + The warning happens only for C89 extended mode with -pedantic on, + or for -Wtraditional, and only once per file (otherwise it would + be far too noisy). */ + unsigned int warned_cplusplus_comments : 1; + + /* True if we don't process trigraphs and escaped newlines. True + for preprocessed input, command line directives, and _Pragma + buffers. */ + unsigned int from_stage3 : 1; + + /* At EOF, a buffer is automatically popped. If RETURN_AT_EOF is + true, a CPP_EOF token is then returned. Otherwise, the next + token from the enclosing buffer is returned. */ + unsigned int return_at_eof : 1; + + /* One for a system header, two for a C system header file that therefore + needs to be extern "C" protected in C++, and zero otherwise. */ + unsigned char sysp; + + /* The directory of the this buffer's file. Its NAME member is not + allocated, so we don't need to worry about freeing it. */ + struct cpp_dir dir; + + /* Descriptor for converting from the input character set to the + source character set. */ + struct cset_converter input_cset_desc; +}; + +/* A cpp_reader encapsulates the "state" of a pre-processor run. + Applying cpp_get_token repeatedly yields a stream of pre-processor + tokens. Usually, there is only one cpp_reader object active. */ +struct cpp_reader +{ + /* Top of buffer stack. */ + cpp_buffer *buffer; + + /* Overlaid buffer (can be different after processing #include). */ + cpp_buffer *overlaid_buffer; + + /* Lexer state. */ + struct lexer_state state; + + /* Source line tracking. */ + struct line_maps *line_table; + + /* The line of the '#' of the current directive. */ + fileline directive_line; + + /* Memory buffers. */ + _cpp_buff *a_buff; /* Aligned permanent storage. */ + _cpp_buff *u_buff; /* Unaligned permanent storage. */ + _cpp_buff *free_buffs; /* Free buffer chain. */ + + /* Context stack. */ + struct cpp_context base_context; + struct cpp_context *context; + + /* If in_directive, the directive if known. */ + const struct directive *directive; + + /* Search paths for include files. */ + struct cpp_dir *quote_include; /* "" */ + struct cpp_dir *bracket_include; /* <> */ + struct cpp_dir no_search_path; /* No path. */ + + /* Chain of all hashed _cpp_file instances. */ + struct _cpp_file *all_files; + + struct _cpp_file *main_file; + + /* File and directory hash table. */ + struct htab *file_hash; + struct file_hash_entry *file_hash_entries; + unsigned int file_hash_entries_allocated, file_hash_entries_used; + + /* Nonzero means don't look for #include "foo" the source-file + directory. */ + bool quote_ignores_source_dir; + + /* Nonzero if any file has contained #pragma once or #import has + been used. */ + bool seen_once_only; + + /* Multiple include optimization. */ + const cpp_hashnode *mi_cmacro; + const cpp_hashnode *mi_ind_cmacro; + bool mi_valid; + + /* Lexing. */ + cpp_token *cur_token; + tokenrun base_run, *cur_run; + unsigned int lookaheads; + + /* Nonzero prevents the lexer from re-using the token runs. */ + unsigned int keep_tokens; + + /* Error counter for exit code. */ + unsigned int errors; + + /* Buffer to hold macro definition string. */ + unsigned char *macro_buffer; + unsigned int macro_buffer_len; + + /* Descriptor for converting from the source character set to the + execution character set. */ + struct cset_converter narrow_cset_desc; + + /* Descriptor for converting from the source character set to the + wide execution character set. */ + struct cset_converter wide_cset_desc; + + /* Date and time text. Calculated together if either is requested. */ + const uchar *date; + const uchar *time; + + /* EOF token, and a token forcing paste avoidance. */ + cpp_token avoid_paste; + cpp_token eof; + + /* Opaque handle to the dependencies of mkdeps.c. */ + struct deps *deps; + + /* Obstack holding all macro hash nodes. This never shrinks. + See cpphash.c */ + struct obstack hash_ob; + + /* Obstack holding buffer and conditional structures. This is a + real stack. See cpplib.c. */ + struct obstack buffer_ob; + + /* Pragma table - dynamic, because a library user can add to the + list of recognized pragmas. */ + struct pragma_entry *pragmas; + + /* Call backs to cpplib client. */ + struct cpp_callbacks cb; + + /* Identifier hash table. */ + struct ht *hash_table; + + /* Expression parser stack. */ + struct op *op_stack, *op_limit; + + /* User visible options. */ + struct cpp_options opts; + + /* Special nodes - identifiers with predefined significance to the + preprocessor. */ + struct spec_nodes spec_nodes; + + /* Whether cpplib owns the hashtable. */ + bool our_hashtable; + + /* Traditional preprocessing output buffer (a logical line). */ + struct + { + uchar *base; + uchar *limit; + uchar *cur; + fileline first_line; + } out; + + /* Used for buffer overlays by cpptrad.c. */ + const uchar *saved_cur, *saved_rlimit, *saved_line_base; + + /* A saved list of the defined macros, for dependency checking + of precompiled headers. */ + struct cpp_savedstate *savedstate; +}; + +/* Character classes. Based on the more primitive macros in safe-ctype.h. + If the definition of `numchar' looks odd to you, please look up the + definition of a pp-number in the C standard [section 6.4.8 of C99]. + + In the unlikely event that characters other than \r and \n enter + the set is_vspace, the macro handle_newline() in cpplex.c must be + updated. */ +#define _dollar_ok(x) ((x) == '$' && CPP_OPTION (pfile, dollars_in_ident)) + +#define is_idchar(x) (ISIDNUM(x) || _dollar_ok(x)) +#define is_numchar(x) ISIDNUM(x) +#define is_idstart(x) (ISIDST(x) || _dollar_ok(x)) +#define is_numstart(x) ISDIGIT(x) +#define is_hspace(x) ISBLANK(x) +#define is_vspace(x) IS_VSPACE(x) +#define is_nvspace(x) IS_NVSPACE(x) +#define is_space(x) IS_SPACE_OR_NUL(x) + +/* This table is constant if it can be initialized at compile time, + which is the case if cpp was compiled with GCC >=2.7, or another + compiler that supports C99. */ +#if HAVE_DESIGNATED_INITIALIZERS +extern const unsigned char _cpp_trigraph_map[UCHAR_MAX + 1]; +#else +extern unsigned char _cpp_trigraph_map[UCHAR_MAX + 1]; +#endif + +/* Macros. */ + +static inline int cpp_in_system_header (cpp_reader *); +static inline int +cpp_in_system_header (cpp_reader *pfile) +{ + return pfile->buffer ? pfile->buffer->sysp : 0; +} +#define CPP_PEDANTIC(PF) CPP_OPTION (PF, pedantic) +#define CPP_WTRADITIONAL(PF) CPP_OPTION (PF, warn_traditional) + +/* In cpperror.c */ +extern int _cpp_begin_message (cpp_reader *, int, + source_location, unsigned int); + +/* In cppmacro.c */ +extern void _cpp_free_definition (cpp_hashnode *); +extern bool _cpp_create_definition (cpp_reader *, cpp_hashnode *); +extern void _cpp_pop_context (cpp_reader *); +extern void _cpp_push_text_context (cpp_reader *, cpp_hashnode *, + const uchar *, size_t); +extern bool _cpp_save_parameter (cpp_reader *, cpp_macro *, cpp_hashnode *); +extern bool _cpp_arguments_ok (cpp_reader *, cpp_macro *, const cpp_hashnode *, + unsigned int); +extern const uchar *_cpp_builtin_macro_text (cpp_reader *, cpp_hashnode *); +int _cpp_warn_if_unused_macro (cpp_reader *, cpp_hashnode *, void *); +/* In cpphash.c */ +extern void _cpp_init_hashtable (cpp_reader *, hash_table *); +extern void _cpp_destroy_hashtable (cpp_reader *); + +/* In cppfiles.c */ +typedef struct _cpp_file _cpp_file; +extern _cpp_file *_cpp_find_file (cpp_reader *, const char *fname, + cpp_dir *start_dir, bool fake); +extern bool _cpp_find_failed (_cpp_file *); +extern void _cpp_mark_file_once_only (cpp_reader *, struct _cpp_file *); +extern void _cpp_fake_include (cpp_reader *, const char *); +extern bool _cpp_stack_file (cpp_reader *, _cpp_file*, bool); +extern bool _cpp_stack_include (cpp_reader *, const char *, int, + enum include_type); +extern int _cpp_compare_file_date (cpp_reader *, const char *, int); +extern void _cpp_report_missing_guards (cpp_reader *); +extern void _cpp_init_files (cpp_reader *); +extern void _cpp_cleanup_files (cpp_reader *); +extern void _cpp_pop_file_buffer (cpp_reader *, struct _cpp_file *); +extern bool _cpp_save_file_entries (cpp_reader *pfile, FILE *f); +extern bool _cpp_read_file_entries (cpp_reader *, FILE *); + +/* In cppexp.c */ +extern bool _cpp_parse_expr (cpp_reader *); +extern struct op *_cpp_expand_op_stack (cpp_reader *); + +/* In cpplex.c */ +extern void _cpp_process_line_notes (cpp_reader *, int); +extern void _cpp_clean_line (cpp_reader *); +extern bool _cpp_get_fresh_line (cpp_reader *); +extern bool _cpp_skip_block_comment (cpp_reader *); +extern cpp_token *_cpp_temp_token (cpp_reader *); +extern const cpp_token *_cpp_lex_token (cpp_reader *); +extern cpp_token *_cpp_lex_direct (cpp_reader *); +extern int _cpp_equiv_tokens (const cpp_token *, const cpp_token *); +extern void _cpp_init_tokenrun (tokenrun *, unsigned int); + +/* In cppinit.c. */ +extern void _cpp_maybe_push_include_file (cpp_reader *); + +/* In cpplib.c */ +extern int _cpp_test_assertion (cpp_reader *, unsigned int *); +extern int _cpp_handle_directive (cpp_reader *, int); +extern void _cpp_define_builtin (cpp_reader *, const char *); +extern char ** _cpp_save_pragma_names (cpp_reader *); +extern void _cpp_restore_pragma_names (cpp_reader *, char **); +extern void _cpp_do__Pragma (cpp_reader *); +extern void _cpp_init_directives (cpp_reader *); +extern void _cpp_init_internal_pragmas (cpp_reader *); +extern void _cpp_do_file_change (cpp_reader *, enum lc_reason, const char *, + unsigned int, unsigned int); +extern void _cpp_pop_buffer (cpp_reader *); + +/* In cpptrad.c. */ +extern bool _cpp_scan_out_logical_line (cpp_reader *, cpp_macro *); +extern bool _cpp_read_logical_line_trad (cpp_reader *); +extern void _cpp_overlay_buffer (cpp_reader *pfile, const uchar *, size_t); +extern void _cpp_remove_overlay (cpp_reader *); +extern bool _cpp_create_trad_definition (cpp_reader *, cpp_macro *); +extern bool _cpp_expansions_different_trad (const cpp_macro *, + const cpp_macro *); +extern uchar *_cpp_copy_replacement_text (const cpp_macro *, uchar *); +extern size_t _cpp_replacement_text_len (const cpp_macro *); + +/* In cppcharset.c. */ +extern cppchar_t _cpp_valid_ucn (cpp_reader *, const uchar **, + const uchar *, int); +extern void _cpp_destroy_iconv (cpp_reader *); +extern uchar *_cpp_convert_input (cpp_reader *, const char *, uchar *, + size_t, size_t, off_t *); +extern const char *_cpp_default_encoding (void); + +/* Utility routines and macros. */ +#define DSC(str) (const uchar *)str, sizeof str - 1 +#define xnew(T) (T *) xmalloc (sizeof(T)) +#define xcnew(T) (T *) xcalloc (1, sizeof(T)) +#define xnewvec(T, N) (T *) xmalloc (sizeof(T) * (N)) +#define xcnewvec(T, N) (T *) xcalloc (N, sizeof(T)) +#define xobnew(O, T) (T *) obstack_alloc (O, sizeof(T)) + +/* These are inline functions instead of macros so we can get type + checking. */ +static inline int ustrcmp (const uchar *, const uchar *); +static inline int ustrncmp (const uchar *, const uchar *, size_t); +static inline size_t ustrlen (const uchar *); +static inline uchar *uxstrdup (const uchar *); +static inline uchar *ustrchr (const uchar *, int); +static inline int ufputs (const uchar *, FILE *); + +static inline int +ustrcmp (const uchar *s1, const uchar *s2) +{ + return strcmp ((const char *)s1, (const char *)s2); +} + +static inline int +ustrncmp (const uchar *s1, const uchar *s2, size_t n) +{ + return strncmp ((const char *)s1, (const char *)s2, n); +} + +static inline size_t +ustrlen (const uchar *s1) +{ + return strlen ((const char *)s1); +} + +static inline uchar * +uxstrdup (const uchar *s1) +{ + return (uchar *) xstrdup ((const char *)s1); +} + +static inline uchar * +ustrchr (const uchar *s1, int c) +{ + return (uchar *) strchr ((const char *)s1, c); +} + +static inline int +ufputs (const uchar *s, FILE *f) +{ + return fputs ((const char *)s, f); +} + +#endif /* ! LIBCPP_INTERNAL_H */ diff --git a/libcpp/lex.c b/libcpp/lex.c new file mode 100644 index 00000000000..a7d988b2adc --- /dev/null +++ b/libcpp/lex.c @@ -0,0 +1,1544 @@ +/* CPP Library - lexical analysis. + Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Contributed by Per Bothner, 1994-95. + Based on CCCP program by Paul Rubin, June 1986 + Adapted to ANSI C, Richard Stallman, Jan 1987 + Broken out to separate file, Zack Weinberg, Mar 2000 + +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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "config.h" +#include "system.h" +#include "cpplib.h" +#include "internal.h" + +enum spell_type +{ + SPELL_OPERATOR = 0, + SPELL_IDENT, + SPELL_LITERAL, + SPELL_NONE +}; + +struct token_spelling +{ + enum spell_type category; + const unsigned char *name; +}; + +static const unsigned char *const digraph_spellings[] = +{ U"%:", U"%:%:", U"<:", U":>", U"<%", U"%>" }; + +#define OP(e, s) { SPELL_OPERATOR, U s }, +#define TK(e, s) { s, U #e }, +static const struct token_spelling token_spellings[N_TTYPES] = { TTYPE_TABLE }; +#undef OP +#undef TK + +#define TOKEN_SPELL(token) (token_spellings[(token)->type].category) +#define TOKEN_NAME(token) (token_spellings[(token)->type].name) + +static void add_line_note (cpp_buffer *, const uchar *, unsigned int); +static int skip_line_comment (cpp_reader *); +static void skip_whitespace (cpp_reader *, cppchar_t); +static cpp_hashnode *lex_identifier (cpp_reader *, const uchar *); +static void lex_number (cpp_reader *, cpp_string *); +static bool forms_identifier_p (cpp_reader *, int); +static void lex_string (cpp_reader *, cpp_token *, const uchar *); +static void save_comment (cpp_reader *, cpp_token *, const uchar *, cppchar_t); +static void create_literal (cpp_reader *, cpp_token *, const uchar *, + unsigned int, enum cpp_ttype); +static bool warn_in_comment (cpp_reader *, _cpp_line_note *); +static int name_p (cpp_reader *, const cpp_string *); +static tokenrun *next_tokenrun (tokenrun *); + +static _cpp_buff *new_buff (size_t); + + +/* Utility routine: + + Compares, the token TOKEN to the NUL-terminated string STRING. + TOKEN must be a CPP_NAME. Returns 1 for equal, 0 for unequal. */ +int +cpp_ideq (const cpp_token *token, const char *string) +{ + if (token->type != CPP_NAME) + return 0; + + return !ustrcmp (NODE_NAME (token->val.node), (const uchar *) string); +} + +/* Record a note TYPE at byte POS into the current cleaned logical + line. */ +static void +add_line_note (cpp_buffer *buffer, const uchar *pos, unsigned int type) +{ + if (buffer->notes_used == buffer->notes_cap) + { + buffer->notes_cap = buffer->notes_cap * 2 + 200; + buffer->notes = xrealloc (buffer->notes, + buffer->notes_cap * sizeof (_cpp_line_note)); + } + + buffer->notes[buffer->notes_used].pos = pos; + buffer->notes[buffer->notes_used].type = type; + buffer->notes_used++; +} + +/* Returns with a logical line that contains no escaped newlines or + trigraphs. This is a time-critical inner loop. */ +void +_cpp_clean_line (cpp_reader *pfile) +{ + cpp_buffer *buffer; + const uchar *s; + uchar c, *d, *p; + + buffer = pfile->buffer; + buffer->cur_note = buffer->notes_used = 0; + buffer->cur = buffer->line_base = buffer->next_line; + buffer->need_line = false; + s = buffer->next_line - 1; + + if (!buffer->from_stage3) + { + /* Short circuit for the common case of an un-escaped line with + no trigraphs. The primary win here is by not writing any + data back to memory until we have to. */ + for (;;) + { + c = *++s; + if (c == '\n' || c == '\r') + { + d = (uchar *) s; + + if (s == buffer->rlimit) + goto done; + + /* DOS line ending? */ + if (c == '\r' && s[1] == '\n') + s++; + + if (s == buffer->rlimit) + goto done; + + /* check for escaped newline */ + p = d; + while (p != buffer->next_line && is_nvspace (p[-1])) + p--; + if (p == buffer->next_line || p[-1] != '\\') + goto done; + + /* Have an escaped newline; process it and proceed to + the slow path. */ + add_line_note (buffer, p - 1, p != d ? ' ' : '\\'); + d = p - 2; + buffer->next_line = p - 1; + break; + } + if (c == '?' && s[1] == '?' && _cpp_trigraph_map[s[2]]) + { + /* Have a trigraph. We may or may not have to convert + it. Add a line note regardless, for -Wtrigraphs. */ + add_line_note (buffer, s, s[2]); + if (CPP_OPTION (pfile, trigraphs)) + { + /* We do, and that means we have to switch to the + slow path. */ + d = (uchar *) s; + *d = _cpp_trigraph_map[s[2]]; + s += 2; + break; + } + } + } + + + for (;;) + { + c = *++s; + *++d = c; + + if (c == '\n' || c == '\r') + { + /* Handle DOS line endings. */ + if (c == '\r' && s != buffer->rlimit && s[1] == '\n') + s++; + if (s == buffer->rlimit) + break; + + /* Escaped? */ + p = d; + while (p != buffer->next_line && is_nvspace (p[-1])) + p--; + if (p == buffer->next_line || p[-1] != '\\') + break; + + add_line_note (buffer, p - 1, p != d ? ' ': '\\'); + d = p - 2; + buffer->next_line = p - 1; + } + else if (c == '?' && s[1] == '?' && _cpp_trigraph_map[s[2]]) + { + /* Add a note regardless, for the benefit of -Wtrigraphs. */ + add_line_note (buffer, d, s[2]); + if (CPP_OPTION (pfile, trigraphs)) + { + *d = _cpp_trigraph_map[s[2]]; + s += 2; + } + } + } + } + else + { + do + s++; + while (*s != '\n' && *s != '\r'); + d = (uchar *) s; + + /* Handle DOS line endings. */ + if (*s == '\r' && s != buffer->rlimit && s[1] == '\n') + s++; + } + + done: + *d = '\n'; + /* A sentinel note that should never be processed. */ + add_line_note (buffer, d + 1, '\n'); + buffer->next_line = s + 1; +} + +/* Return true if the trigraph indicated by NOTE should be warned + about in a comment. */ +static bool +warn_in_comment (cpp_reader *pfile, _cpp_line_note *note) +{ + const uchar *p; + + /* Within comments we don't warn about trigraphs, unless the + trigraph forms an escaped newline, as that may change + behavior. */ + if (note->type != '/') + return false; + + /* If -trigraphs, then this was an escaped newline iff the next note + is coincident. */ + if (CPP_OPTION (pfile, trigraphs)) + return note[1].pos == note->pos; + + /* Otherwise, see if this forms an escaped newline. */ + p = note->pos + 3; + while (is_nvspace (*p)) + p++; + + /* There might have been escaped newlines between the trigraph and the + newline we found. Hence the position test. */ + return (*p == '\n' && p < note[1].pos); +} + +/* Process the notes created by add_line_note as far as the current + location. */ +void +_cpp_process_line_notes (cpp_reader *pfile, int in_comment) +{ + cpp_buffer *buffer = pfile->buffer; + + for (;;) + { + _cpp_line_note *note = &buffer->notes[buffer->cur_note]; + unsigned int col; + + if (note->pos > buffer->cur) + break; + + buffer->cur_note++; + col = CPP_BUF_COLUMN (buffer, note->pos + 1); + + if (note->type == '\\' || note->type == ' ') + { + if (note->type == ' ' && !in_comment) + cpp_error_with_line (pfile, CPP_DL_WARNING, pfile->line_table->highest_line, col, + "backslash and newline separated by space"); + + if (buffer->next_line > buffer->rlimit) + { + cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->line_table->highest_line, col, + "backslash-newline at end of file"); + /* Prevent "no newline at end of file" warning. */ + buffer->next_line = buffer->rlimit; + } + + buffer->line_base = note->pos; + CPP_INCREMENT_LINE (pfile, 0); + } + else if (_cpp_trigraph_map[note->type]) + { + if (CPP_OPTION (pfile, warn_trigraphs) + && (!in_comment || warn_in_comment (pfile, note))) + { + if (CPP_OPTION (pfile, trigraphs)) + cpp_error_with_line (pfile, CPP_DL_WARNING, pfile->line_table->highest_line, col, + "trigraph ??%c converted to %c", + note->type, + (int) _cpp_trigraph_map[note->type]); + else + { + cpp_error_with_line + (pfile, CPP_DL_WARNING, pfile->line_table->highest_line, col, + "trigraph ??%c ignored, use -trigraphs to enable", + note->type); + } + } + } + else + abort (); + } +} + +/* Skip a C-style block comment. We find the end of the comment by + seeing if an asterisk is before every '/' we encounter. Returns + nonzero if comment terminated by EOF, zero otherwise. + + Buffer->cur points to the initial asterisk of the comment. */ +bool +_cpp_skip_block_comment (cpp_reader *pfile) +{ + cpp_buffer *buffer = pfile->buffer; + const uchar *cur = buffer->cur; + uchar c; + + cur++; + if (*cur == '/') + cur++; + + for (;;) + { + /* People like decorating comments with '*', so check for '/' + instead for efficiency. */ + c = *cur++; + + if (c == '/') + { + if (cur[-2] == '*') + break; + + /* Warn about potential nested comments, but not if the '/' + comes immediately before the true comment delimiter. + Don't bother to get it right across escaped newlines. */ + if (CPP_OPTION (pfile, warn_comments) + && cur[0] == '*' && cur[1] != '/') + { + buffer->cur = cur; + cpp_error_with_line (pfile, CPP_DL_WARNING, + pfile->line_table->highest_line, CPP_BUF_COL (buffer), + "\"/*\" within comment"); + } + } + else if (c == '\n') + { + unsigned int cols; + buffer->cur = cur - 1; + _cpp_process_line_notes (pfile, true); + if (buffer->next_line >= buffer->rlimit) + return true; + _cpp_clean_line (pfile); + + cols = buffer->next_line - buffer->line_base; + CPP_INCREMENT_LINE (pfile, cols); + + cur = buffer->cur; + } + } + + buffer->cur = cur; + _cpp_process_line_notes (pfile, true); + return false; +} + +/* Skip a C++ line comment, leaving buffer->cur pointing to the + terminating newline. Handles escaped newlines. Returns nonzero + if a multiline comment. */ +static int +skip_line_comment (cpp_reader *pfile) +{ + cpp_buffer *buffer = pfile->buffer; + unsigned int orig_line = pfile->line_table->highest_line; + + while (*buffer->cur != '\n') + buffer->cur++; + + _cpp_process_line_notes (pfile, true); + return orig_line != pfile->line_table->highest_line; +} + +/* Skips whitespace, saving the next non-whitespace character. */ +static void +skip_whitespace (cpp_reader *pfile, cppchar_t c) +{ + cpp_buffer *buffer = pfile->buffer; + bool saw_NUL = false; + + do + { + /* Horizontal space always OK. */ + if (c == ' ' || c == '\t') + ; + /* Just \f \v or \0 left. */ + else if (c == '\0') + saw_NUL = true; + else if (pfile->state.in_directive && CPP_PEDANTIC (pfile)) + cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->line_table->highest_line, + CPP_BUF_COL (buffer), + "%s in preprocessing directive", + c == '\f' ? "form feed" : "vertical tab"); + + c = *buffer->cur++; + } + /* We only want non-vertical space, i.e. ' ' \t \f \v \0. */ + while (is_nvspace (c)); + + if (saw_NUL) + cpp_error (pfile, CPP_DL_WARNING, "null character(s) ignored"); + + buffer->cur--; +} + +/* See if the characters of a number token are valid in a name (no + '.', '+' or '-'). */ +static int +name_p (cpp_reader *pfile, const cpp_string *string) +{ + unsigned int i; + + for (i = 0; i < string->len; i++) + if (!is_idchar (string->text[i])) + return 0; + + return 1; +} + +/* Returns TRUE if the sequence starting at buffer->cur is invalid in + an identifier. FIRST is TRUE if this starts an identifier. */ +static bool +forms_identifier_p (cpp_reader *pfile, int first) +{ + cpp_buffer *buffer = pfile->buffer; + + if (*buffer->cur == '$') + { + if (!CPP_OPTION (pfile, dollars_in_ident)) + return false; + + buffer->cur++; + if (CPP_OPTION (pfile, warn_dollars) && !pfile->state.skipping) + { + CPP_OPTION (pfile, warn_dollars) = 0; + cpp_error (pfile, CPP_DL_PEDWARN, "'$' in identifier or number"); + } + + return true; + } + + /* Is this a syntactically valid UCN? */ + if (0 && *buffer->cur == '\\' + && (buffer->cur[1] == 'u' || buffer->cur[1] == 'U')) + { + buffer->cur += 2; + if (_cpp_valid_ucn (pfile, &buffer->cur, buffer->rlimit, 1 + !first)) + return true; + buffer->cur -= 2; + } + + return false; +} + +/* Lex an identifier starting at BUFFER->CUR - 1. */ +static cpp_hashnode * +lex_identifier (cpp_reader *pfile, const uchar *base) +{ + cpp_hashnode *result; + const uchar *cur; + + do + { + cur = pfile->buffer->cur; + + /* N.B. ISIDNUM does not include $. */ + while (ISIDNUM (*cur)) + cur++; + + pfile->buffer->cur = cur; + } + while (forms_identifier_p (pfile, false)); + + result = (cpp_hashnode *) + ht_lookup (pfile->hash_table, base, cur - base, HT_ALLOC); + + /* Rarely, identifiers require diagnostics when lexed. */ + if (__builtin_expect ((result->flags & NODE_DIAGNOSTIC) + && !pfile->state.skipping, 0)) + { + /* It is allowed to poison the same identifier twice. */ + if ((result->flags & NODE_POISONED) && !pfile->state.poisoned_ok) + cpp_error (pfile, CPP_DL_ERROR, "attempt to use poisoned \"%s\"", + NODE_NAME (result)); + + /* Constraint 6.10.3.5: __VA_ARGS__ should only appear in the + replacement list of a variadic macro. */ + if (result == pfile->spec_nodes.n__VA_ARGS__ + && !pfile->state.va_args_ok) + cpp_error (pfile, CPP_DL_PEDWARN, + "__VA_ARGS__ can only appear in the expansion" + " of a C99 variadic macro"); + } + + return result; +} + +/* Lex a number to NUMBER starting at BUFFER->CUR - 1. */ +static void +lex_number (cpp_reader *pfile, cpp_string *number) +{ + const uchar *cur; + const uchar *base; + uchar *dest; + + base = pfile->buffer->cur - 1; + do + { + cur = pfile->buffer->cur; + + /* N.B. ISIDNUM does not include $. */ + while (ISIDNUM (*cur) || *cur == '.' || VALID_SIGN (*cur, cur[-1])) + cur++; + + pfile->buffer->cur = cur; + } + while (forms_identifier_p (pfile, false)); + + number->len = cur - base; + dest = _cpp_unaligned_alloc (pfile, number->len + 1); + memcpy (dest, base, number->len); + dest[number->len] = '\0'; + number->text = dest; +} + +/* Create a token of type TYPE with a literal spelling. */ +static void +create_literal (cpp_reader *pfile, cpp_token *token, const uchar *base, + unsigned int len, enum cpp_ttype type) +{ + uchar *dest = _cpp_unaligned_alloc (pfile, len + 1); + + memcpy (dest, base, len); + dest[len] = '\0'; + token->type = type; + token->val.str.len = len; + token->val.str.text = dest; +} + +/* Lexes a string, character constant, or angle-bracketed header file + name. The stored string contains the spelling, including opening + quote and leading any leading 'L'. It returns the type of the + literal, or CPP_OTHER if it was not properly terminated. + + The spelling is NUL-terminated, but it is not guaranteed that this + is the first NUL since embedded NULs are preserved. */ +static void +lex_string (cpp_reader *pfile, cpp_token *token, const uchar *base) +{ + bool saw_NUL = false; + const uchar *cur; + cppchar_t terminator; + enum cpp_ttype type; + + cur = base; + terminator = *cur++; + if (terminator == 'L') + terminator = *cur++; + if (terminator == '\"') + type = *base == 'L' ? CPP_WSTRING: CPP_STRING; + else if (terminator == '\'') + type = *base == 'L' ? CPP_WCHAR: CPP_CHAR; + else + terminator = '>', type = CPP_HEADER_NAME; + + for (;;) + { + cppchar_t c = *cur++; + + /* In #include-style directives, terminators are not escapable. */ + if (c == '\\' && !pfile->state.angled_headers && *cur != '\n') + cur++; + else if (c == terminator) + break; + else if (c == '\n') + { + cur--; + type = CPP_OTHER; + break; + } + else if (c == '\0') + saw_NUL = true; + } + + if (saw_NUL && !pfile->state.skipping) + cpp_error (pfile, CPP_DL_WARNING, + "null character(s) preserved in literal"); + + pfile->buffer->cur = cur; + create_literal (pfile, token, base, cur - base, type); +} + +/* The stored comment includes the comment start and any terminator. */ +static void +save_comment (cpp_reader *pfile, cpp_token *token, const unsigned char *from, + cppchar_t type) +{ + unsigned char *buffer; + unsigned int len, clen; + + len = pfile->buffer->cur - from + 1; /* + 1 for the initial '/'. */ + + /* C++ comments probably (not definitely) have moved past a new + line, which we don't want to save in the comment. */ + if (is_vspace (pfile->buffer->cur[-1])) + len--; + + /* If we are currently in a directive, then we need to store all + C++ comments as C comments internally, and so we need to + allocate a little extra space in that case. + + Note that the only time we encounter a directive here is + when we are saving comments in a "#define". */ + clen = (pfile->state.in_directive && type == '/') ? len + 2 : len; + + buffer = _cpp_unaligned_alloc (pfile, clen); + + token->type = CPP_COMMENT; + token->val.str.len = clen; + token->val.str.text = buffer; + + buffer[0] = '/'; + memcpy (buffer + 1, from, len - 1); + + /* Finish conversion to a C comment, if necessary. */ + if (pfile->state.in_directive && type == '/') + { + buffer[1] = '*'; + buffer[clen - 2] = '*'; + buffer[clen - 1] = '/'; + } +} + +/* Allocate COUNT tokens for RUN. */ +void +_cpp_init_tokenrun (tokenrun *run, unsigned int count) +{ + run->base = xnewvec (cpp_token, count); + run->limit = run->base + count; + run->next = NULL; +} + +/* Returns the next tokenrun, or creates one if there is none. */ +static tokenrun * +next_tokenrun (tokenrun *run) +{ + if (run->next == NULL) + { + run->next = xnew (tokenrun); + run->next->prev = run; + _cpp_init_tokenrun (run->next, 250); + } + + return run->next; +} + +/* Allocate a single token that is invalidated at the same time as the + rest of the tokens on the line. Has its line and col set to the + same as the last lexed token, so that diagnostics appear in the + right place. */ +cpp_token * +_cpp_temp_token (cpp_reader *pfile) +{ + cpp_token *old, *result; + + old = pfile->cur_token - 1; + if (pfile->cur_token == pfile->cur_run->limit) + { + pfile->cur_run = next_tokenrun (pfile->cur_run); + pfile->cur_token = pfile->cur_run->base; + } + + result = pfile->cur_token++; + result->src_loc = old->src_loc; + return result; +} + +/* Lex a token into RESULT (external interface). Takes care of issues + like directive handling, token lookahead, multiple include + optimization and skipping. */ +const cpp_token * +_cpp_lex_token (cpp_reader *pfile) +{ + cpp_token *result; + + for (;;) + { + if (pfile->cur_token == pfile->cur_run->limit) + { + pfile->cur_run = next_tokenrun (pfile->cur_run); + pfile->cur_token = pfile->cur_run->base; + } + + if (pfile->lookaheads) + { + pfile->lookaheads--; + result = pfile->cur_token++; + } + else + result = _cpp_lex_direct (pfile); + + if (result->flags & BOL) + { + /* Is this a directive. If _cpp_handle_directive returns + false, it is an assembler #. */ + if (result->type == CPP_HASH + /* 6.10.3 p 11: Directives in a list of macro arguments + gives undefined behavior. This implementation + handles the directive as normal. */ + && pfile->state.parsing_args != 1 + && _cpp_handle_directive (pfile, result->flags & PREV_WHITE)) + continue; + if (pfile->cb.line_change && !pfile->state.skipping) + pfile->cb.line_change (pfile, result, pfile->state.parsing_args); + } + + /* We don't skip tokens in directives. */ + if (pfile->state.in_directive) + break; + + /* Outside a directive, invalidate controlling macros. At file + EOF, _cpp_lex_direct takes care of popping the buffer, so we never + get here and MI optimization works. */ + pfile->mi_valid = false; + + if (!pfile->state.skipping || result->type == CPP_EOF) + break; + } + + return result; +} + +/* Returns true if a fresh line has been loaded. */ +bool +_cpp_get_fresh_line (cpp_reader *pfile) +{ + int return_at_eof; + + /* We can't get a new line until we leave the current directive. */ + if (pfile->state.in_directive) + return false; + + for (;;) + { + cpp_buffer *buffer = pfile->buffer; + + if (!buffer->need_line) + return true; + + if (buffer->next_line < buffer->rlimit) + { + _cpp_clean_line (pfile); + return true; + } + + /* First, get out of parsing arguments state. */ + if (pfile->state.parsing_args) + return false; + + /* End of buffer. Non-empty files should end in a newline. */ + if (buffer->buf != buffer->rlimit + && buffer->next_line > buffer->rlimit + && !buffer->from_stage3) + { + /* Only warn once. */ + buffer->next_line = buffer->rlimit; + cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->line_table->highest_line, + CPP_BUF_COLUMN (buffer, buffer->cur), + "no newline at end of file"); + } + + return_at_eof = buffer->return_at_eof; + _cpp_pop_buffer (pfile); + if (pfile->buffer == NULL || return_at_eof) + return false; + } +} + +#define IF_NEXT_IS(CHAR, THEN_TYPE, ELSE_TYPE) \ + do \ + { \ + result->type = ELSE_TYPE; \ + if (*buffer->cur == CHAR) \ + buffer->cur++, result->type = THEN_TYPE; \ + } \ + while (0) + +/* Lex a token into pfile->cur_token, which is also incremented, to + get diagnostics pointing to the correct location. + + Does not handle issues such as token lookahead, multiple-include + optimization, directives, skipping etc. This function is only + suitable for use by _cpp_lex_token, and in special cases like + lex_expansion_token which doesn't care for any of these issues. + + When meeting a newline, returns CPP_EOF if parsing a directive, + otherwise returns to the start of the token buffer if permissible. + Returns the location of the lexed token. */ +cpp_token * +_cpp_lex_direct (cpp_reader *pfile) +{ + cppchar_t c; + cpp_buffer *buffer; + const unsigned char *comment_start; + cpp_token *result = pfile->cur_token++; + + fresh_line: + result->flags = 0; + buffer = pfile->buffer; + if (buffer->need_line) + { + if (!_cpp_get_fresh_line (pfile)) + { + result->type = CPP_EOF; + if (!pfile->state.in_directive) + { + /* Tell the compiler the line number of the EOF token. */ + result->src_loc = pfile->line_table->highest_line; + result->flags = BOL; + } + return result; + } + if (!pfile->keep_tokens) + { + pfile->cur_run = &pfile->base_run; + result = pfile->base_run.base; + pfile->cur_token = result + 1; + } + result->flags = BOL; + if (pfile->state.parsing_args == 2) + result->flags |= PREV_WHITE; + } + buffer = pfile->buffer; + update_tokens_line: + result->src_loc = pfile->line_table->highest_line; + + skipped_white: + if (buffer->cur >= buffer->notes[buffer->cur_note].pos + && !pfile->overlaid_buffer) + { + _cpp_process_line_notes (pfile, false); + result->src_loc = pfile->line_table->highest_line; + } + c = *buffer->cur++; + + LINEMAP_POSITION_FOR_COLUMN (result->src_loc, pfile->line_table, + CPP_BUF_COLUMN (buffer, buffer->cur)); + + switch (c) + { + case ' ': case '\t': case '\f': case '\v': case '\0': + result->flags |= PREV_WHITE; + skip_whitespace (pfile, c); + goto skipped_white; + + case '\n': + if (buffer->cur < buffer->rlimit) + CPP_INCREMENT_LINE (pfile, 0); + buffer->need_line = true; + goto fresh_line; + + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + result->type = CPP_NUMBER; + lex_number (pfile, &result->val.str); + break; + + case 'L': + /* 'L' may introduce wide characters or strings. */ + if (*buffer->cur == '\'' || *buffer->cur == '"') + { + lex_string (pfile, result, buffer->cur - 1); + break; + } + /* Fall through. */ + + case '_': + case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': + case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': + case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': + case 's': case 't': case 'u': case 'v': case 'w': case 'x': + case 'y': case 'z': + case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': + case 'G': case 'H': case 'I': case 'J': case 'K': + case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': + case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': + case 'Y': case 'Z': + result->type = CPP_NAME; + result->val.node = lex_identifier (pfile, buffer->cur - 1); + + /* Convert named operators to their proper types. */ + if (result->val.node->flags & NODE_OPERATOR) + { + result->flags |= NAMED_OP; + result->type = result->val.node->directive_index; + } + break; + + case '\'': + case '"': + lex_string (pfile, result, buffer->cur - 1); + break; + + case '/': + /* A potential block or line comment. */ + comment_start = buffer->cur; + c = *buffer->cur; + + if (c == '*') + { + if (_cpp_skip_block_comment (pfile)) + cpp_error (pfile, CPP_DL_ERROR, "unterminated comment"); + } + else if (c == '/' && (CPP_OPTION (pfile, cplusplus_comments) + || cpp_in_system_header (pfile))) + { + /* Warn about comments only if pedantically GNUC89, and not + in system headers. */ + if (CPP_OPTION (pfile, lang) == CLK_GNUC89 && CPP_PEDANTIC (pfile) + && ! buffer->warned_cplusplus_comments) + { + cpp_error (pfile, CPP_DL_PEDWARN, + "C++ style comments are not allowed in ISO C90"); + cpp_error (pfile, CPP_DL_PEDWARN, + "(this will be reported only once per input file)"); + buffer->warned_cplusplus_comments = 1; + } + + if (skip_line_comment (pfile) && CPP_OPTION (pfile, warn_comments)) + cpp_error (pfile, CPP_DL_WARNING, "multi-line comment"); + } + else if (c == '=') + { + buffer->cur++; + result->type = CPP_DIV_EQ; + break; + } + else + { + result->type = CPP_DIV; + break; + } + + if (!pfile->state.save_comments) + { + result->flags |= PREV_WHITE; + goto update_tokens_line; + } + + /* Save the comment as a token in its own right. */ + save_comment (pfile, result, comment_start, c); + break; + + case '<': + if (pfile->state.angled_headers) + { + lex_string (pfile, result, buffer->cur - 1); + break; + } + + result->type = CPP_LESS; + if (*buffer->cur == '=') + buffer->cur++, result->type = CPP_LESS_EQ; + else if (*buffer->cur == '<') + { + buffer->cur++; + IF_NEXT_IS ('=', CPP_LSHIFT_EQ, CPP_LSHIFT); + } + else if (*buffer->cur == '?' && CPP_OPTION (pfile, cplusplus)) + { + buffer->cur++; + IF_NEXT_IS ('=', CPP_MIN_EQ, CPP_MIN); + } + else if (CPP_OPTION (pfile, digraphs)) + { + if (*buffer->cur == ':') + { + buffer->cur++; + result->flags |= DIGRAPH; + result->type = CPP_OPEN_SQUARE; + } + else if (*buffer->cur == '%') + { + buffer->cur++; + result->flags |= DIGRAPH; + result->type = CPP_OPEN_BRACE; + } + } + break; + + case '>': + result->type = CPP_GREATER; + if (*buffer->cur == '=') + buffer->cur++, result->type = CPP_GREATER_EQ; + else if (*buffer->cur == '>') + { + buffer->cur++; + IF_NEXT_IS ('=', CPP_RSHIFT_EQ, CPP_RSHIFT); + } + else if (*buffer->cur == '?' && CPP_OPTION (pfile, cplusplus)) + { + buffer->cur++; + IF_NEXT_IS ('=', CPP_MAX_EQ, CPP_MAX); + } + break; + + case '%': + result->type = CPP_MOD; + if (*buffer->cur == '=') + buffer->cur++, result->type = CPP_MOD_EQ; + else if (CPP_OPTION (pfile, digraphs)) + { + if (*buffer->cur == ':') + { + buffer->cur++; + result->flags |= DIGRAPH; + result->type = CPP_HASH; + if (*buffer->cur == '%' && buffer->cur[1] == ':') + buffer->cur += 2, result->type = CPP_PASTE; + } + else if (*buffer->cur == '>') + { + buffer->cur++; + result->flags |= DIGRAPH; + result->type = CPP_CLOSE_BRACE; + } + } + break; + + case '.': + result->type = CPP_DOT; + if (ISDIGIT (*buffer->cur)) + { + result->type = CPP_NUMBER; + lex_number (pfile, &result->val.str); + } + else if (*buffer->cur == '.' && buffer->cur[1] == '.') + buffer->cur += 2, result->type = CPP_ELLIPSIS; + else if (*buffer->cur == '*' && CPP_OPTION (pfile, cplusplus)) + buffer->cur++, result->type = CPP_DOT_STAR; + break; + + case '+': + result->type = CPP_PLUS; + if (*buffer->cur == '+') + buffer->cur++, result->type = CPP_PLUS_PLUS; + else if (*buffer->cur == '=') + buffer->cur++, result->type = CPP_PLUS_EQ; + break; + + case '-': + result->type = CPP_MINUS; + if (*buffer->cur == '>') + { + buffer->cur++; + result->type = CPP_DEREF; + if (*buffer->cur == '*' && CPP_OPTION (pfile, cplusplus)) + buffer->cur++, result->type = CPP_DEREF_STAR; + } + else if (*buffer->cur == '-') + buffer->cur++, result->type = CPP_MINUS_MINUS; + else if (*buffer->cur == '=') + buffer->cur++, result->type = CPP_MINUS_EQ; + break; + + case '&': + result->type = CPP_AND; + if (*buffer->cur == '&') + buffer->cur++, result->type = CPP_AND_AND; + else if (*buffer->cur == '=') + buffer->cur++, result->type = CPP_AND_EQ; + break; + + case '|': + result->type = CPP_OR; + if (*buffer->cur == '|') + buffer->cur++, result->type = CPP_OR_OR; + else if (*buffer->cur == '=') + buffer->cur++, result->type = CPP_OR_EQ; + break; + + case ':': + result->type = CPP_COLON; + if (*buffer->cur == ':' && CPP_OPTION (pfile, cplusplus)) + buffer->cur++, result->type = CPP_SCOPE; + else if (*buffer->cur == '>' && CPP_OPTION (pfile, digraphs)) + { + buffer->cur++; + result->flags |= DIGRAPH; + result->type = CPP_CLOSE_SQUARE; + } + break; + + case '*': IF_NEXT_IS ('=', CPP_MULT_EQ, CPP_MULT); break; + case '=': IF_NEXT_IS ('=', CPP_EQ_EQ, CPP_EQ); break; + case '!': IF_NEXT_IS ('=', CPP_NOT_EQ, CPP_NOT); break; + case '^': IF_NEXT_IS ('=', CPP_XOR_EQ, CPP_XOR); break; + case '#': IF_NEXT_IS ('#', CPP_PASTE, CPP_HASH); break; + + case '?': result->type = CPP_QUERY; break; + case '~': result->type = CPP_COMPL; break; + case ',': result->type = CPP_COMMA; break; + case '(': result->type = CPP_OPEN_PAREN; break; + case ')': result->type = CPP_CLOSE_PAREN; break; + case '[': result->type = CPP_OPEN_SQUARE; break; + case ']': result->type = CPP_CLOSE_SQUARE; break; + case '{': result->type = CPP_OPEN_BRACE; break; + case '}': result->type = CPP_CLOSE_BRACE; break; + case ';': result->type = CPP_SEMICOLON; break; + + /* @ is a punctuator in Objective-C. */ + case '@': result->type = CPP_ATSIGN; break; + + case '$': + case '\\': + { + const uchar *base = --buffer->cur; + + if (forms_identifier_p (pfile, true)) + { + result->type = CPP_NAME; + result->val.node = lex_identifier (pfile, base); + break; + } + buffer->cur++; + } + + default: + create_literal (pfile, result, buffer->cur - 1, 1, CPP_OTHER); + break; + } + + return result; +} + +/* An upper bound on the number of bytes needed to spell TOKEN. + Does not include preceding whitespace. */ +unsigned int +cpp_token_len (const cpp_token *token) +{ + unsigned int len; + + switch (TOKEN_SPELL (token)) + { + default: len = 4; break; + case SPELL_LITERAL: len = token->val.str.len; break; + case SPELL_IDENT: len = NODE_LEN (token->val.node); break; + } + + return len; +} + +/* Write the spelling of a token TOKEN to BUFFER. The buffer must + already contain the enough space to hold the token's spelling. + Returns a pointer to the character after the last character written. + FIXME: Would be nice if we didn't need the PFILE argument. */ +unsigned char * +cpp_spell_token (cpp_reader *pfile, const cpp_token *token, + unsigned char *buffer) +{ + switch (TOKEN_SPELL (token)) + { + case SPELL_OPERATOR: + { + const unsigned char *spelling; + unsigned char c; + + if (token->flags & DIGRAPH) + spelling + = digraph_spellings[(int) token->type - (int) CPP_FIRST_DIGRAPH]; + else if (token->flags & NAMED_OP) + goto spell_ident; + else + spelling = TOKEN_NAME (token); + + while ((c = *spelling++) != '\0') + *buffer++ = c; + } + break; + + spell_ident: + case SPELL_IDENT: + memcpy (buffer, NODE_NAME (token->val.node), NODE_LEN (token->val.node)); + buffer += NODE_LEN (token->val.node); + break; + + case SPELL_LITERAL: + memcpy (buffer, token->val.str.text, token->val.str.len); + buffer += token->val.str.len; + break; + + case SPELL_NONE: + cpp_error (pfile, CPP_DL_ICE, + "unspellable token %s", TOKEN_NAME (token)); + break; + } + + return buffer; +} + +/* Returns TOKEN spelt as a null-terminated string. The string is + freed when the reader is destroyed. Useful for diagnostics. */ +unsigned char * +cpp_token_as_text (cpp_reader *pfile, const cpp_token *token) +{ + unsigned int len = cpp_token_len (token) + 1; + unsigned char *start = _cpp_unaligned_alloc (pfile, len), *end; + + end = cpp_spell_token (pfile, token, start); + end[0] = '\0'; + + return start; +} + +/* Used by C front ends, which really should move to using + cpp_token_as_text. */ +const char * +cpp_type2name (enum cpp_ttype type) +{ + return (const char *) token_spellings[type].name; +} + +/* Writes the spelling of token to FP, without any preceding space. + Separated from cpp_spell_token for efficiency - to avoid stdio + double-buffering. */ +void +cpp_output_token (const cpp_token *token, FILE *fp) +{ + switch (TOKEN_SPELL (token)) + { + case SPELL_OPERATOR: + { + const unsigned char *spelling; + int c; + + if (token->flags & DIGRAPH) + spelling + = digraph_spellings[(int) token->type - (int) CPP_FIRST_DIGRAPH]; + else if (token->flags & NAMED_OP) + goto spell_ident; + else + spelling = TOKEN_NAME (token); + + c = *spelling; + do + putc (c, fp); + while ((c = *++spelling) != '\0'); + } + break; + + spell_ident: + case SPELL_IDENT: + fwrite (NODE_NAME (token->val.node), 1, NODE_LEN (token->val.node), fp); + break; + + case SPELL_LITERAL: + fwrite (token->val.str.text, 1, token->val.str.len, fp); + break; + + case SPELL_NONE: + /* An error, most probably. */ + break; + } +} + +/* Compare two tokens. */ +int +_cpp_equiv_tokens (const cpp_token *a, const cpp_token *b) +{ + if (a->type == b->type && a->flags == b->flags) + switch (TOKEN_SPELL (a)) + { + default: /* Keep compiler happy. */ + case SPELL_OPERATOR: + return 1; + case SPELL_NONE: + return (a->type != CPP_MACRO_ARG || a->val.arg_no == b->val.arg_no); + case SPELL_IDENT: + return a->val.node == b->val.node; + case SPELL_LITERAL: + return (a->val.str.len == b->val.str.len + && !memcmp (a->val.str.text, b->val.str.text, + a->val.str.len)); + } + + return 0; +} + +/* Returns nonzero if a space should be inserted to avoid an + accidental token paste for output. For simplicity, it is + conservative, and occasionally advises a space where one is not + needed, e.g. "." and ".2". */ +int +cpp_avoid_paste (cpp_reader *pfile, const cpp_token *token1, + const cpp_token *token2) +{ + enum cpp_ttype a = token1->type, b = token2->type; + cppchar_t c; + + if (token1->flags & NAMED_OP) + a = CPP_NAME; + if (token2->flags & NAMED_OP) + b = CPP_NAME; + + c = EOF; + if (token2->flags & DIGRAPH) + c = digraph_spellings[(int) b - (int) CPP_FIRST_DIGRAPH][0]; + else if (token_spellings[b].category == SPELL_OPERATOR) + c = token_spellings[b].name[0]; + + /* Quickly get everything that can paste with an '='. */ + if ((int) a <= (int) CPP_LAST_EQ && c == '=') + return 1; + + switch (a) + { + case CPP_GREATER: return c == '>' || c == '?'; + case CPP_LESS: return c == '<' || c == '?' || c == '%' || c == ':'; + case CPP_PLUS: return c == '+'; + case CPP_MINUS: return c == '-' || c == '>'; + case CPP_DIV: return c == '/' || c == '*'; /* Comments. */ + case CPP_MOD: return c == ':' || c == '>'; + case CPP_AND: return c == '&'; + case CPP_OR: return c == '|'; + case CPP_COLON: return c == ':' || c == '>'; + case CPP_DEREF: return c == '*'; + case CPP_DOT: return c == '.' || c == '%' || b == CPP_NUMBER; + case CPP_HASH: return c == '#' || c == '%'; /* Digraph form. */ + case CPP_NAME: return ((b == CPP_NUMBER + && name_p (pfile, &token2->val.str)) + || b == CPP_NAME + || b == CPP_CHAR || b == CPP_STRING); /* L */ + case CPP_NUMBER: return (b == CPP_NUMBER || b == CPP_NAME + || c == '.' || c == '+' || c == '-'); + /* UCNs */ + case CPP_OTHER: return ((token1->val.str.text[0] == '\\' + && b == CPP_NAME) + || (CPP_OPTION (pfile, objc) + && token1->val.str.text[0] == '@' + && (b == CPP_NAME || b == CPP_STRING))); + default: break; + } + + return 0; +} + +/* Output all the remaining tokens on the current line, and a newline + character, to FP. Leading whitespace is removed. If there are + macros, special token padding is not performed. */ +void +cpp_output_line (cpp_reader *pfile, FILE *fp) +{ + const cpp_token *token; + + token = cpp_get_token (pfile); + while (token->type != CPP_EOF) + { + cpp_output_token (token, fp); + token = cpp_get_token (pfile); + if (token->flags & PREV_WHITE) + putc (' ', fp); + } + + putc ('\n', fp); +} + +/* Memory buffers. Changing these three constants can have a dramatic + effect on performance. The values here are reasonable defaults, + but might be tuned. If you adjust them, be sure to test across a + range of uses of cpplib, including heavy nested function-like macro + expansion. Also check the change in peak memory usage (NJAMD is a + good tool for this). */ +#define MIN_BUFF_SIZE 8000 +#define BUFF_SIZE_UPPER_BOUND(MIN_SIZE) (MIN_BUFF_SIZE + (MIN_SIZE) * 3 / 2) +#define EXTENDED_BUFF_SIZE(BUFF, MIN_EXTRA) \ + (MIN_EXTRA + ((BUFF)->limit - (BUFF)->cur) * 2) + +#if MIN_BUFF_SIZE > BUFF_SIZE_UPPER_BOUND (0) + #error BUFF_SIZE_UPPER_BOUND must be at least as large as MIN_BUFF_SIZE! +#endif + +/* Create a new allocation buffer. Place the control block at the end + of the buffer, so that buffer overflows will cause immediate chaos. */ +static _cpp_buff * +new_buff (size_t len) +{ + _cpp_buff *result; + unsigned char *base; + + if (len < MIN_BUFF_SIZE) + len = MIN_BUFF_SIZE; + len = CPP_ALIGN (len); + + base = xmalloc (len + sizeof (_cpp_buff)); + result = (_cpp_buff *) (base + len); + result->base = base; + result->cur = base; + result->limit = base + len; + result->next = NULL; + return result; +} + +/* Place a chain of unwanted allocation buffers on the free list. */ +void +_cpp_release_buff (cpp_reader *pfile, _cpp_buff *buff) +{ + _cpp_buff *end = buff; + + while (end->next) + end = end->next; + end->next = pfile->free_buffs; + pfile->free_buffs = buff; +} + +/* Return a free buffer of size at least MIN_SIZE. */ +_cpp_buff * +_cpp_get_buff (cpp_reader *pfile, size_t min_size) +{ + _cpp_buff *result, **p; + + for (p = &pfile->free_buffs;; p = &(*p)->next) + { + size_t size; + + if (*p == NULL) + return new_buff (min_size); + result = *p; + size = result->limit - result->base; + /* Return a buffer that's big enough, but don't waste one that's + way too big. */ + if (size >= min_size && size <= BUFF_SIZE_UPPER_BOUND (min_size)) + break; + } + + *p = result->next; + result->next = NULL; + result->cur = result->base; + return result; +} + +/* Creates a new buffer with enough space to hold the uncommitted + remaining bytes of BUFF, and at least MIN_EXTRA more bytes. Copies + the excess bytes to the new buffer. Chains the new buffer after + BUFF, and returns the new buffer. */ +_cpp_buff * +_cpp_append_extend_buff (cpp_reader *pfile, _cpp_buff *buff, size_t min_extra) +{ + size_t size = EXTENDED_BUFF_SIZE (buff, min_extra); + _cpp_buff *new_buff = _cpp_get_buff (pfile, size); + + buff->next = new_buff; + memcpy (new_buff->base, buff->cur, BUFF_ROOM (buff)); + return new_buff; +} + +/* Creates a new buffer with enough space to hold the uncommitted + remaining bytes of the buffer pointed to by BUFF, and at least + MIN_EXTRA more bytes. Copies the excess bytes to the new buffer. + Chains the new buffer before the buffer pointed to by BUFF, and + updates the pointer to point to the new buffer. */ +void +_cpp_extend_buff (cpp_reader *pfile, _cpp_buff **pbuff, size_t min_extra) +{ + _cpp_buff *new_buff, *old_buff = *pbuff; + size_t size = EXTENDED_BUFF_SIZE (old_buff, min_extra); + + new_buff = _cpp_get_buff (pfile, size); + memcpy (new_buff->base, old_buff->cur, BUFF_ROOM (old_buff)); + new_buff->next = old_buff; + *pbuff = new_buff; +} + +/* Free a chain of buffers starting at BUFF. */ +void +_cpp_free_buff (_cpp_buff *buff) +{ + _cpp_buff *next; + + for (; buff; buff = next) + { + next = buff->next; + free (buff->base); + } +} + +/* Allocate permanent, unaligned storage of length LEN. */ +unsigned char * +_cpp_unaligned_alloc (cpp_reader *pfile, size_t len) +{ + _cpp_buff *buff = pfile->u_buff; + unsigned char *result = buff->cur; + + if (len > (size_t) (buff->limit - result)) + { + buff = _cpp_get_buff (pfile, len); + buff->next = pfile->u_buff; + pfile->u_buff = buff; + result = buff->cur; + } + + buff->cur = result + len; + return result; +} + +/* Allocate permanent, unaligned storage of length LEN from a_buff. + That buffer is used for growing allocations when saving macro + replacement lists in a #define, and when parsing an answer to an + assertion in #assert, #unassert or #if (and therefore possibly + whilst expanding macros). It therefore must not be used by any + code that they might call: specifically the lexer and the guts of + the macro expander. + + All existing other uses clearly fit this restriction: storing + registered pragmas during initialization. */ +unsigned char * +_cpp_aligned_alloc (cpp_reader *pfile, size_t len) +{ + _cpp_buff *buff = pfile->a_buff; + unsigned char *result = buff->cur; + + if (len > (size_t) (buff->limit - result)) + { + buff = _cpp_get_buff (pfile, len); + buff->next = pfile->a_buff; + pfile->a_buff = buff; + result = buff->cur; + } + + buff->cur = result + len; + return result; +} diff --git a/libcpp/line-map.c b/libcpp/line-map.c new file mode 100644 index 00000000000..e6dd48df756 --- /dev/null +++ b/libcpp/line-map.c @@ -0,0 +1,344 @@ +/* Map logical line numbers to (source file, line number) pairs. + Copyright (C) 2001, 2003, 2004 + 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + In other words, you are welcome to use, share and improve this program. + You are forbidden to forbid anyone else to use, share and improve + what you give them. Help stamp out software-hoarding! */ + +#include "config.h" +#include "system.h" +#include "line-map.h" + +static void trace_include (const struct line_maps *, const struct line_map *); + +/* Initialize a line map set. */ + +void +linemap_init (struct line_maps *set) +{ + set->maps = NULL; + set->allocated = 0; + set->used = 0; + set->last_listed = -1; + set->trace_includes = false; + set->depth = 0; + set->cache = 0; + set->highest_location = 0; + set->highest_line = 0; + set->max_column_hint = 0; +} + +/* Check for and warn about line_maps entered but not exited. */ + +void +linemap_check_files_exited (struct line_maps *set) +{ + struct line_map *map; + /* Depending upon whether we are handling preprocessed input or + not, this can be a user error or an ICE. */ + for (map = &set->maps[set->used - 1]; ! MAIN_FILE_P (map); + map = INCLUDED_FROM (set, map)) + fprintf (stderr, "line-map.c: file \"%s\" entered but not left\n", + map->to_file); +} + +/* Free a line map set. */ + +void +linemap_free (struct line_maps *set) +{ + if (set->maps) + { + linemap_check_files_exited (set); + + free (set->maps); + } +} + +/* Add a mapping of logical source line to physical source file and + line number. + + The text pointed to by TO_FILE must have a lifetime + at least as long as the final call to lookup_line (). An empty + TO_FILE means standard input. If reason is LC_LEAVE, and + TO_FILE is NULL, then TO_FILE, TO_LINE and SYSP are given their + natural values considering the file we are returning to. + + FROM_LINE should be monotonic increasing across calls to this + function. A call to this function can relocate the previous set of + A call to this function can relocate the previous set of + maps, so any stored line_map pointers should not be used. */ + +const struct line_map * +linemap_add (struct line_maps *set, enum lc_reason reason, + unsigned int sysp, const char *to_file, unsigned int to_line) +{ + struct line_map *map; + source_location start_location = set->highest_location + 1; + + if (set->used && start_location < set->maps[set->used - 1].start_location) + abort (); + + if (set->used == set->allocated) + { + set->allocated = 2 * set->allocated + 256; + set->maps = xrealloc (set->maps, set->allocated * sizeof (struct line_map)); + } + + map = &set->maps[set->used]; + + if (to_file && *to_file == '\0') + to_file = "<stdin>"; + + /* If we don't keep our line maps consistent, we can easily + segfault. Don't rely on the client to do it for us. */ + if (set->depth == 0) + reason = LC_ENTER; + else if (reason == LC_LEAVE) + { + struct line_map *from; + bool error; + + if (MAIN_FILE_P (map - 1)) + { + if (to_file == NULL) + { + set->depth--; + return NULL; + } + error = true; + reason = LC_RENAME; + from = map - 1; + } + else + { + from = INCLUDED_FROM (set, map - 1); + error = to_file && strcmp (from->to_file, to_file); + } + + /* Depending upon whether we are handling preprocessed input or + not, this can be a user error or an ICE. */ + if (error) + fprintf (stderr, "line-map.c: file \"%s\" left but not entered\n", + to_file); + + /* A TO_FILE of NULL is special - we use the natural values. */ + if (error || to_file == NULL) + { + to_file = from->to_file; + to_line = SOURCE_LINE (from, from[1].start_location); + sysp = from->sysp; + } + } + + map->reason = reason; + map->sysp = sysp; + map->start_location = start_location; + map->to_file = to_file; + map->to_line = to_line; + set->cache = set->used++; + map->column_bits = 0; + set->highest_location = start_location; + set->highest_line = start_location; + set->max_column_hint = 0; + + if (reason == LC_ENTER) + { + map->included_from = set->depth == 0 ? -1 : (int) (set->used - 2); + set->depth++; + if (set->trace_includes) + trace_include (set, map); + } + else if (reason == LC_RENAME) + map->included_from = map[-1].included_from; + else if (reason == LC_LEAVE) + { + set->depth--; + map->included_from = INCLUDED_FROM (set, map - 1)->included_from; + } + + return map; +} + +source_location +linemap_line_start (struct line_maps *set, unsigned int to_line, + unsigned int max_column_hint) +{ + struct line_map *map = &set->maps[set->used - 1]; + source_location highest = set->highest_location; + source_location r; + unsigned int last_line = SOURCE_LINE (map, set->highest_line); + int line_delta = to_line - last_line; + bool add_map = false; + if (line_delta < 0 + || (line_delta > 10 && line_delta * map->column_bits > 1000) + || (max_column_hint >= (1U << map->column_bits)) + || (max_column_hint <= 80 && map->column_bits >= 10)) + { + add_map = true; + } + else + max_column_hint = set->max_column_hint; + if (add_map) + { + int column_bits; + if (max_column_hint > 100000 || highest > 0xC0000000) + { + max_column_hint = 0; + if (highest >0xF0000000) + return 0; + column_bits = 0; + } + else + { + column_bits = 7; + while (max_column_hint >= (1U << column_bits)) + column_bits++; + max_column_hint = 1U << column_bits; + } + if (line_delta < 0 + || last_line != map->to_line + || SOURCE_COLUMN (map, highest) >= (1U << column_bits)) + map = (struct line_map*) linemap_add (set, LC_RENAME, map->sysp, + map->to_file, to_line); + map->column_bits = column_bits; + r = map->start_location; + } + else + r = highest - SOURCE_COLUMN (map, highest) + + (line_delta << map->column_bits); + set->highest_line = r; + if (r > set->highest_location) + set->highest_location = r; + set->max_column_hint = max_column_hint; + return r; +} + +source_location +linemap_position_for_column (struct line_maps *set, unsigned int to_column) +{ + source_location r = set->highest_line; + if (to_column >= set->max_column_hint) + { + if (r >= 0xC000000 || to_column > 100000) + { + /* Running low on source_locations - disable column numbers. */ + return r; + } + else + { + struct line_map *map = &set->maps[set->used - 1]; + r = linemap_line_start (set, SOURCE_LINE (map, r), to_column + 50); + } + } + r = r + to_column; + if (r >= set->highest_location) + set->highest_location = r; + return r; +} + +/* Given a logical line, returns the map from which the corresponding + (source file, line) pair can be deduced. Since the set is built + chronologically, the logical lines are monotonic increasing, and so + the list is sorted and we can use a binary search. */ + +const struct line_map * +linemap_lookup (struct line_maps *set, source_location line) +{ + unsigned int md, mn, mx; + const struct line_map *cached; + + mn = set->cache; + mx = set->used; + + cached = &set->maps[mn]; + /* We should get a segfault if no line_maps have been added yet. */ + if (line >= cached->start_location) + { + if (mn + 1 == mx || line < cached[1].start_location) + return cached; + } + else + { + mx = mn; + mn = 0; + } + + while (mx - mn > 1) + { + md = (mn + mx) / 2; + if (set->maps[md].start_location > line) + mx = md; + else + mn = md; + } + + set->cache = mn; + return &set->maps[mn]; +} + +/* Print the file names and line numbers of the #include commands + which led to the map MAP, if any, to stderr. Nothing is output if + the most recently listed stack is the same as the current one. */ + +void +linemap_print_containing_files (struct line_maps *set, + const struct line_map *map) +{ + if (MAIN_FILE_P (map) || set->last_listed == map->included_from) + return; + + set->last_listed = map->included_from; + map = INCLUDED_FROM (set, map); + + fprintf (stderr, _("In file included from %s:%u"), + map->to_file, LAST_SOURCE_LINE (map)); + + while (! MAIN_FILE_P (map)) + { + map = INCLUDED_FROM (set, map); + /* Translators note: this message is used in conjunction + with "In file included from %s:%ld" and some other + tricks. We want something like this: + + | In file included from sys/select.h:123, + | from sys/types.h:234, + | from userfile.c:31: + | bits/select.h:45: <error message here> + + with all the "from"s lined up. + The trailing comma is at the beginning of this message, + and the trailing colon is not translated. */ + fprintf (stderr, _(",\n from %s:%u"), + map->to_file, LAST_SOURCE_LINE (map)); + } + + fputs (":\n", stderr); +} + +/* Print an include trace, for e.g. the -H option of the preprocessor. */ + +static void +trace_include (const struct line_maps *set, const struct line_map *map) +{ + unsigned int i = set->depth; + + while (--i) + putc ('.', stderr); + fprintf (stderr, " %s\n", map->to_file); +} diff --git a/libcpp/macro.c b/libcpp/macro.c new file mode 100644 index 00000000000..842c15c38f0 --- /dev/null +++ b/libcpp/macro.c @@ -0,0 +1,1729 @@ +/* Part of CPP library. (Macro and #define handling.) + Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1998, + 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Written by Per Bothner, 1994. + Based on CCCP program by Paul Rubin, June 1986 + Adapted to ANSI C, Richard Stallman, Jan 1987 + +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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + In other words, you are welcome to use, share and improve this program. + You are forbidden to forbid anyone else to use, share and improve + what you give them. Help stamp out software-hoarding! */ + +#include "config.h" +#include "system.h" +#include "cpplib.h" +#include "internal.h" + +typedef struct macro_arg macro_arg; +struct macro_arg +{ + const cpp_token **first; /* First token in unexpanded argument. */ + const cpp_token **expanded; /* Macro-expanded argument. */ + const cpp_token *stringified; /* Stringified argument. */ + unsigned int count; /* # of tokens in argument. */ + unsigned int expanded_count; /* # of tokens in expanded argument. */ +}; + +/* Macro expansion. */ + +static int enter_macro_context (cpp_reader *, cpp_hashnode *); +static int builtin_macro (cpp_reader *, cpp_hashnode *); +static void push_token_context (cpp_reader *, cpp_hashnode *, + const cpp_token *, unsigned int); +static void push_ptoken_context (cpp_reader *, cpp_hashnode *, _cpp_buff *, + const cpp_token **, unsigned int); +static _cpp_buff *collect_args (cpp_reader *, const cpp_hashnode *); +static cpp_context *next_context (cpp_reader *); +static const cpp_token *padding_token (cpp_reader *, const cpp_token *); +static void expand_arg (cpp_reader *, macro_arg *); +static const cpp_token *new_string_token (cpp_reader *, uchar *, unsigned int); +static const cpp_token *stringify_arg (cpp_reader *, macro_arg *); +static void paste_all_tokens (cpp_reader *, const cpp_token *); +static bool paste_tokens (cpp_reader *, const cpp_token **, const cpp_token *); +static void replace_args (cpp_reader *, cpp_hashnode *, cpp_macro *, + macro_arg *); +static _cpp_buff *funlike_invocation_p (cpp_reader *, cpp_hashnode *); +static bool create_iso_definition (cpp_reader *, cpp_macro *); + +/* #define directive parsing and handling. */ + +static cpp_token *alloc_expansion_token (cpp_reader *, cpp_macro *); +static cpp_token *lex_expansion_token (cpp_reader *, cpp_macro *); +static bool warn_of_redefinition (cpp_reader *, const cpp_hashnode *, + const cpp_macro *); +static bool parse_params (cpp_reader *, cpp_macro *); +static void check_trad_stringification (cpp_reader *, const cpp_macro *, + const cpp_string *); + +/* Emits a warning if NODE is a macro defined in the main file that + has not been used. */ +int +_cpp_warn_if_unused_macro (cpp_reader *pfile, cpp_hashnode *node, + void *v ATTRIBUTE_UNUSED) +{ + if (node->type == NT_MACRO && !(node->flags & NODE_BUILTIN)) + { + cpp_macro *macro = node->value.macro; + + if (!macro->used + && MAIN_FILE_P (linemap_lookup (pfile->line_table, macro->line))) + cpp_error_with_line (pfile, CPP_DL_WARNING, macro->line, 0, + "macro \"%s\" is not used", NODE_NAME (node)); + } + + return 1; +} + +/* Allocates and returns a CPP_STRING token, containing TEXT of length + LEN, after null-terminating it. TEXT must be in permanent storage. */ +static const cpp_token * +new_string_token (cpp_reader *pfile, unsigned char *text, unsigned int len) +{ + cpp_token *token = _cpp_temp_token (pfile); + + text[len] = '\0'; + token->type = CPP_STRING; + token->val.str.len = len; + token->val.str.text = text; + token->flags = 0; + return token; +} + +static const char * const monthnames[] = +{ + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" +}; + +/* Handle builtin macros like __FILE__, and push the resulting token + on the context stack. Also handles _Pragma, for which no new token + is created. Returns 1 if it generates a new token context, 0 to + return the token to the caller. */ +const uchar * +_cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node) +{ + const struct line_map *map; + const uchar *result = NULL; + unsigned int number = 1; + + switch (node->value.builtin) + { + default: + cpp_error (pfile, CPP_DL_ICE, "invalid built-in macro \"%s\"", + NODE_NAME (node)); + break; + + case BT_FILE: + case BT_BASE_FILE: + { + unsigned int len; + const char *name; + uchar *buf; + map = linemap_lookup (pfile->line_table, pfile->line_table->highest_line); + + if (node->value.builtin == BT_BASE_FILE) + while (! MAIN_FILE_P (map)) + map = INCLUDED_FROM (pfile->line_table, map); + + name = map->to_file; + len = strlen (name); + buf = _cpp_unaligned_alloc (pfile, len * 4 + 3); + result = buf; + *buf = '"'; + buf = cpp_quote_string (buf + 1, (const unsigned char *) name, len); + *buf++ = '"'; + *buf = '\0'; + } + break; + + case BT_INCLUDE_LEVEL: + /* The line map depth counts the primary source as level 1, but + historically __INCLUDE_DEPTH__ has called the primary source + level 0. */ + number = pfile->line_table->depth - 1; + break; + + case BT_SPECLINE: + map = &pfile->line_table->maps[pfile->line_table->used-1]; + /* If __LINE__ is embedded in a macro, it must expand to the + line of the macro's invocation, not its definition. + Otherwise things like assert() will not work properly. */ + if (CPP_OPTION (pfile, traditional)) + number = pfile->line_table->highest_line; + else + number = pfile->cur_token[-1].src_loc; + number = SOURCE_LINE (map, number); + break; + + /* __STDC__ has the value 1 under normal circumstances. + However, if (a) we are in a system header, (b) the option + stdc_0_in_system_headers is true (set by target config), and + (c) we are not in strictly conforming mode, then it has the + value 0. */ + case BT_STDC: + { + if (cpp_in_system_header (pfile) + && CPP_OPTION (pfile, stdc_0_in_system_headers) + && !CPP_OPTION (pfile,std)) + number = 0; + else + number = 1; + } + break; + + case BT_DATE: + case BT_TIME: + if (pfile->date == NULL) + { + /* Allocate __DATE__ and __TIME__ strings from permanent + storage. We only do this once, and don't generate them + at init time, because time() and localtime() are very + slow on some systems. */ + time_t tt; + struct tm *tb = NULL; + + /* (time_t) -1 is a legitimate value for "number of seconds + since the Epoch", so we have to do a little dance to + distinguish that from a genuine error. */ + errno = 0; + tt = time(NULL); + if (tt != (time_t)-1 || errno == 0) + tb = localtime (&tt); + + if (tb) + { + pfile->date = _cpp_unaligned_alloc (pfile, + sizeof ("\"Oct 11 1347\"")); + sprintf ((char *) pfile->date, "\"%s %2d %4d\"", + monthnames[tb->tm_mon], tb->tm_mday, + tb->tm_year + 1900); + + pfile->time = _cpp_unaligned_alloc (pfile, + sizeof ("\"12:34:56\"")); + sprintf ((char *) pfile->time, "\"%02d:%02d:%02d\"", + tb->tm_hour, tb->tm_min, tb->tm_sec); + } + else + { + cpp_errno (pfile, CPP_DL_WARNING, + "could not determine date and time"); + + pfile->date = U"\"??? ?? ????\""; + pfile->time = U"\"??:??:??\""; + } + } + + if (node->value.builtin == BT_DATE) + result = pfile->date; + else + result = pfile->time; + break; + } + + if (result == NULL) + { + /* 21 bytes holds all NUL-terminated unsigned 64-bit numbers. */ + result = _cpp_unaligned_alloc (pfile, 21); + sprintf ((char *) result, "%u", number); + } + + return result; +} + +/* Convert builtin macros like __FILE__ to a token and push it on the + context stack. Also handles _Pragma, for which no new token is + created. Returns 1 if it generates a new token context, 0 to + return the token to the caller. */ +static int +builtin_macro (cpp_reader *pfile, cpp_hashnode *node) +{ + const uchar *buf; + size_t len; + char *nbuf; + + if (node->value.builtin == BT_PRAGMA) + { + /* Don't interpret _Pragma within directives. The standard is + not clear on this, but to me this makes most sense. */ + if (pfile->state.in_directive) + return 0; + + _cpp_do__Pragma (pfile); + return 1; + } + + buf = _cpp_builtin_macro_text (pfile, node); + len = ustrlen (buf); + nbuf = alloca (len + 1); + memcpy (nbuf, buf, len); + nbuf[len]='\n'; + + cpp_push_buffer (pfile, (uchar *) nbuf, len, /* from_stage3 */ true); + _cpp_clean_line (pfile); + + /* Set pfile->cur_token as required by _cpp_lex_direct. */ + pfile->cur_token = _cpp_temp_token (pfile); + push_token_context (pfile, NULL, _cpp_lex_direct (pfile), 1); + if (pfile->buffer->cur != pfile->buffer->rlimit) + cpp_error (pfile, CPP_DL_ICE, "invalid built-in macro \"%s\"", + NODE_NAME (node)); + _cpp_pop_buffer (pfile); + + return 1; +} + +/* Copies SRC, of length LEN, to DEST, adding backslashes before all + backslashes and double quotes. Non-printable characters are + converted to octal. DEST must be of sufficient size. Returns + a pointer to the end of the string. */ +uchar * +cpp_quote_string (uchar *dest, const uchar *src, unsigned int len) +{ + while (len--) + { + uchar c = *src++; + + if (c == '\\' || c == '"') + { + *dest++ = '\\'; + *dest++ = c; + } + else + { + if (ISPRINT (c)) + *dest++ = c; + else + { + sprintf ((char *) dest, "\\%03o", c); + dest += 4; + } + } + } + + return dest; +} + +/* Convert a token sequence ARG to a single string token according to + the rules of the ISO C #-operator. */ +static const cpp_token * +stringify_arg (cpp_reader *pfile, macro_arg *arg) +{ + unsigned char *dest; + unsigned int i, escape_it, backslash_count = 0; + const cpp_token *source = NULL; + size_t len; + + if (BUFF_ROOM (pfile->u_buff) < 3) + _cpp_extend_buff (pfile, &pfile->u_buff, 3); + dest = BUFF_FRONT (pfile->u_buff); + *dest++ = '"'; + + /* Loop, reading in the argument's tokens. */ + for (i = 0; i < arg->count; i++) + { + const cpp_token *token = arg->first[i]; + + if (token->type == CPP_PADDING) + { + if (source == NULL) + source = token->val.source; + continue; + } + + escape_it = (token->type == CPP_STRING || token->type == CPP_WSTRING + || token->type == CPP_CHAR || token->type == CPP_WCHAR); + + /* Room for each char being written in octal, initial space and + final quote and NUL. */ + len = cpp_token_len (token); + if (escape_it) + len *= 4; + len += 3; + + if ((size_t) (BUFF_LIMIT (pfile->u_buff) - dest) < len) + { + size_t len_so_far = dest - BUFF_FRONT (pfile->u_buff); + _cpp_extend_buff (pfile, &pfile->u_buff, len); + dest = BUFF_FRONT (pfile->u_buff) + len_so_far; + } + + /* Leading white space? */ + if (dest - 1 != BUFF_FRONT (pfile->u_buff)) + { + if (source == NULL) + source = token; + if (source->flags & PREV_WHITE) + *dest++ = ' '; + } + source = NULL; + + if (escape_it) + { + _cpp_buff *buff = _cpp_get_buff (pfile, len); + unsigned char *buf = BUFF_FRONT (buff); + len = cpp_spell_token (pfile, token, buf) - buf; + dest = cpp_quote_string (dest, buf, len); + _cpp_release_buff (pfile, buff); + } + else + dest = cpp_spell_token (pfile, token, dest); + + if (token->type == CPP_OTHER && token->val.str.text[0] == '\\') + backslash_count++; + else + backslash_count = 0; + } + + /* Ignore the final \ of invalid string literals. */ + if (backslash_count & 1) + { + cpp_error (pfile, CPP_DL_WARNING, + "invalid string literal, ignoring final '\\'"); + dest--; + } + + /* Commit the memory, including NUL, and return the token. */ + *dest++ = '"'; + len = dest - BUFF_FRONT (pfile->u_buff); + BUFF_FRONT (pfile->u_buff) = dest + 1; + return new_string_token (pfile, dest - len, len); +} + +/* Try to paste two tokens. On success, return nonzero. In any + case, PLHS is updated to point to the pasted token, which is + guaranteed to not have the PASTE_LEFT flag set. */ +static bool +paste_tokens (cpp_reader *pfile, const cpp_token **plhs, const cpp_token *rhs) +{ + unsigned char *buf, *end; + const cpp_token *lhs; + unsigned int len; + bool valid; + + lhs = *plhs; + len = cpp_token_len (lhs) + cpp_token_len (rhs) + 1; + buf = alloca (len); + end = cpp_spell_token (pfile, lhs, buf); + + /* Avoid comment headers, since they are still processed in stage 3. + It is simpler to insert a space here, rather than modifying the + lexer to ignore comments in some circumstances. Simply returning + false doesn't work, since we want to clear the PASTE_LEFT flag. */ + if (lhs->type == CPP_DIV && rhs->type != CPP_EQ) + *end++ = ' '; + end = cpp_spell_token (pfile, rhs, end); + *end = '\n'; + + cpp_push_buffer (pfile, buf, end - buf, /* from_stage3 */ true); + _cpp_clean_line (pfile); + + /* Set pfile->cur_token as required by _cpp_lex_direct. */ + pfile->cur_token = _cpp_temp_token (pfile); + *plhs = _cpp_lex_direct (pfile); + valid = pfile->buffer->cur == pfile->buffer->rlimit; + _cpp_pop_buffer (pfile); + + return valid; +} + +/* Handles an arbitrarily long sequence of ## operators, with initial + operand LHS. This implementation is left-associative, + non-recursive, and finishes a paste before handling succeeding + ones. If a paste fails, we back up to the RHS of the failing ## + operator before pushing the context containing the result of prior + successful pastes, with the effect that the RHS appears in the + output stream after the pasted LHS normally. */ +static void +paste_all_tokens (cpp_reader *pfile, const cpp_token *lhs) +{ + const cpp_token *rhs; + cpp_context *context = pfile->context; + + do + { + /* Take the token directly from the current context. We can do + this, because we are in the replacement list of either an + object-like macro, or a function-like macro with arguments + inserted. In either case, the constraints to #define + guarantee we have at least one more token. */ + if (context->direct_p) + rhs = FIRST (context).token++; + else + rhs = *FIRST (context).ptoken++; + + if (rhs->type == CPP_PADDING) + abort (); + + if (!paste_tokens (pfile, &lhs, rhs)) + { + _cpp_backup_tokens (pfile, 1); + + /* Mandatory error for all apart from assembler. */ + if (CPP_OPTION (pfile, lang) != CLK_ASM) + cpp_error (pfile, CPP_DL_ERROR, + "pasting \"%s\" and \"%s\" does not give a valid preprocessing token", + cpp_token_as_text (pfile, lhs), + cpp_token_as_text (pfile, rhs)); + break; + } + } + while (rhs->flags & PASTE_LEFT); + + /* Put the resulting token in its own context. */ + push_token_context (pfile, NULL, lhs, 1); +} + +/* Returns TRUE if the number of arguments ARGC supplied in an + invocation of the MACRO referenced by NODE is valid. An empty + invocation to a macro with no parameters should pass ARGC as zero. + + Note that MACRO cannot necessarily be deduced from NODE, in case + NODE was redefined whilst collecting arguments. */ +bool +_cpp_arguments_ok (cpp_reader *pfile, cpp_macro *macro, const cpp_hashnode *node, unsigned int argc) +{ + if (argc == macro->paramc) + return true; + + if (argc < macro->paramc) + { + /* As an extension, a rest argument is allowed to not appear in + the invocation at all. + e.g. #define debug(format, args...) something + debug("string"); + + This is exactly the same as if there had been an empty rest + argument - debug("string", ). */ + + if (argc + 1 == macro->paramc && macro->variadic) + { + if (CPP_PEDANTIC (pfile) && ! macro->syshdr) + cpp_error (pfile, CPP_DL_PEDWARN, + "ISO C99 requires rest arguments to be used"); + return true; + } + + cpp_error (pfile, CPP_DL_ERROR, + "macro \"%s\" requires %u arguments, but only %u given", + NODE_NAME (node), macro->paramc, argc); + } + else + cpp_error (pfile, CPP_DL_ERROR, + "macro \"%s\" passed %u arguments, but takes just %u", + NODE_NAME (node), argc, macro->paramc); + + return false; +} + +/* Reads and returns the arguments to a function-like macro + invocation. Assumes the opening parenthesis has been processed. + If there is an error, emits an appropriate diagnostic and returns + NULL. Each argument is terminated by a CPP_EOF token, for the + future benefit of expand_arg(). */ +static _cpp_buff * +collect_args (cpp_reader *pfile, const cpp_hashnode *node) +{ + _cpp_buff *buff, *base_buff; + cpp_macro *macro; + macro_arg *args, *arg; + const cpp_token *token; + unsigned int argc; + + macro = node->value.macro; + if (macro->paramc) + argc = macro->paramc; + else + argc = 1; + buff = _cpp_get_buff (pfile, argc * (50 * sizeof (cpp_token *) + + sizeof (macro_arg))); + base_buff = buff; + args = (macro_arg *) buff->base; + memset (args, 0, argc * sizeof (macro_arg)); + buff->cur = (unsigned char *) &args[argc]; + arg = args, argc = 0; + + /* Collect the tokens making up each argument. We don't yet know + how many arguments have been supplied, whether too many or too + few. Hence the slightly bizarre usage of "argc" and "arg". */ + do + { + unsigned int paren_depth = 0; + unsigned int ntokens = 0; + + argc++; + arg->first = (const cpp_token **) buff->cur; + + for (;;) + { + /* Require space for 2 new tokens (including a CPP_EOF). */ + if ((unsigned char *) &arg->first[ntokens + 2] > buff->limit) + { + buff = _cpp_append_extend_buff (pfile, buff, + 1000 * sizeof (cpp_token *)); + arg->first = (const cpp_token **) buff->cur; + } + + token = cpp_get_token (pfile); + + if (token->type == CPP_PADDING) + { + /* Drop leading padding. */ + if (ntokens == 0) + continue; + } + else if (token->type == CPP_OPEN_PAREN) + paren_depth++; + else if (token->type == CPP_CLOSE_PAREN) + { + if (paren_depth-- == 0) + break; + } + else if (token->type == CPP_COMMA) + { + /* A comma does not terminate an argument within + parentheses or as part of a variable argument. */ + if (paren_depth == 0 + && ! (macro->variadic && argc == macro->paramc)) + break; + } + else if (token->type == CPP_EOF + || (token->type == CPP_HASH && token->flags & BOL)) + break; + + arg->first[ntokens++] = token; + } + + /* Drop trailing padding. */ + while (ntokens > 0 && arg->first[ntokens - 1]->type == CPP_PADDING) + ntokens--; + + arg->count = ntokens; + arg->first[ntokens] = &pfile->eof; + + /* Terminate the argument. Excess arguments loop back and + overwrite the final legitimate argument, before failing. */ + if (argc <= macro->paramc) + { + buff->cur = (unsigned char *) &arg->first[ntokens + 1]; + if (argc != macro->paramc) + arg++; + } + } + while (token->type != CPP_CLOSE_PAREN && token->type != CPP_EOF); + + if (token->type == CPP_EOF) + { + /* We still need the CPP_EOF to end directives, and to end + pre-expansion of a macro argument. Step back is not + unconditional, since we don't want to return a CPP_EOF to our + callers at the end of an -include-d file. */ + if (pfile->context->prev || pfile->state.in_directive) + _cpp_backup_tokens (pfile, 1); + cpp_error (pfile, CPP_DL_ERROR, + "unterminated argument list invoking macro \"%s\"", + NODE_NAME (node)); + } + else + { + /* A single empty argument is counted as no argument. */ + if (argc == 1 && macro->paramc == 0 && args[0].count == 0) + argc = 0; + if (_cpp_arguments_ok (pfile, macro, node, argc)) + { + /* GCC has special semantics for , ## b where b is a varargs + parameter: we remove the comma if b was omitted entirely. + If b was merely an empty argument, the comma is retained. + If the macro takes just one (varargs) parameter, then we + retain the comma only if we are standards conforming. + + If FIRST is NULL replace_args () swallows the comma. */ + if (macro->variadic && (argc < macro->paramc + || (argc == 1 && args[0].count == 0 + && !CPP_OPTION (pfile, std)))) + args[macro->paramc - 1].first = NULL; + return base_buff; + } + } + + /* An error occurred. */ + _cpp_release_buff (pfile, base_buff); + return NULL; +} + +/* Search for an opening parenthesis to the macro of NODE, in such a + way that, if none is found, we don't lose the information in any + intervening padding tokens. If we find the parenthesis, collect + the arguments and return the buffer containing them. */ +static _cpp_buff * +funlike_invocation_p (cpp_reader *pfile, cpp_hashnode *node) +{ + const cpp_token *token, *padding = NULL; + + for (;;) + { + token = cpp_get_token (pfile); + if (token->type != CPP_PADDING) + break; + if (padding == NULL + || (!(padding->flags & PREV_WHITE) && token->val.source == NULL)) + padding = token; + } + + if (token->type == CPP_OPEN_PAREN) + { + pfile->state.parsing_args = 2; + return collect_args (pfile, node); + } + + /* CPP_EOF can be the end of macro arguments, or the end of the + file. We mustn't back up over the latter. Ugh. */ + if (token->type != CPP_EOF || token == &pfile->eof) + { + /* Back up. We may have skipped padding, in which case backing + up more than one token when expanding macros is in general + too difficult. We re-insert it in its own context. */ + _cpp_backup_tokens (pfile, 1); + if (padding) + push_token_context (pfile, NULL, padding, 1); + } + + return NULL; +} + +/* Push the context of a macro with hash entry NODE onto the context + stack. If we can successfully expand the macro, we push a context + containing its yet-to-be-rescanned replacement list and return one. + Otherwise, we don't push a context and return zero. */ +static int +enter_macro_context (cpp_reader *pfile, cpp_hashnode *node) +{ + /* The presence of a macro invalidates a file's controlling macro. */ + pfile->mi_valid = false; + + pfile->state.angled_headers = false; + + /* Handle standard macros. */ + if (! (node->flags & NODE_BUILTIN)) + { + cpp_macro *macro = node->value.macro; + + if (macro->fun_like) + { + _cpp_buff *buff; + + pfile->state.prevent_expansion++; + pfile->keep_tokens++; + pfile->state.parsing_args = 1; + buff = funlike_invocation_p (pfile, node); + pfile->state.parsing_args = 0; + pfile->keep_tokens--; + pfile->state.prevent_expansion--; + + if (buff == NULL) + { + if (CPP_WTRADITIONAL (pfile) && ! node->value.macro->syshdr) + cpp_error (pfile, CPP_DL_WARNING, + "function-like macro \"%s\" must be used with arguments in traditional C", + NODE_NAME (node)); + + return 0; + } + + if (macro->paramc > 0) + replace_args (pfile, node, macro, (macro_arg *) buff->base); + _cpp_release_buff (pfile, buff); + } + + /* Disable the macro within its expansion. */ + node->flags |= NODE_DISABLED; + + macro->used = 1; + + if (macro->paramc == 0) + push_token_context (pfile, node, macro->exp.tokens, macro->count); + + return 1; + } + + /* Handle built-in macros and the _Pragma operator. */ + return builtin_macro (pfile, node); +} + +/* Replace the parameters in a function-like macro of NODE with the + actual ARGS, and place the result in a newly pushed token context. + Expand each argument before replacing, unless it is operated upon + by the # or ## operators. */ +static void +replace_args (cpp_reader *pfile, cpp_hashnode *node, cpp_macro *macro, macro_arg *args) +{ + unsigned int i, total; + const cpp_token *src, *limit; + const cpp_token **dest, **first; + macro_arg *arg; + _cpp_buff *buff; + + /* First, fully macro-expand arguments, calculating the number of + tokens in the final expansion as we go. The ordering of the if + statements below is subtle; we must handle stringification before + pasting. */ + total = macro->count; + limit = macro->exp.tokens + macro->count; + + for (src = macro->exp.tokens; src < limit; src++) + if (src->type == CPP_MACRO_ARG) + { + /* Leading and trailing padding tokens. */ + total += 2; + + /* We have an argument. If it is not being stringified or + pasted it is macro-replaced before insertion. */ + arg = &args[src->val.arg_no - 1]; + + if (src->flags & STRINGIFY_ARG) + { + if (!arg->stringified) + arg->stringified = stringify_arg (pfile, arg); + } + else if ((src->flags & PASTE_LEFT) + || (src > macro->exp.tokens && (src[-1].flags & PASTE_LEFT))) + total += arg->count - 1; + else + { + if (!arg->expanded) + expand_arg (pfile, arg); + total += arg->expanded_count - 1; + } + } + + /* Now allocate space for the expansion, copy the tokens and replace + the arguments. */ + buff = _cpp_get_buff (pfile, total * sizeof (cpp_token *)); + first = (const cpp_token **) buff->base; + dest = first; + + for (src = macro->exp.tokens; src < limit; src++) + { + unsigned int count; + const cpp_token **from, **paste_flag; + + if (src->type != CPP_MACRO_ARG) + { + *dest++ = src; + continue; + } + + paste_flag = 0; + arg = &args[src->val.arg_no - 1]; + if (src->flags & STRINGIFY_ARG) + count = 1, from = &arg->stringified; + else if (src->flags & PASTE_LEFT) + count = arg->count, from = arg->first; + else if (src != macro->exp.tokens && (src[-1].flags & PASTE_LEFT)) + { + count = arg->count, from = arg->first; + if (dest != first) + { + if (dest[-1]->type == CPP_COMMA + && macro->variadic + && src->val.arg_no == macro->paramc) + { + /* Swallow a pasted comma if from == NULL, otherwise + drop the paste flag. */ + if (from == NULL) + dest--; + else + paste_flag = dest - 1; + } + /* Remove the paste flag if the RHS is a placemarker. */ + else if (count == 0) + paste_flag = dest - 1; + } + } + else + count = arg->expanded_count, from = arg->expanded; + + /* Padding on the left of an argument (unless RHS of ##). */ + if ((!pfile->state.in_directive || pfile->state.directive_wants_padding) + && src != macro->exp.tokens && !(src[-1].flags & PASTE_LEFT)) + *dest++ = padding_token (pfile, src); + + if (count) + { + memcpy (dest, from, count * sizeof (cpp_token *)); + dest += count; + + /* With a non-empty argument on the LHS of ##, the last + token should be flagged PASTE_LEFT. */ + if (src->flags & PASTE_LEFT) + paste_flag = dest - 1; + } + + /* Avoid paste on RHS (even case count == 0). */ + if (!pfile->state.in_directive && !(src->flags & PASTE_LEFT)) + *dest++ = &pfile->avoid_paste; + + /* Add a new paste flag, or remove an unwanted one. */ + if (paste_flag) + { + cpp_token *token = _cpp_temp_token (pfile); + token->type = (*paste_flag)->type; + token->val.str = (*paste_flag)->val.str; + if (src->flags & PASTE_LEFT) + token->flags = (*paste_flag)->flags | PASTE_LEFT; + else + token->flags = (*paste_flag)->flags & ~PASTE_LEFT; + *paste_flag = token; + } + } + + /* Free the expanded arguments. */ + for (i = 0; i < macro->paramc; i++) + if (args[i].expanded) + free (args[i].expanded); + + push_ptoken_context (pfile, node, buff, first, dest - first); +} + +/* Return a special padding token, with padding inherited from SOURCE. */ +static const cpp_token * +padding_token (cpp_reader *pfile, const cpp_token *source) +{ + cpp_token *result = _cpp_temp_token (pfile); + + result->type = CPP_PADDING; + result->val.source = source; + result->flags = 0; + return result; +} + +/* Get a new uninitialized context. Create a new one if we cannot + re-use an old one. */ +static cpp_context * +next_context (cpp_reader *pfile) +{ + cpp_context *result = pfile->context->next; + + if (result == 0) + { + result = xnew (cpp_context); + result->prev = pfile->context; + result->next = 0; + pfile->context->next = result; + } + + pfile->context = result; + return result; +} + +/* Push a list of pointers to tokens. */ +static void +push_ptoken_context (cpp_reader *pfile, cpp_hashnode *macro, _cpp_buff *buff, + const cpp_token **first, unsigned int count) +{ + cpp_context *context = next_context (pfile); + + context->direct_p = false; + context->macro = macro; + context->buff = buff; + FIRST (context).ptoken = first; + LAST (context).ptoken = first + count; +} + +/* Push a list of tokens. */ +static void +push_token_context (cpp_reader *pfile, cpp_hashnode *macro, + const cpp_token *first, unsigned int count) +{ + cpp_context *context = next_context (pfile); + + context->direct_p = true; + context->macro = macro; + context->buff = NULL; + FIRST (context).token = first; + LAST (context).token = first + count; +} + +/* Push a traditional macro's replacement text. */ +void +_cpp_push_text_context (cpp_reader *pfile, cpp_hashnode *macro, + const uchar *start, size_t len) +{ + cpp_context *context = next_context (pfile); + + context->direct_p = true; + context->macro = macro; + context->buff = NULL; + CUR (context) = start; + RLIMIT (context) = start + len; + macro->flags |= NODE_DISABLED; +} + +/* Expand an argument ARG before replacing parameters in a + function-like macro. This works by pushing a context with the + argument's tokens, and then expanding that into a temporary buffer + as if it were a normal part of the token stream. collect_args() + has terminated the argument's tokens with a CPP_EOF so that we know + when we have fully expanded the argument. */ +static void +expand_arg (cpp_reader *pfile, macro_arg *arg) +{ + unsigned int capacity; + bool saved_warn_trad; + + if (arg->count == 0) + return; + + /* Don't warn about funlike macros when pre-expanding. */ + saved_warn_trad = CPP_WTRADITIONAL (pfile); + CPP_WTRADITIONAL (pfile) = 0; + + /* Loop, reading in the arguments. */ + capacity = 256; + arg->expanded = xmalloc (capacity * sizeof (cpp_token *)); + + push_ptoken_context (pfile, NULL, NULL, arg->first, arg->count + 1); + for (;;) + { + const cpp_token *token; + + if (arg->expanded_count + 1 >= capacity) + { + capacity *= 2; + arg->expanded = xrealloc (arg->expanded, + capacity * sizeof (cpp_token *)); + } + + token = cpp_get_token (pfile); + + if (token->type == CPP_EOF) + break; + + arg->expanded[arg->expanded_count++] = token; + } + + _cpp_pop_context (pfile); + + CPP_WTRADITIONAL (pfile) = saved_warn_trad; +} + +/* Pop the current context off the stack, re-enabling the macro if the + context represented a macro's replacement list. The context + structure is not freed so that we can re-use it later. */ +void +_cpp_pop_context (cpp_reader *pfile) +{ + cpp_context *context = pfile->context; + + if (context->macro) + context->macro->flags &= ~NODE_DISABLED; + + if (context->buff) + _cpp_release_buff (pfile, context->buff); + + pfile->context = context->prev; +} + +/* External routine to get a token. Also used nearly everywhere + internally, except for places where we know we can safely call + _cpp_lex_token directly, such as lexing a directive name. + + Macro expansions and directives are transparently handled, + including entering included files. Thus tokens are post-macro + expansion, and after any intervening directives. External callers + see CPP_EOF only at EOF. Internal callers also see it when meeting + a directive inside a macro call, when at the end of a directive and + state.in_directive is still 1, and at the end of argument + pre-expansion. */ +const cpp_token * +cpp_get_token (cpp_reader *pfile) +{ + const cpp_token *result; + + for (;;) + { + cpp_hashnode *node; + cpp_context *context = pfile->context; + + /* Context->prev == 0 <=> base context. */ + if (!context->prev) + result = _cpp_lex_token (pfile); + else if (FIRST (context).token != LAST (context).token) + { + if (context->direct_p) + result = FIRST (context).token++; + else + result = *FIRST (context).ptoken++; + + if (result->flags & PASTE_LEFT) + { + paste_all_tokens (pfile, result); + if (pfile->state.in_directive) + continue; + return padding_token (pfile, result); + } + } + else + { + _cpp_pop_context (pfile); + if (pfile->state.in_directive) + continue; + return &pfile->avoid_paste; + } + + if (pfile->state.in_directive && result->type == CPP_COMMENT) + continue; + + if (result->type != CPP_NAME) + break; + + node = result->val.node; + + if (node->type != NT_MACRO || (result->flags & NO_EXPAND)) + break; + + if (!(node->flags & NODE_DISABLED)) + { + if (!pfile->state.prevent_expansion + && enter_macro_context (pfile, node)) + { + if (pfile->state.in_directive) + continue; + return padding_token (pfile, result); + } + } + else + { + /* Flag this token as always unexpandable. FIXME: move this + to collect_args()?. */ + cpp_token *t = _cpp_temp_token (pfile); + t->type = result->type; + t->flags = result->flags | NO_EXPAND; + t->val.str = result->val.str; + result = t; + } + + break; + } + + return result; +} + +/* Returns true if we're expanding an object-like macro that was + defined in a system header. Just checks the macro at the top of + the stack. Used for diagnostic suppression. */ +int +cpp_sys_macro_p (cpp_reader *pfile) +{ + cpp_hashnode *node = pfile->context->macro; + + return node && node->value.macro && node->value.macro->syshdr; +} + +/* Read each token in, until end of the current file. Directives are + transparently processed. */ +void +cpp_scan_nooutput (cpp_reader *pfile) +{ + /* Request a CPP_EOF token at the end of this file, rather than + transparently continuing with the including file. */ + pfile->buffer->return_at_eof = true; + + if (CPP_OPTION (pfile, traditional)) + while (_cpp_read_logical_line_trad (pfile)) + ; + else + while (cpp_get_token (pfile)->type != CPP_EOF) + ; +} + +/* Step back one (or more) tokens. Can only step mack more than 1 if + they are from the lexer, and not from macro expansion. */ +void +_cpp_backup_tokens (cpp_reader *pfile, unsigned int count) +{ + if (pfile->context->prev == NULL) + { + pfile->lookaheads += count; + while (count--) + { + pfile->cur_token--; + if (pfile->cur_token == pfile->cur_run->base + /* Possible with -fpreprocessed and no leading #line. */ + && pfile->cur_run->prev != NULL) + { + pfile->cur_run = pfile->cur_run->prev; + pfile->cur_token = pfile->cur_run->limit; + } + } + } + else + { + if (count != 1) + abort (); + if (pfile->context->direct_p) + FIRST (pfile->context).token--; + else + FIRST (pfile->context).ptoken--; + } +} + +/* #define directive parsing and handling. */ + +/* Returns nonzero if a macro redefinition warning is required. */ +static bool +warn_of_redefinition (cpp_reader *pfile, const cpp_hashnode *node, + const cpp_macro *macro2) +{ + const cpp_macro *macro1; + unsigned int i; + + /* Some redefinitions need to be warned about regardless. */ + if (node->flags & NODE_WARN) + return true; + + /* Redefinition of a macro is allowed if and only if the old and new + definitions are the same. (6.10.3 paragraph 2). */ + macro1 = node->value.macro; + + /* Don't check count here as it can be different in valid + traditional redefinitions with just whitespace differences. */ + if (macro1->paramc != macro2->paramc + || macro1->fun_like != macro2->fun_like + || macro1->variadic != macro2->variadic) + return true; + + /* Check parameter spellings. */ + for (i = 0; i < macro1->paramc; i++) + if (macro1->params[i] != macro2->params[i]) + return true; + + /* Check the replacement text or tokens. */ + if (CPP_OPTION (pfile, traditional)) + return _cpp_expansions_different_trad (macro1, macro2); + + if (macro1->count != macro2->count) + return true; + + for (i = 0; i < macro1->count; i++) + if (!_cpp_equiv_tokens (¯o1->exp.tokens[i], ¯o2->exp.tokens[i])) + return true; + + return false; +} + +/* Free the definition of hashnode H. */ +void +_cpp_free_definition (cpp_hashnode *h) +{ + /* Macros and assertions no longer have anything to free. */ + h->type = NT_VOID; + /* Clear builtin flag in case of redefinition. */ + h->flags &= ~(NODE_BUILTIN | NODE_DISABLED); +} + +/* Save parameter NODE to the parameter list of macro MACRO. Returns + zero on success, nonzero if the parameter is a duplicate. */ +bool +_cpp_save_parameter (cpp_reader *pfile, cpp_macro *macro, cpp_hashnode *node) +{ + unsigned int len; + /* Constraint 6.10.3.6 - duplicate parameter names. */ + if (node->flags & NODE_MACRO_ARG) + { + cpp_error (pfile, CPP_DL_ERROR, "duplicate macro parameter \"%s\"", + NODE_NAME (node)); + return true; + } + + if (BUFF_ROOM (pfile->a_buff) + < (macro->paramc + 1) * sizeof (cpp_hashnode *)) + _cpp_extend_buff (pfile, &pfile->a_buff, sizeof (cpp_hashnode *)); + + ((cpp_hashnode **) BUFF_FRONT (pfile->a_buff))[macro->paramc++] = node; + node->flags |= NODE_MACRO_ARG; + len = macro->paramc * sizeof (union _cpp_hashnode_value); + if (len > pfile->macro_buffer_len) + { + pfile->macro_buffer = xrealloc (pfile->macro_buffer, len); + pfile->macro_buffer_len = len; + } + ((union _cpp_hashnode_value *) pfile->macro_buffer)[macro->paramc - 1] + = node->value; + + node->value.arg_index = macro->paramc; + return false; +} + +/* Check the syntax of the parameters in a MACRO definition. Returns + false if an error occurs. */ +static bool +parse_params (cpp_reader *pfile, cpp_macro *macro) +{ + unsigned int prev_ident = 0; + + for (;;) + { + const cpp_token *token = _cpp_lex_token (pfile); + + switch (token->type) + { + default: + /* Allow/ignore comments in parameter lists if we are + preserving comments in macro expansions. */ + if (token->type == CPP_COMMENT + && ! CPP_OPTION (pfile, discard_comments_in_macro_exp)) + continue; + + cpp_error (pfile, CPP_DL_ERROR, + "\"%s\" may not appear in macro parameter list", + cpp_token_as_text (pfile, token)); + return false; + + case CPP_NAME: + if (prev_ident) + { + cpp_error (pfile, CPP_DL_ERROR, + "macro parameters must be comma-separated"); + return false; + } + prev_ident = 1; + + if (_cpp_save_parameter (pfile, macro, token->val.node)) + return false; + continue; + + case CPP_CLOSE_PAREN: + if (prev_ident || macro->paramc == 0) + return true; + + /* Fall through to pick up the error. */ + case CPP_COMMA: + if (!prev_ident) + { + cpp_error (pfile, CPP_DL_ERROR, "parameter name missing"); + return false; + } + prev_ident = 0; + continue; + + case CPP_ELLIPSIS: + macro->variadic = 1; + if (!prev_ident) + { + _cpp_save_parameter (pfile, macro, + pfile->spec_nodes.n__VA_ARGS__); + pfile->state.va_args_ok = 1; + if (! CPP_OPTION (pfile, c99) + && CPP_OPTION (pfile, pedantic) + && CPP_OPTION (pfile, warn_variadic_macros)) + cpp_error (pfile, CPP_DL_PEDWARN, + "anonymous variadic macros were introduced in C99"); + } + else if (CPP_OPTION (pfile, pedantic) + && CPP_OPTION (pfile, warn_variadic_macros)) + cpp_error (pfile, CPP_DL_PEDWARN, + "ISO C does not permit named variadic macros"); + + /* We're at the end, and just expect a closing parenthesis. */ + token = _cpp_lex_token (pfile); + if (token->type == CPP_CLOSE_PAREN) + return true; + /* Fall through. */ + + case CPP_EOF: + cpp_error (pfile, CPP_DL_ERROR, "missing ')' in macro parameter list"); + return false; + } + } +} + +/* Allocate room for a token from a macro's replacement list. */ +static cpp_token * +alloc_expansion_token (cpp_reader *pfile, cpp_macro *macro) +{ + if (BUFF_ROOM (pfile->a_buff) < (macro->count + 1) * sizeof (cpp_token)) + _cpp_extend_buff (pfile, &pfile->a_buff, sizeof (cpp_token)); + + return &((cpp_token *) BUFF_FRONT (pfile->a_buff))[macro->count++]; +} + +/* Lex a token from the expansion of MACRO, but mark parameters as we + find them and warn of traditional stringification. */ +static cpp_token * +lex_expansion_token (cpp_reader *pfile, cpp_macro *macro) +{ + cpp_token *token; + + pfile->cur_token = alloc_expansion_token (pfile, macro); + token = _cpp_lex_direct (pfile); + + /* Is this a parameter? */ + if (token->type == CPP_NAME + && (token->val.node->flags & NODE_MACRO_ARG) != 0) + { + token->type = CPP_MACRO_ARG; + token->val.arg_no = token->val.node->value.arg_index; + } + else if (CPP_WTRADITIONAL (pfile) && macro->paramc > 0 + && (token->type == CPP_STRING || token->type == CPP_CHAR)) + check_trad_stringification (pfile, macro, &token->val.str); + + return token; +} + +static bool +create_iso_definition (cpp_reader *pfile, cpp_macro *macro) +{ + cpp_token *token; + const cpp_token *ctoken; + + /* Get the first token of the expansion (or the '(' of a + function-like macro). */ + ctoken = _cpp_lex_token (pfile); + + if (ctoken->type == CPP_OPEN_PAREN && !(ctoken->flags & PREV_WHITE)) + { + bool ok = parse_params (pfile, macro); + macro->params = (cpp_hashnode **) BUFF_FRONT (pfile->a_buff); + if (!ok) + return false; + + /* Success. Commit the parameter array. */ + BUFF_FRONT (pfile->a_buff) = (uchar *) ¯o->params[macro->paramc]; + macro->fun_like = 1; + } + else if (ctoken->type != CPP_EOF && !(ctoken->flags & PREV_WHITE)) + cpp_error (pfile, CPP_DL_PEDWARN, + "ISO C requires whitespace after the macro name"); + + if (macro->fun_like) + token = lex_expansion_token (pfile, macro); + else + { + token = alloc_expansion_token (pfile, macro); + *token = *ctoken; + } + + for (;;) + { + /* Check the stringifying # constraint 6.10.3.2.1 of + function-like macros when lexing the subsequent token. */ + if (macro->count > 1 && token[-1].type == CPP_HASH && macro->fun_like) + { + if (token->type == CPP_MACRO_ARG) + { + token->flags &= ~PREV_WHITE; + token->flags |= STRINGIFY_ARG; + token->flags |= token[-1].flags & PREV_WHITE; + token[-1] = token[0]; + macro->count--; + } + /* Let assembler get away with murder. */ + else if (CPP_OPTION (pfile, lang) != CLK_ASM) + { + cpp_error (pfile, CPP_DL_ERROR, + "'#' is not followed by a macro parameter"); + return false; + } + } + + if (token->type == CPP_EOF) + break; + + /* Paste operator constraint 6.10.3.3.1. */ + if (token->type == CPP_PASTE) + { + /* Token-paste ##, can appear in both object-like and + function-like macros, but not at the ends. */ + if (--macro->count > 0) + token = lex_expansion_token (pfile, macro); + + if (macro->count == 0 || token->type == CPP_EOF) + { + cpp_error (pfile, CPP_DL_ERROR, + "'##' cannot appear at either end of a macro expansion"); + return false; + } + + token[-1].flags |= PASTE_LEFT; + } + + token = lex_expansion_token (pfile, macro); + } + + macro->exp.tokens = (cpp_token *) BUFF_FRONT (pfile->a_buff); + + /* Don't count the CPP_EOF. */ + macro->count--; + + /* Clear whitespace on first token for warn_of_redefinition(). */ + if (macro->count) + macro->exp.tokens[0].flags &= ~PREV_WHITE; + + /* Commit the memory. */ + BUFF_FRONT (pfile->a_buff) = (uchar *) ¯o->exp.tokens[macro->count]; + + return true; +} + +/* Parse a macro and save its expansion. Returns nonzero on success. */ +bool +_cpp_create_definition (cpp_reader *pfile, cpp_hashnode *node) +{ + cpp_macro *macro; + unsigned int i; + bool ok; + + macro = (cpp_macro *) _cpp_aligned_alloc (pfile, sizeof (cpp_macro)); + macro->line = pfile->directive_line; + macro->params = 0; + macro->paramc = 0; + macro->variadic = 0; + macro->used = !CPP_OPTION (pfile, warn_unused_macros); + macro->count = 0; + macro->fun_like = 0; + /* To suppress some diagnostics. */ + macro->syshdr = pfile->buffer && pfile->buffer->sysp != 0; + + if (CPP_OPTION (pfile, traditional)) + ok = _cpp_create_trad_definition (pfile, macro); + else + { + cpp_token *saved_cur_token = pfile->cur_token; + + ok = create_iso_definition (pfile, macro); + + /* Restore lexer position because of games lex_expansion_token() + plays lexing the macro. We set the type for SEEN_EOL() in + cpplib.c. + + Longer term we should lex the whole line before coming here, + and just copy the expansion. */ + saved_cur_token[-1].type = pfile->cur_token[-1].type; + pfile->cur_token = saved_cur_token; + + /* Stop the lexer accepting __VA_ARGS__. */ + pfile->state.va_args_ok = 0; + } + + /* Clear the fast argument lookup indices. */ + for (i = macro->paramc; i-- > 0; ) + { + struct cpp_hashnode *node = macro->params[i]; + node->flags &= ~ NODE_MACRO_ARG; + node->value = ((union _cpp_hashnode_value *) pfile->macro_buffer)[i]; + } + + if (!ok) + return ok; + + if (node->type == NT_MACRO) + { + if (CPP_OPTION (pfile, warn_unused_macros)) + _cpp_warn_if_unused_macro (pfile, node, NULL); + + if (warn_of_redefinition (pfile, node, macro)) + { + cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->directive_line, 0, + "\"%s\" redefined", NODE_NAME (node)); + + if (node->type == NT_MACRO && !(node->flags & NODE_BUILTIN)) + cpp_error_with_line (pfile, CPP_DL_PEDWARN, + node->value.macro->line, 0, + "this is the location of the previous definition"); + } + } + + if (node->type != NT_VOID) + _cpp_free_definition (node); + + /* Enter definition in hash table. */ + node->type = NT_MACRO; + node->value.macro = macro; + if (! ustrncmp (NODE_NAME (node), DSC ("__STDC_"))) + node->flags |= NODE_WARN; + + return ok; +} + +/* Warn if a token in STRING matches one of a function-like MACRO's + parameters. */ +static void +check_trad_stringification (cpp_reader *pfile, const cpp_macro *macro, + const cpp_string *string) +{ + unsigned int i, len; + const uchar *p, *q, *limit; + + /* Loop over the string. */ + limit = string->text + string->len - 1; + for (p = string->text + 1; p < limit; p = q) + { + /* Find the start of an identifier. */ + while (p < limit && !is_idstart (*p)) + p++; + + /* Find the end of the identifier. */ + q = p; + while (q < limit && is_idchar (*q)) + q++; + + len = q - p; + + /* Loop over the function macro arguments to see if the + identifier inside the string matches one of them. */ + for (i = 0; i < macro->paramc; i++) + { + const cpp_hashnode *node = macro->params[i]; + + if (NODE_LEN (node) == len + && !memcmp (p, NODE_NAME (node), len)) + { + cpp_error (pfile, CPP_DL_WARNING, + "macro argument \"%s\" would be stringified in traditional C", + NODE_NAME (node)); + break; + } + } + } +} + +/* Returns the name, arguments and expansion of a macro, in a format + suitable to be read back in again, and therefore also for DWARF 2 + debugging info. e.g. "PASTE(X, Y) X ## Y", or "MACNAME EXPANSION". + Caller is expected to generate the "#define" bit if needed. The + returned text is temporary, and automatically freed later. */ +const unsigned char * +cpp_macro_definition (cpp_reader *pfile, const cpp_hashnode *node) +{ + unsigned int i, len; + const cpp_macro *macro = node->value.macro; + unsigned char *buffer; + + if (node->type != NT_MACRO || (node->flags & NODE_BUILTIN)) + { + cpp_error (pfile, CPP_DL_ICE, + "invalid hash type %d in cpp_macro_definition", node->type); + return 0; + } + + /* Calculate length. */ + len = NODE_LEN (node) + 2; /* ' ' and NUL. */ + if (macro->fun_like) + { + len += 4; /* "()" plus possible final ".." of named + varargs (we have + 1 below). */ + for (i = 0; i < macro->paramc; i++) + len += NODE_LEN (macro->params[i]) + 1; /* "," */ + } + + if (CPP_OPTION (pfile, traditional)) + len += _cpp_replacement_text_len (macro); + else + { + for (i = 0; i < macro->count; i++) + { + cpp_token *token = ¯o->exp.tokens[i]; + + if (token->type == CPP_MACRO_ARG) + len += NODE_LEN (macro->params[token->val.arg_no - 1]); + else + len += cpp_token_len (token) + 1; /* Includes room for ' '. */ + if (token->flags & STRINGIFY_ARG) + len++; /* "#" */ + if (token->flags & PASTE_LEFT) + len += 3; /* " ##" */ + } + } + + if (len > pfile->macro_buffer_len) + { + pfile->macro_buffer = xrealloc (pfile->macro_buffer, len); + pfile->macro_buffer_len = len; + } + + /* Fill in the buffer. Start with the macro name. */ + buffer = pfile->macro_buffer; + memcpy (buffer, NODE_NAME (node), NODE_LEN (node)); + buffer += NODE_LEN (node); + + /* Parameter names. */ + if (macro->fun_like) + { + *buffer++ = '('; + for (i = 0; i < macro->paramc; i++) + { + cpp_hashnode *param = macro->params[i]; + + if (param != pfile->spec_nodes.n__VA_ARGS__) + { + memcpy (buffer, NODE_NAME (param), NODE_LEN (param)); + buffer += NODE_LEN (param); + } + + if (i + 1 < macro->paramc) + /* Don't emit a space after the comma here; we're trying + to emit a Dwarf-friendly definition, and the Dwarf spec + forbids spaces in the argument list. */ + *buffer++ = ','; + else if (macro->variadic) + *buffer++ = '.', *buffer++ = '.', *buffer++ = '.'; + } + *buffer++ = ')'; + } + + /* The Dwarf spec requires a space after the macro name, even if the + definition is the empty string. */ + *buffer++ = ' '; + + if (CPP_OPTION (pfile, traditional)) + buffer = _cpp_copy_replacement_text (macro, buffer); + else if (macro->count) + /* Expansion tokens. */ + { + for (i = 0; i < macro->count; i++) + { + cpp_token *token = ¯o->exp.tokens[i]; + + if (token->flags & PREV_WHITE) + *buffer++ = ' '; + if (token->flags & STRINGIFY_ARG) + *buffer++ = '#'; + + if (token->type == CPP_MACRO_ARG) + { + len = NODE_LEN (macro->params[token->val.arg_no - 1]); + memcpy (buffer, + NODE_NAME (macro->params[token->val.arg_no - 1]), len); + buffer += len; + } + else + buffer = cpp_spell_token (pfile, token, buffer); + + if (token->flags & PASTE_LEFT) + { + *buffer++ = ' '; + *buffer++ = '#'; + *buffer++ = '#'; + /* Next has PREV_WHITE; see _cpp_create_definition. */ + } + } + } + + *buffer = '\0'; + return pfile->macro_buffer; +} diff --git a/libcpp/mkdeps.c b/libcpp/mkdeps.c new file mode 100644 index 00000000000..23af9d83f78 --- /dev/null +++ b/libcpp/mkdeps.c @@ -0,0 +1,345 @@ +/* Dependency generator for Makefile fragments. + Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. + Contributed by Zack Weinberg, Mar 2000 + +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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + In other words, you are welcome to use, share and improve this program. + You are forbidden to forbid anyone else to use, share and improve + what you give them. Help stamp out software-hoarding! */ + +#include "config.h" +#include "system.h" +#include "mkdeps.h" + +/* Keep this structure local to this file, so clients don't find it + easy to start making assumptions. */ +struct deps +{ + const char **targetv; + unsigned int ntargets; /* number of slots actually occupied */ + unsigned int targets_size; /* amt of allocated space - in words */ + + const char **depv; + unsigned int ndeps; + unsigned int deps_size; +}; + +static const char *munge (const char *); + +/* Given a filename, quote characters in that filename which are + significant to Make. Note that it's not possible to quote all such + characters - e.g. \n, %, *, ?, [, \ (in some contexts), and ~ are + not properly handled. It isn't possible to get this right in any + current version of Make. (??? Still true? Old comment referred to + 3.76.1.) */ + +static const char * +munge (const char *filename) +{ + int len; + const char *p, *q; + char *dst, *buffer; + + for (p = filename, len = 0; *p; p++, len++) + { + switch (*p) + { + case ' ': + case '\t': + /* GNU make uses a weird quoting scheme for white space. + A space or tab preceded by 2N+1 backslashes represents + N backslashes followed by space; a space or tab + preceded by 2N backslashes represents N backslashes at + the end of a file name; and backslashes in other + contexts should not be doubled. */ + for (q = p - 1; filename <= q && *q == '\\'; q--) + len++; + len++; + break; + + case '$': + /* '$' is quoted by doubling it. */ + len++; + break; + } + } + + /* Now we know how big to make the buffer. */ + buffer = xmalloc (len + 1); + + for (p = filename, dst = buffer; *p; p++, dst++) + { + switch (*p) + { + case ' ': + case '\t': + for (q = p - 1; filename <= q && *q == '\\'; q--) + *dst++ = '\\'; + *dst++ = '\\'; + break; + + case '$': + *dst++ = '$'; + break; + + default: + /* nothing */; + } + *dst = *p; + } + + *dst = '\0'; + return buffer; +} + +/* Public routines. */ + +struct deps * +deps_init (void) +{ + struct deps *d = xmalloc (sizeof (struct deps)); + + /* Allocate space for the vectors only if we need it. */ + + d->targetv = 0; + d->depv = 0; + + d->ntargets = 0; + d->targets_size = 0; + d->ndeps = 0; + d->deps_size = 0; + + return d; +} + +void +deps_free (struct deps *d) +{ + unsigned int i; + + if (d->targetv) + { + for (i = 0; i < d->ntargets; i++) + free ((void *) d->targetv[i]); + free (d->targetv); + } + + if (d->depv) + { + for (i = 0; i < d->ndeps; i++) + free ((void *) d->depv[i]); + free (d->depv); + } + + free (d); +} + +/* Adds a target T. We make a copy, so it need not be a permanent + string. QUOTE is true if the string should be quoted. */ +void +deps_add_target (struct deps *d, const char *t, int quote) +{ + if (d->ntargets == d->targets_size) + { + d->targets_size = d->targets_size * 2 + 4; + d->targetv = xrealloc (d->targetv, + d->targets_size * sizeof (const char *)); + } + + if (quote) + t = munge (t); /* Also makes permanent copy. */ + else + t = xstrdup (t); + + d->targetv[d->ntargets++] = t; +} + +/* Sets the default target if none has been given already. An empty + string as the default target in interpreted as stdin. The string + is quoted for MAKE. */ +void +deps_add_default_target (struct deps *d, const char *tgt) +{ + /* Only if we have no targets. */ + if (d->ntargets) + return; + + if (tgt[0] == '\0') + deps_add_target (d, "-", 1); + else + { +#ifndef TARGET_OBJECT_SUFFIX +# define TARGET_OBJECT_SUFFIX ".o" +#endif + const char *start = lbasename (tgt); + char *o = alloca (strlen (start) + strlen (TARGET_OBJECT_SUFFIX) + 1); + char *suffix; + + strcpy (o, start); + + suffix = strrchr (o, '.'); + if (!suffix) + suffix = o + strlen (o); + strcpy (suffix, TARGET_OBJECT_SUFFIX); + + deps_add_target (d, o, 1); + } +} + +void +deps_add_dep (struct deps *d, const char *t) +{ + t = munge (t); /* Also makes permanent copy. */ + + if (d->ndeps == d->deps_size) + { + d->deps_size = d->deps_size * 2 + 8; + d->depv = xrealloc (d->depv, d->deps_size * sizeof (const char *)); + } + d->depv[d->ndeps++] = t; +} + +void +deps_write (const struct deps *d, FILE *fp, unsigned int colmax) +{ + unsigned int size, i, column; + + column = 0; + if (colmax && colmax < 34) + colmax = 34; + + for (i = 0; i < d->ntargets; i++) + { + size = strlen (d->targetv[i]); + column += size; + if (colmax && column > colmax) + { + fputs (" \\\n ", fp); + column = 1 + size; + } + if (i) + { + putc (' ', fp); + column++; + } + fputs (d->targetv[i], fp); + } + + putc (':', fp); + putc (' ', fp); + column += 2; + + for (i = 0; i < d->ndeps; i++) + { + size = strlen (d->depv[i]); + column += size; + if (colmax && column > colmax) + { + fputs (" \\\n ", fp); + column = 1 + size; + } + if (i) + { + putc (' ', fp); + column++; + } + fputs (d->depv[i], fp); + } + putc ('\n', fp); +} + +void +deps_phony_targets (const struct deps *d, FILE *fp) +{ + unsigned int i; + + for (i = 1; i < d->ndeps; i++) + { + putc ('\n', fp); + fputs (d->depv[i], fp); + putc (':', fp); + putc ('\n', fp); + } +} + +/* Write out a deps buffer to a file, in a form that can be read back + with deps_restore. Returns nonzero on error, in which case the + error number will be in errno. */ + +int +deps_save (struct deps *deps, FILE *f) +{ + unsigned int i; + + /* The cppreader structure contains makefile dependences. Write out this + structure. */ + + /* The number of dependences. */ + if (fwrite (&deps->ndeps, sizeof (deps->ndeps), 1, f) != 1) + return -1; + /* The length of each dependence followed by the string. */ + for (i = 0; i < deps->ndeps; i++) + { + size_t num_to_write = strlen (deps->depv[i]); + if (fwrite (&num_to_write, sizeof (size_t), 1, f) != 1) + return -1; + if (fwrite (deps->depv[i], num_to_write, 1, f) != 1) + return -1; + } + + return 0; +} + +/* Read back dependency information written with deps_save into + the deps buffer. The third argument may be NULL, in which case + the dependency information is just skipped, or it may be a filename, + in which case that filename is skipped. */ + +int +deps_restore (struct deps *deps, FILE *fd, const char *self) +{ + unsigned int i, count; + size_t num_to_read; + size_t buf_size = 512; + char *buf = xmalloc (buf_size); + + /* Number of dependences. */ + if (fread (&count, 1, sizeof (count), fd) != sizeof (count)) + return -1; + + /* The length of each dependence string, followed by the string. */ + for (i = 0; i < count; i++) + { + /* Read in # bytes in string. */ + if (fread (&num_to_read, 1, sizeof (size_t), fd) != sizeof (size_t)) + return -1; + if (buf_size < num_to_read + 1) + { + buf_size = num_to_read + 1 + 127; + buf = xrealloc (buf, buf_size); + } + if (fread (buf, 1, num_to_read, fd) != num_to_read) + return -1; + buf[num_to_read] = '\0'; + + /* Generate makefile dependencies from .pch if -nopch-deps. */ + if (self != NULL && strcmp (buf, self) != 0) + deps_add_dep (deps, buf); + } + + free (buf); + return 0; +} diff --git a/libcpp/pch.c b/libcpp/pch.c new file mode 100644 index 00000000000..51175a9a67b --- /dev/null +++ b/libcpp/pch.c @@ -0,0 +1,723 @@ +/* Part of CPP library. (Precompiled header reading/writing.) + Copyright (C) 2000, 2001, 2002, 2003, 2004 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "config.h" +#include "system.h" +#include "cpplib.h" +#include "internal.h" +#include "hashtab.h" +#include "mkdeps.h" + +static int write_macdef (cpp_reader *, cpp_hashnode *, void *); +static int save_idents (cpp_reader *, cpp_hashnode *, void *); +static hashval_t hashmem (const void *, size_t); +static hashval_t cpp_string_hash (const void *); +static int cpp_string_eq (const void *, const void *); +static int count_defs (cpp_reader *, cpp_hashnode *, void *); +static int comp_hashnodes (const void *, const void *); +static int collect_ht_nodes (cpp_reader *, cpp_hashnode *, void *); +static int write_defs (cpp_reader *, cpp_hashnode *, void *); +static int save_macros (cpp_reader *, cpp_hashnode *, void *); + +/* This structure represents a macro definition on disk. */ +struct macrodef_struct +{ + unsigned int definition_length; + unsigned short name_length; + unsigned short flags; +}; + +/* This is how we write out a macro definition. + Suitable for being called by cpp_forall_identifiers. */ + +static int +write_macdef (cpp_reader *pfile, cpp_hashnode *hn, void *file_p) +{ + FILE *f = (FILE *) file_p; + switch (hn->type) + { + case NT_VOID: + if (! (hn->flags & NODE_POISONED)) + return 1; + + case NT_MACRO: + if ((hn->flags & NODE_BUILTIN)) + return 1; + + { + struct macrodef_struct s; + const unsigned char *defn; + + s.name_length = NODE_LEN (hn); + s.flags = hn->flags & NODE_POISONED; + + if (hn->type == NT_MACRO) + { + defn = cpp_macro_definition (pfile, hn); + s.definition_length = ustrlen (defn); + } + else + { + defn = NODE_NAME (hn); + s.definition_length = s.name_length; + } + + if (fwrite (&s, sizeof (s), 1, f) != 1 + || fwrite (defn, 1, s.definition_length, f) != s.definition_length) + { + cpp_errno (pfile, CPP_DL_ERROR, + "while writing precompiled header"); + return 0; + } + } + return 1; + + case NT_ASSERTION: + /* Not currently implemented. */ + return 1; + + default: + abort (); + } +} + +/* This structure records the names of the defined macros. + It's also used as a callback structure for size_initial_idents + and save_idents. */ + +struct cpp_savedstate +{ + /* A hash table of the defined identifiers. */ + htab_t definedhash; + /* The size of the definitions of those identifiers (the size of + 'definedstrs'). */ + size_t hashsize; + /* Number of definitions */ + size_t n_defs; + /* Array of definitions. In cpp_write_pch_deps it is used for sorting. */ + cpp_hashnode **defs; + /* Space for the next definition. Definitions are null-terminated + strings. */ + unsigned char *definedstrs; +}; + +/* Save this identifier into the state: put it in the hash table, + put the definition in 'definedstrs'. */ + +static int +save_idents (cpp_reader *pfile ATTRIBUTE_UNUSED, cpp_hashnode *hn, void *ss_p) +{ + struct cpp_savedstate *const ss = (struct cpp_savedstate *)ss_p; + + if (hn->type != NT_VOID) + { + struct cpp_string news; + void **slot; + + news.len = NODE_LEN (hn); + news.text= NODE_NAME (hn); + slot = htab_find_slot (ss->definedhash, &news, INSERT); + if (*slot == NULL) + { + struct cpp_string *sp; + unsigned char *text; + + sp = xmalloc (sizeof (struct cpp_string)); + *slot = sp; + + sp->len = NODE_LEN (hn); + sp->text = text = xmalloc (NODE_LEN (hn)); + memcpy (text, NODE_NAME (hn), NODE_LEN (hn)); + } + } + + return 1; +} + +/* Hash some memory in a generic way. */ + +static hashval_t +hashmem (const void *p_p, size_t sz) +{ + const unsigned char *p = (const unsigned char *)p_p; + size_t i; + hashval_t h; + + h = 0; + for (i = 0; i < sz; i++) + h = h * 67 - (*p++ - 113); + return h; +} + +/* Hash a cpp string for the hashtable machinery. */ + +static hashval_t +cpp_string_hash (const void *a_p) +{ + const struct cpp_string *a = (const struct cpp_string *) a_p; + return hashmem (a->text, a->len); +} + +/* Compare two cpp strings for the hashtable machinery. */ + +static int +cpp_string_eq (const void *a_p, const void *b_p) +{ + const struct cpp_string *a = (const struct cpp_string *) a_p; + const struct cpp_string *b = (const struct cpp_string *) b_p; + return (a->len == b->len + && memcmp (a->text, b->text, a->len) == 0); +} + +/* Save the current definitions of the cpp_reader for dependency + checking purposes. When writing a precompiled header, this should + be called at the same point in the compilation as cpp_valid_state + would be called when reading the precompiled header back in. */ + +int +cpp_save_state (cpp_reader *r, FILE *f) +{ + /* Save the list of non-void identifiers for the dependency checking. */ + r->savedstate = xmalloc (sizeof (struct cpp_savedstate)); + r->savedstate->definedhash = htab_create (100, cpp_string_hash, + cpp_string_eq, NULL); + cpp_forall_identifiers (r, save_idents, r->savedstate); + + /* Write out the list of defined identifiers. */ + cpp_forall_identifiers (r, write_macdef, f); + + return 0; +} + +/* Calculate the 'hashsize' field of the saved state. */ + +static int +count_defs (cpp_reader *pfile ATTRIBUTE_UNUSED, cpp_hashnode *hn, void *ss_p) +{ + struct cpp_savedstate *const ss = (struct cpp_savedstate *)ss_p; + + switch (hn->type) + { + case NT_MACRO: + if (hn->flags & NODE_BUILTIN) + return 1; + + /* else fall through. */ + + case NT_VOID: + { + struct cpp_string news; + void **slot; + + news.len = NODE_LEN (hn); + news.text = NODE_NAME (hn); + slot = htab_find (ss->definedhash, &news); + if (slot == NULL) + { + ss->hashsize += NODE_LEN (hn) + 1; + ss->n_defs += 1; + } + } + return 1; + + case NT_ASSERTION: + /* Not currently implemented. */ + return 1; + + default: + abort (); + } +} + +/* Collect the identifiers into the state's string table. */ +static int +write_defs (cpp_reader *pfile ATTRIBUTE_UNUSED, cpp_hashnode *hn, void *ss_p) +{ + struct cpp_savedstate *const ss = (struct cpp_savedstate *)ss_p; + + switch (hn->type) + { + case NT_MACRO: + if (hn->flags & NODE_BUILTIN) + return 1; + + /* else fall through. */ + + case NT_VOID: + { + struct cpp_string news; + void **slot; + + news.len = NODE_LEN (hn); + news.text = NODE_NAME (hn); + slot = htab_find (ss->definedhash, &news); + if (slot == NULL) + { + ss->defs[ss->n_defs] = hn; + ss->n_defs += 1; + } + } + return 1; + + case NT_ASSERTION: + /* Not currently implemented. */ + return 1; + + default: + abort (); + } +} + +/* Comparison function for qsort. The arguments point to pointers of + type ht_hashnode *. */ +static int +comp_hashnodes (const void *px, const void *py) +{ + cpp_hashnode *x = *(cpp_hashnode **) px; + cpp_hashnode *y = *(cpp_hashnode **) py; + return ustrcmp (NODE_NAME (x), NODE_NAME (y)); +} + +/* Write out the remainder of the dependency information. This should be + called after the PCH is ready to be saved. */ + +int +cpp_write_pch_deps (cpp_reader *r, FILE *f) +{ + struct macrodef_struct z; + struct cpp_savedstate *const ss = r->savedstate; + unsigned char *definedstrs; + size_t i; + + /* Collect the list of identifiers which have been seen and + weren't defined to anything previously. */ + ss->hashsize = 0; + ss->n_defs = 0; + cpp_forall_identifiers (r, count_defs, ss); + + ss->defs = xmalloc (ss->n_defs * sizeof (cpp_hashnode *)); + ss->n_defs = 0; + cpp_forall_identifiers (r, write_defs, ss); + + /* Sort the list, copy it into a buffer, and write it out. */ + qsort (ss->defs, ss->n_defs, sizeof (cpp_hashnode *), &comp_hashnodes); + definedstrs = ss->definedstrs = xmalloc (ss->hashsize); + for (i = 0; i < ss->n_defs; ++i) + { + size_t len = NODE_LEN (ss->defs[i]); + memcpy (definedstrs, NODE_NAME (ss->defs[i]), len + 1); + definedstrs += len + 1; + } + + memset (&z, 0, sizeof (z)); + z.definition_length = ss->hashsize; + if (fwrite (&z, sizeof (z), 1, f) != 1 + || fwrite (ss->definedstrs, ss->hashsize, 1, f) != 1) + { + cpp_errno (r, CPP_DL_ERROR, "while writing precompiled header"); + return -1; + } + free (ss->definedstrs); + + /* Free the saved state. */ + free (ss); + r->savedstate = NULL; + return 0; +} + +/* Write out the definitions of the preprocessor, in a form suitable for + cpp_read_state. */ + +int +cpp_write_pch_state (cpp_reader *r, FILE *f) +{ + struct macrodef_struct z; + + /* Write out the list of defined identifiers. */ + cpp_forall_identifiers (r, write_macdef, f); + memset (&z, 0, sizeof (z)); + if (fwrite (&z, sizeof (z), 1, f) != 1) + { + cpp_errno (r, CPP_DL_ERROR, "while writing precompiled header"); + return -1; + } + + if (!r->deps) + r->deps = deps_init (); + + if (deps_save (r->deps, f) != 0) + { + cpp_errno (r, CPP_DL_ERROR, "while writing precompiled header"); + return -1; + } + + if (! _cpp_save_file_entries (r, f)) + { + cpp_errno (r, CPP_DL_ERROR, "while writing precompiled header"); + return -1; + } + + return 0; +} + + +/* Data structure to transform hash table nodes into a sorted list */ + +struct ht_node_list +{ + /* Array of nodes */ + cpp_hashnode **defs; + /* Number of nodes in the array */ + size_t n_defs; + /* Size of the allocated array */ + size_t asize; +}; + +/* Callback for collecting identifiers from hash table */ + +static int +collect_ht_nodes (cpp_reader *pfile ATTRIBUTE_UNUSED, cpp_hashnode *hn, + void *nl_p) +{ + struct ht_node_list *const nl = (struct ht_node_list *)nl_p; + + if (hn->type != NT_VOID || hn->flags & NODE_POISONED) + { + if (nl->n_defs == nl->asize) + { + nl->asize *= 2; + nl->defs = xrealloc (nl->defs, nl->asize * sizeof (cpp_hashnode *)); + } + + nl->defs[nl->n_defs] = hn; + ++nl->n_defs; + } + return 1; +} + + +/* Return nonzero if FD is a precompiled header which is consistent + with the preprocessor's current definitions. It will be consistent + when: + + - anything that was defined just before the PCH was generated + is defined the same way now; and + - anything that was not defined then, but is defined now, was not + used by the PCH. + + NAME is used to print warnings if `warn_invalid_pch' is set in the + reader's flags. +*/ + +int +cpp_valid_state (cpp_reader *r, const char *name, int fd) +{ + struct macrodef_struct m; + size_t namebufsz = 256; + unsigned char *namebuf = xmalloc (namebufsz); + unsigned char *undeftab = NULL; + struct ht_node_list nl = { 0, 0, 0 }; + unsigned char *first, *last; + unsigned int i; + + /* Read in the list of identifiers that must be defined + Check that they are defined in the same way. */ + for (;;) + { + cpp_hashnode *h; + const unsigned char *newdefn; + + if (read (fd, &m, sizeof (m)) != sizeof (m)) + goto error; + + if (m.name_length == 0) + break; + + if (m.definition_length > namebufsz) + { + free (namebuf); + namebufsz = m.definition_length + 256; + namebuf = xmalloc (namebufsz); + } + + if ((size_t)read (fd, namebuf, m.definition_length) + != m.definition_length) + goto error; + + h = cpp_lookup (r, namebuf, m.name_length); + if (m.flags & NODE_POISONED + || h->type != NT_MACRO + || h->flags & NODE_POISONED) + { + if (CPP_OPTION (r, warn_invalid_pch)) + cpp_error (r, CPP_DL_WARNING_SYSHDR, + "%s: not used because `%.*s' not defined", + name, m.name_length, namebuf); + goto fail; + } + + newdefn = cpp_macro_definition (r, h); + + if (m.definition_length != ustrlen (newdefn) + || memcmp (namebuf, newdefn, m.definition_length) != 0) + { + if (CPP_OPTION (r, warn_invalid_pch)) + cpp_error (r, CPP_DL_WARNING_SYSHDR, + "%s: not used because `%.*s' defined as `%s' not `%.*s'", + name, m.name_length, namebuf, newdefn + m.name_length, + m.definition_length - m.name_length, + namebuf + m.name_length); + goto fail; + } + } + free (namebuf); + namebuf = NULL; + + /* Read in the list of identifiers that must not be defined. + Check that they really aren't. */ + undeftab = xmalloc (m.definition_length); + if ((size_t) read (fd, undeftab, m.definition_length) != m.definition_length) + goto error; + + /* Collect identifiers from the current hash table. */ + nl.n_defs = 0; + nl.asize = 10; + nl.defs = xmalloc (nl.asize * sizeof (cpp_hashnode *)); + cpp_forall_identifiers (r, &collect_ht_nodes, &nl); + qsort (nl.defs, nl.n_defs, sizeof (cpp_hashnode *), &comp_hashnodes); + + /* Loop through nl.defs and undeftab, both of which are sorted lists. + There should be no matches. */ + first = undeftab; + last = undeftab + m.definition_length; + i = 0; + + while (first < last && i < nl.n_defs) + { + int cmp = ustrcmp (first, NODE_NAME (nl.defs[i])); + + if (cmp < 0) + first += ustrlen (first) + 1; + else if (cmp > 0) + ++i; + else + { + if (CPP_OPTION (r, warn_invalid_pch)) + cpp_error (r, CPP_DL_WARNING_SYSHDR, + "%s: not used because `%s' is defined", + name, first); + goto fail; + } + } + + free(nl.defs); + free (undeftab); + + /* We win! */ + return 0; + + error: + cpp_errno (r, CPP_DL_ERROR, "while reading precompiled header"); + return -1; + + fail: + if (namebuf != NULL) + free (namebuf); + if (undeftab != NULL) + free (undeftab); + if (nl.defs != NULL) + free (nl.defs); + return 1; +} + +/* Save all the existing macros and assertions. + This code assumes that there might be hundreds, but not thousands of + existing definitions. */ + +struct save_macro_item { + struct save_macro_item *next; + struct cpp_hashnode macs[64]; +}; + +struct save_macro_data +{ + struct save_macro_item *macros; + size_t count; + char **saved_pragmas; +}; + +/* Save the definition of a single macro, so that it will persist across + a PCH restore. */ + +static int +save_macros (cpp_reader *r ATTRIBUTE_UNUSED, cpp_hashnode *h, void *data_p) +{ + struct save_macro_data *data = (struct save_macro_data *)data_p; + if (h->type != NT_VOID + && (h->flags & NODE_BUILTIN) == 0) + { + cpp_hashnode *save; + if (data->count == ARRAY_SIZE (data->macros->macs)) + { + struct save_macro_item *d = data->macros; + data->macros = xmalloc (sizeof (struct save_macro_item)); + data->macros->next = d; + data->count = 0; + } + save = data->macros->macs + data->count; + data->count++; + memcpy (save, h, sizeof (struct cpp_hashnode)); + HT_STR (&save->ident) = xmemdup (HT_STR (HT_NODE (save)), + HT_LEN (HT_NODE (save)), + HT_LEN (HT_NODE (save)) + 1); + } + return 1; +} + +/* Prepare to restore the state, by saving the currently-defined + macros in 'data'. */ + +void +cpp_prepare_state (cpp_reader *r, struct save_macro_data **data) +{ + struct save_macro_data *d = xmalloc (sizeof (struct save_macro_data)); + + d->macros = NULL; + d->count = ARRAY_SIZE (d->macros->macs); + cpp_forall_identifiers (r, save_macros, d); + d->saved_pragmas = _cpp_save_pragma_names (r); + *data = d; +} + +/* Given a precompiled header that was previously determined to be valid, + apply all its definitions (and undefinitions) to the current state. + DEPNAME is passed to deps_restore. */ + +int +cpp_read_state (cpp_reader *r, const char *name, FILE *f, + struct save_macro_data *data) +{ + struct macrodef_struct m; + size_t defnlen = 256; + unsigned char *defn = xmalloc (defnlen); + struct lexer_state old_state; + struct save_macro_item *d; + size_t i, mac_count; + + /* Restore spec_nodes, which will be full of references to the old + hashtable entries and so will now be invalid. */ + { + struct spec_nodes *s = &r->spec_nodes; + s->n_defined = cpp_lookup (r, DSC("defined")); + s->n_true = cpp_lookup (r, DSC("true")); + s->n_false = cpp_lookup (r, DSC("false")); + s->n__VA_ARGS__ = cpp_lookup (r, DSC("__VA_ARGS__")); + } + + /* Run through the carefully-saved macros, insert them. */ + d = data->macros; + mac_count = data->count; + while (d) + { + struct save_macro_item *nextd; + for (i = 0; i < mac_count; i++) + { + cpp_hashnode *h; + + h = cpp_lookup (r, HT_STR (HT_NODE (&d->macs[i])), + HT_LEN (HT_NODE (&d->macs[i]))); + h->type = d->macs[i].type; + h->flags = d->macs[i].flags; + h->value = d->macs[i].value; + free ((void *)HT_STR (HT_NODE (&d->macs[i]))); + } + nextd = d->next; + free (d); + d = nextd; + mac_count = ARRAY_SIZE (d->macs); + } + + _cpp_restore_pragma_names (r, data->saved_pragmas); + + free (data); + + old_state = r->state; + + r->state.in_directive = 1; + r->state.prevent_expansion = 1; + r->state.angled_headers = 0; + + /* Read in the identifiers that must be defined. */ + for (;;) + { + cpp_hashnode *h; + + if (fread (&m, sizeof (m), 1, f) != 1) + goto error; + + if (m.name_length == 0) + break; + + if (defnlen < m.definition_length + 1) + { + defnlen = m.definition_length + 256; + defn = xrealloc (defn, defnlen); + } + + if (fread (defn, 1, m.definition_length, f) != m.definition_length) + goto error; + defn[m.definition_length] = '\n'; + + h = cpp_lookup (r, defn, m.name_length); + + if (h->type == NT_MACRO) + _cpp_free_definition (h); + if (m.flags & NODE_POISONED) + h->flags |= NODE_POISONED | NODE_DIAGNOSTIC; + else if (m.name_length != m.definition_length) + { + if (cpp_push_buffer (r, defn + m.name_length, + m.definition_length - m.name_length, true) + != NULL) + { + _cpp_clean_line (r); + if (!_cpp_create_definition (r, h)) + abort (); + _cpp_pop_buffer (r); + } + else + abort (); + } + } + + r->state = old_state; + free (defn); + defn = NULL; + + if (deps_restore (r->deps, f, CPP_OPTION (r, restore_pch_deps) ? name : NULL) + != 0) + goto error; + + if (! _cpp_read_file_entries (r, f)) + goto error; + + return 0; + + error: + cpp_errno (r, CPP_DL_ERROR, "while reading precompiled header"); + return -1; +} diff --git a/libcpp/po/ChangeLog b/libcpp/po/ChangeLog new file mode 100644 index 00000000000..30a39ea5bf7 --- /dev/null +++ b/libcpp/po/ChangeLog @@ -0,0 +1,13 @@ +2004-05-23 Paolo Bonzini <bonzini@gnu.org> + + * be.po: Extracted from gcc/po/be.po. + * ca.po: Extracted from gcc/po/ca.po. + * da.po: Extracted from gcc/po/da.po. + * de.po: Extracted from gcc/po/de.po. + * el.po: Extracted from gcc/po/el.po. + * es.po: Extracted from gcc/po/es.po. + * fr.po: Extracted from gcc/po/fr.po. + * ja.po: Extracted from gcc/po/ja.po. + * nl.po: Extracted from gcc/po/nl.po. + * sv.po: Extracted from gcc/po/sv.po. + * tr.po: Extracted from gcc/po/tr.po. diff --git a/libcpp/po/be.po b/libcpp/po/be.po new file mode 100644 index 00000000000..d9df0253ab7 --- /dev/null +++ b/libcpp/po/be.po @@ -0,0 +1,776 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2002 Free Software Foundation, Inc. +# Ales Nyakhaychyk <nyakhaychyk@i18n.linux.by>, 2002. +# +msgid "" +msgstr "" +"Project-Id-Version: gcc 3.1\n" +"POT-Creation-Date: 2004-02-06 01:34+0000\n" +"PO-Revision-Date: 2002-05-17 15:54+0200\n" +"Last-Translator: Ales Nyakhaychyk <nyakhaychyk@i18n.linux.by>\n" +"Language-Team: Belarusian <i18n@tut.by>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" + +#: cppexp.c:1253 +msgid "traditional C rejects the unary plus operator" +msgstr "" + +#: cpperror.c:176 +#, c-format +msgid "%s: %s" +msgstr "" + +#: cppcharset.c:653 +#, c-format +msgid "conversion from %s to %s not supported by iconv" +msgstr "" + +#: cppcharset.c:656 +msgid "iconv_open" +msgstr "" + +#. FIXME: should be DL_SORRY +#: cppcharset.c:664 +#, c-format +msgid "no iconv implementation, cannot convert from %s to %s" +msgstr "" + +#: cppcharset.c:808 +msgid "universal character names are only valid in C++ and C99" +msgstr "" + +#: cppcharset.c:811 +#, c-format +msgid "the meaning of '\\%c' is different in traditional C" +msgstr "" + +#: cppcharset.c:837 +#, c-format +msgid "incomplete universal character name %.*s" +msgstr "" + +#: cppcharset.c:849 +#, fuzzy, c-format +msgid "%.*s is not a valid universal character" +msgstr "\"%s\" - гÑта не пачатак дÑкларацыі" + +#: cppcharset.c:859 +#, c-format +msgid "universal character %.*s is not valid in an identifier" +msgstr "" + +#: cppcharset.c:863 +#, c-format +msgid "universal character %.*s is not valid at the start of an identifier" +msgstr "" + +#: cppcharset.c:898 +msgid "converting UCN to source character set" +msgstr "" + +#: cppcharset.c:902 +msgid "converting UCN to execution character set" +msgstr "" + +#: cppcharset.c:967 +msgid "the meaning of '\\x' is different in traditional C" +msgstr "" + +#: cppcharset.c:984 f/lex.c:580 +msgid "\\x used with no following hex digits" +msgstr "" + +#: cppcharset.c:991 +msgid "hex escape sequence out of range" +msgstr "" + +#: cppcharset.c:1030 +msgid "octal escape sequence out of range" +msgstr "" + +#: cppcharset.c:1098 +msgid "the meaning of '\\a' is different in traditional C" +msgstr "" + +#: cppcharset.c:1105 +#, c-format +msgid "non-ISO-standard escape sequence, '\\%c'" +msgstr "" + +#: cppcharset.c:1113 +#, c-format +msgid "unknown escape sequence '\\%c'" +msgstr "невÑÐ´Ð¾Ð¼Ð°Ñ ESC-паÑлÑдоўнаÑць '\\%c'" + +#: cppcharset.c:1116 +#, fuzzy, c-format +msgid "unknown escape sequence: '\\%03o'" +msgstr "невÑÐ´Ð¾Ð¼Ð°Ñ ESC-паÑлÑдоўнаÑць '\\%c'" + +#: cppcharset.c:1122 +msgid "converting escape sequence to execution character set" +msgstr "" + +#: cppcharset.c:1181 +msgid "converting to execution character set" +msgstr "" + +#: cppcharset.c:1244 cppcharset.c:1307 +#, fuzzy +msgid "character constant too long for its type" +msgstr "ÑÑ–Ð¼Ð²Ð°Ð»ÑŒÐ½Ð°Ñ ÐºÐ°Ð½Ñтанта вельмі доўгаÑ" + +#: cppcharset.c:1247 +msgid "multi-character character constant" +msgstr "мнагаÑÑ–Ð¼Ð²Ð°Ð»ÑŒÐ½Ð°Ñ ÑÑ–Ð¼Ð²Ð°Ð»ÑŒÐ½Ð°Ñ ÐºÐ°Ð½Ñтанта" + +#: cppcharset.c:1339 +msgid "empty character constant" +msgstr "пуÑÑ‚Ð°Ñ ÑÑ–Ð¼Ð²Ð°Ð»ÑŒÐ½Ð°Ñ ÐºÐ°Ð½Ñтанта" + +#: cppcharset.c:1378 +#, c-format +msgid "failure to convert %s to %s" +msgstr "" + +#: cpperror.c:110 diagnostic.def:5 +msgid "warning: " +msgstr "" + +#: cpperror.c:112 +msgid "internal error: " +msgstr "" + +#: cpperror.c:174 +#, fuzzy +msgid "stdout" +msgstr "Ñтруктура" + +#: cppexp.c:192 +msgid "too many decimal points in number" +msgstr "" + +#: cppexp.c:212 +#, fuzzy, c-format +msgid "invalid digit \"%c\" in octal constant" +msgstr "`%E' - нерÑчаіÑÐ½Ð°Ñ Ð½ÑÐ·ÑŒÐ¼ÐµÐ½Ð½Ð°Ñ Ñ‚Ñ‹Ð¿Ñƒ string" + +#: cppexp.c:218 +msgid "use of C99 hexadecimal floating constant" +msgstr "" + +#: cppexp.c:227 +msgid "exponent has no digits" +msgstr "" + +#: cppexp.c:234 +msgid "hexadecimal floating constants require an exponent" +msgstr "" + +#: cppexp.c:240 +#, fuzzy, c-format +msgid "invalid suffix \"%.*s\" on floating constant" +msgstr "`%E' - нерÑчаіÑÐ½Ð°Ñ Ð½ÑÐ·ÑŒÐ¼ÐµÐ½Ð½Ð°Ñ Ñ‚Ñ‹Ð¿Ñƒ string" + +#: cppexp.c:250 cppexp.c:275 +#, c-format +msgid "traditional C rejects the \"%.*s\" suffix" +msgstr "" + +#: cppexp.c:261 +#, fuzzy, c-format +msgid "invalid suffix \"%.*s\" on integer constant" +msgstr "`%E' - нерÑчаіÑÐ½Ð°Ñ Ð½ÑÐ·ÑŒÐ¼ÐµÐ½Ð½Ð°Ñ Ñ‚Ñ‹Ð¿Ñƒ string" + +#: cppexp.c:283 +msgid "use of C99 long long integer constant" +msgstr "" + +#: cppexp.c:290 +msgid "imaginary constants are a GCC extension" +msgstr "" + +#: cppexp.c:376 +msgid "integer constant is too large for its type" +msgstr "" + +#: cppexp.c:388 +msgid "integer constant is so large that it is unsigned" +msgstr "" + +#: cppexp.c:470 +msgid "missing ')' after \"defined\"" +msgstr "" + +#: cppexp.c:477 +msgid "operator \"defined\" requires an identifier" +msgstr "" + +#: cppexp.c:485 +#, c-format +msgid "(\"%s\" is an alternative token for \"%s\" in C++)" +msgstr "" + +#: cppexp.c:495 +msgid "this use of \"defined\" may not be portable" +msgstr "" + +#: cppexp.c:531 +msgid "floating constant in preprocessor expression" +msgstr "" + +#: cppexp.c:537 +msgid "imaginary number in preprocessor expression" +msgstr "" + +#: cppexp.c:582 +#, c-format +msgid "\"%s\" is not defined" +msgstr "" + +#: cppexp.c:714 cppexp.c:743 +#, fuzzy, c-format +msgid "missing binary operator before token \"%s\"" +msgstr "прапушчан прабел паÑÐ»Ñ Ð½ÑƒÐ¼Ð°Ñ€Ð° \"%.*s\"" + +#: cppexp.c:734 +#, c-format +msgid "token \"%s\" is not valid in preprocessor expressions" +msgstr "" + +#: cppexp.c:753 +msgid "void expression between '(' and ')'" +msgstr "" + +#: cppexp.c:756 +msgid "#if with no expression" +msgstr "" + +#: cppexp.c:758 +#, c-format +msgid "operator '%s' has no right operand" +msgstr "" + +#: cppexp.c:784 +msgid " ':' without preceding '?'" +msgstr "" + +#: cppexp.c:811 +msgid "unbalanced stack in #if" +msgstr "" + +#: cppexp.c:830 +#, fuzzy, c-format +msgid "impossible operator '%u'" +msgstr "немагчымы апÑратар '%s'" + +#: cppexp.c:922 +msgid "missing ')' in expression" +msgstr "" + +#: cppexp.c:943 +msgid "'?' without following ':'" +msgstr "" + +#: cppexp.c:953 +msgid "integer overflow in preprocessor expression" +msgstr "" + +#: cppexp.c:958 +msgid "missing '(' in expression" +msgstr "" + +#: cppexp.c:990 +#, c-format +msgid "the left operand of \"%s\" changes sign when promoted" +msgstr "" + +#: cppexp.c:995 +#, c-format +msgid "the right operand of \"%s\" changes sign when promoted" +msgstr "" + +#: cppexp.c:1352 +msgid "comma operator in operand of #if" +msgstr "" + +#: cppexp.c:1483 +msgid "division by zero in #if" +msgstr "" + +#: cppfiles.c:375 +msgid "NULL directory in find_file" +msgstr "" + +#: cppfiles.c:402 +msgid "one or more PCH files were found, but they were invalid" +msgstr "" + +#: cppfiles.c:405 +msgid "use -Winvalid-pch for more information" +msgstr "" + +#: cppfiles.c:463 +#, c-format +msgid "%s is a block device" +msgstr "%s - гÑта Ð±Ð»Ñ‘Ñ‡Ð½Ð°Ñ Ð¿Ñ€Ñ‹Ð»Ð°Ð´Ð°" + +#: cppfiles.c:480 +#, c-format +msgid "%s is too large" +msgstr "%s - вельмі вÑлікі" + +#: cppfiles.c:515 +#, c-format +msgid "%s is shorter than expected" +msgstr "" + +#: cppfiles.c:714 +#, c-format +msgid "no include path in which to search for %s" +msgstr "" + +#: cppfiles.c:974 +msgid "Multiple include guards may be useful for:\n" +msgstr "" + +#: cppinit.c:389 +msgid "cppchar_t must be an unsigned type" +msgstr "" + +#: cppinit.c:393 +#, c-format +msgid "" +"preprocessor arithmetic has maximum precision of %lu bits; target requires %" +"lu bits" +msgstr "" + +#: cppinit.c:400 +msgid "CPP arithmetic must be at least as precise as a target int" +msgstr "" + +#: cppinit.c:403 +msgid "target char is less than 8 bits wide" +msgstr "" + +#: cppinit.c:407 +msgid "target wchar_t is narrower than target char" +msgstr "" + +#: cppinit.c:411 +msgid "target int is narrower than target char" +msgstr "" + +#: cppinit.c:416 +msgid "CPP half-integer narrower than CPP character" +msgstr "" + +#: cppinit.c:420 +#, c-format +msgid "" +"CPP on this host cannot handle wide character constants over %lu bits, but " +"the target requires %lu bits" +msgstr "" + +#: cpplex.c:410 +msgid "null character(s) ignored" +msgstr "" + +#: cpplex.c:445 +msgid "'$' in identifier or number" +msgstr "" + +#: cpplex.c:492 +#, c-format +msgid "attempt to use poisoned \"%s\"" +msgstr "" + +#: cpplex.c:500 +msgid "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro" +msgstr "" + +#: cpplex.c:596 +msgid "null character(s) preserved in literal" +msgstr "" + +#: cpplex.c:916 +msgid "unterminated comment" +msgstr "Ð½ÐµÐ·Ð°Ð²ÐµÑ€ÑˆÐ°Ð½Ñ‹Ñ ÐºÐ°Ð¼ÐµÐ½Ñ‚Ð°Ñ€Ñ‹Ñ–" + +#: cpplex.c:927 +msgid "C++ style comments are not allowed in ISO C90" +msgstr "" + +#: cpplex.c:929 +msgid "(this will be reported only once per input file)" +msgstr "" + +#: cpplex.c:934 +msgid "multi-line comment" +msgstr "" + +#: cpplex.c:1198 +#, fuzzy, c-format +msgid "unspellable token %s" +msgstr "немагу адчыніць файл \"%s\"" + +#: cpplib.c:218 +#, c-format +msgid "extra tokens at end of #%s directive" +msgstr "" + +#: cpplib.c:304 +#, c-format +msgid "#%s is a GCC extension" +msgstr "" + +#: cpplib.c:316 +msgid "suggest not using #elif in traditional C" +msgstr "" + +#: cpplib.c:319 +#, c-format +msgid "traditional C ignores #%s with the # indented" +msgstr "" + +#: cpplib.c:323 +#, c-format +msgid "suggest hiding #%s from traditional C with an indented #" +msgstr "" + +#: cpplib.c:345 +msgid "embedding a directive within macro arguments is not portable" +msgstr "" + +#: cpplib.c:365 +msgid "style of line directive is a GCC extension" +msgstr "" + +#: cpplib.c:415 +#, c-format +msgid "invalid preprocessing directive #%s" +msgstr "" + +#: cpplib.c:484 +msgid "\"defined\" cannot be used as a macro name" +msgstr "" + +#: cpplib.c:490 +#, c-format +msgid "\"%s\" cannot be used as a macro name as it is an operator in C++" +msgstr "" + +#: cpplib.c:493 +#, c-format +msgid "no macro name given in #%s directive" +msgstr "" + +#: cpplib.c:496 +msgid "macro names must be identifiers" +msgstr "" + +#: cpplib.c:537 +#, c-format +msgid "undefining \"%s\"" +msgstr "" + +#: cpplib.c:609 +msgid "missing terminating > character" +msgstr "" + +#: cpplib.c:662 +#, c-format +msgid "#%s expects \"FILENAME\" or <FILENAME>" +msgstr "" + +#: cpplib.c:685 +msgid "#include nested too deeply" +msgstr "" + +#: cpplib.c:723 +msgid "#include_next in primary source file" +msgstr "" + +#: cpplib.c:749 +#, c-format +msgid "invalid flag \"%s\" in line directive" +msgstr "" + +#: cpplib.c:794 +#, c-format +msgid "\"%s\" after #line is not a positive integer" +msgstr "" + +#: cpplib.c:800 +msgid "line number out of range" +msgstr "" + +#: cpplib.c:812 cpplib.c:885 +#, c-format +msgid "\"%s\" is not a valid filename" +msgstr "" + +#: cpplib.c:847 +#, c-format +msgid "\"%s\" after # is not a positive integer" +msgstr "" + +#: cpplib.c:947 +#, fuzzy +msgid "invalid #ident directive" +msgstr "нерÑчаіÑны ініцыÑлізатар" + +#: cpplib.c:1027 +#, c-format +msgid "registering \"%s\" as both a pragma and a pragma namespace" +msgstr "" + +#: cpplib.c:1030 +#, fuzzy, c-format +msgid "#pragma %s %s is already registered" +msgstr "ÐšÐ»Ð°Ñ \"%s\" ужо Ñ–Ñнуе" + +#: cpplib.c:1033 +#, c-format +msgid "#pragma %s is already registered" +msgstr "" + +#: cpplib.c:1178 +msgid "#pragma once in main file" +msgstr "" + +#: cpplib.c:1201 +msgid "invalid #pragma GCC poison directive" +msgstr "" + +#: cpplib.c:1210 +#, c-format +msgid "poisoning existing macro \"%s\"" +msgstr "" + +#: cpplib.c:1231 +msgid "#pragma system_header ignored outside include file" +msgstr "" + +#: cpplib.c:1255 +#, fuzzy, c-format +msgid "cannot find source file %s" +msgstr "не магу знайÑці крыніцу %s" + +#: cpplib.c:1259 +#, c-format +msgid "current file is older than %s" +msgstr "" + +#: cpplib.c:1373 +msgid "_Pragma takes a parenthesized string literal" +msgstr "" + +#: cpplib.c:1451 +msgid "#else without #if" +msgstr "" + +#: cpplib.c:1456 +msgid "#else after #else" +msgstr "" + +#: cpplib.c:1484 +msgid "#elif without #if" +msgstr "" + +#: cpplib.c:1489 +msgid "#elif after #else" +msgstr "" + +#: cpplib.c:1519 +msgid "#endif without #if" +msgstr "" + +#: cpplib.c:1596 +msgid "missing '(' after predicate" +msgstr "" + +#: cpplib.c:1611 +msgid "missing ')' to complete answer" +msgstr "" + +#: cpplib.c:1631 +msgid "predicate's answer is empty" +msgstr "" + +#: cpplib.c:1658 +msgid "assertion without predicate" +msgstr "" + +#: cpplib.c:1660 +msgid "predicate must be an identifier" +msgstr "" + +#: cpplib.c:1744 +#, c-format +msgid "\"%s\" re-asserted" +msgstr "" + +#: cppmacro.c:125 cppmacro.c:280 +#, c-format +msgid "invalid built-in macro \"%s\"" +msgstr "" + +#: cppmacro.c:221 +#, fuzzy +msgid "could not determine date and time" +msgstr "Ðемагчыма адчыніць файл з дадзенымі %s.\n" + +#: cppmacro.c:393 +msgid "invalid string literal, ignoring final '\\'" +msgstr "" + +#: cppmacro.c:476 +#, c-format +msgid "pasting \"%s\" and \"%s\" does not give a valid preprocessing token" +msgstr "" + +#: cppmacro.c:514 +msgid "ISO C99 requires rest arguments to be used" +msgstr "" + +#: cppmacro.c:519 +#, c-format +msgid "macro \"%s\" requires %u arguments, but only %u given" +msgstr "" + +#: cppmacro.c:524 +#, c-format +msgid "macro \"%s\" passed %u arguments, but takes just %u" +msgstr "" + +#: cppmacro.c:635 +#, c-format +msgid "unterminated argument list invoking macro \"%s\"" +msgstr "" + +#: cppmacro.c:738 +#, c-format +msgid "function-like macro \"%s\" must be used with arguments in traditional C" +msgstr "" + +#: cppmacro.c:1241 +#, c-format +msgid "duplicate macro parameter \"%s\"" +msgstr "" + +#: cppmacro.c:1286 +#, c-format +msgid "\"%s\" may not appear in macro parameter list" +msgstr "" + +#: cppmacro.c:1294 +msgid "macro parameters must be comma-separated" +msgstr "" + +#: cppmacro.c:1311 +msgid "parameter name missing" +msgstr "" + +#: cppmacro.c:1326 +msgid "anonymous variadic macros were introduced in C99" +msgstr "" + +#: cppmacro.c:1330 +msgid "ISO C does not permit named variadic macros" +msgstr "" + +#: cppmacro.c:1339 +msgid "missing ')' in macro parameter list" +msgstr "" + +#: cppmacro.c:1402 +msgid "ISO C requires whitespace after the macro name" +msgstr "" + +#: cppmacro.c:1430 +msgid "'#' is not followed by a macro parameter" +msgstr "" + +#: cppmacro.c:1449 +msgid "'##' cannot appear at either end of a macro expansion" +msgstr "" + +#: cppmacro.c:1588 +#, c-format +msgid "macro argument \"%s\" would be stringified in traditional C" +msgstr "" + +#: cppmacro.c:1611 +#, c-format +msgid "invalid hash type %d in cpp_macro_definition" +msgstr "" + +#: cpppch.c:84 cpppch.c:332 cpppch.c:356 cpppch.c:365 cpppch.c:371 +msgid "while writing precompiled header" +msgstr "" + +#: cpppch.c:469 +#, fuzzy, c-format +msgid "%s: not used because `%.*s' not defined" +msgstr "адмеціна `%s' выкарыÑтоўвываецца, але Ð½Ñ Ð²Ñ‹Ð·Ð½Ð°Ñ‡Ð°Ð½Ð°" + +#: cpppch.c:481 +#, c-format +msgid "%s: not used because `%.*s' defined as `%s' not `%.*s'" +msgstr "" + +#: cpppch.c:522 +#, c-format +msgid "%s: not used because `%s' is defined" +msgstr "" + +#: cpppch.c:535 cpppch.c:724 +msgid "while reading precompiled header" +msgstr "" + +#: cppspec.c:106 +#, c-format +msgid "\"%s\" is not a valid option to the preprocessor" +msgstr "" + +#: cppspec.c:128 +msgid "too many input files" +msgstr "вельмі шмат уваходзÑчых файлаў" + +#: cpptrad.c:744 +#, c-format +msgid "detected recursion whilst expanding macro \"%s\"" +msgstr "" + +#: cpptrad.c:911 +msgid "syntax error in macro parameter list" +msgstr "" + +#: line-map.c:218 +#, c-format +msgid "In file included from %s:%u" +msgstr "" + +#. Translators note: this message is used in conjunction +#. with "In file included from %s:%ld" and some other +#. tricks. We want something like this: +#. +#. | In file included from sys/select.h:123, +#. | from sys/types.h:234, +#. | from userfile.c:31: +#. | bits/select.h:45: <error message here> +#. +#. with all the "from"s lined up. +#. The trailing comma is at the beginning of this message, +#. and the trailing colon is not translated. +#: line-map.c:236 +#, c-format +msgid "" +",\n" +" from %s:%u" +msgstr "" + diff --git a/libcpp/po/ca.po b/libcpp/po/ca.po new file mode 100644 index 00000000000..7f6936649f9 --- /dev/null +++ b/libcpp/po/ca.po @@ -0,0 +1,792 @@ +# translation of gcc-3.2-ca.po to Catalan +# Catalan translation of gcc. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is distributed under the same license as the gcc package. +# Gilles MATEU <mateu.gilles@wanadoo.fr>, 2002. +# Gilles MATEU <mateu.gilles@wanadoo.fr>, 2003. +# Gilles MATEU <mateu.gilles@wanadoo.fr>, 2004. +# +# +msgid "" +msgstr "" +"Project-Id-Version: gcc 3.3.2\n" +"POT-Creation-Date: 2004-02-06 01:34+0000\n" +"PO-Revision-Date: 2004-01-30 00:03+0000\n" +"Last-Translator: Mateu Gilles <mateu.gilles@wanadoo.fr>\n" +"Language-Team: Catalan <ca@dodds.net>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" +"Report-Msgid-Bugs-To: \n" + +#: cppexp.c:1253 +msgid "traditional C rejects the unary plus operator" +msgstr "C tradicional rebutja l'operador unari mes" + +#: cpperror.c:176 +#, c-format +msgid "%s: %s" +msgstr "%s: %s" + +#: cppcharset.c:653 +#, fuzzy, c-format +msgid "conversion from %s to %s not supported by iconv" +msgstr "la conversió de \"%T\" a \"%T\" és ambigua" + +#: cppcharset.c:656 +msgid "iconv_open" +msgstr "" + +#. FIXME: should be DL_SORRY +#: cppcharset.c:664 +#, c-format +msgid "no iconv implementation, cannot convert from %s to %s" +msgstr "" + +#: cppcharset.c:808 +#, fuzzy +msgid "universal character names are only valid in C++ and C99" +msgstr "universal-character-name \"\\U%08x\" no és vàlid en l'identificador" + +#: cppcharset.c:811 +#, c-format +msgid "the meaning of '\\%c' is different in traditional C" +msgstr "el significat de \"\\%c\" és diferent en C tradicional" + +#: cppcharset.c:837 +#, fuzzy, c-format +msgid "incomplete universal character name %.*s" +msgstr "universal-character-name incomplet" + +#: cppcharset.c:849 +#, fuzzy, c-format +msgid "%.*s is not a valid universal character" +msgstr "\"%T::%D\" no és una declaració vàlida" + +#: cppcharset.c:859 +#, fuzzy, c-format +msgid "universal character %.*s is not valid in an identifier" +msgstr "universal-character-name \"\\U%08x\" no és vàlid en l'identificador" + +#: cppcharset.c:863 +#, fuzzy, c-format +msgid "universal character %.*s is not valid at the start of an identifier" +msgstr "universal-character-name \"\\U%08x\" no és vàlid en l'identificador" + +#: cppcharset.c:898 +#, fuzzy +msgid "converting UCN to source character set" +msgstr "convertint NULL a un tipus que no és apuntador" + +#: cppcharset.c:902 +#, fuzzy +msgid "converting UCN to execution character set" +msgstr "convertint NULL a un tipus que no és apuntador" + +#: cppcharset.c:967 +msgid "the meaning of '\\x' is different in traditional C" +msgstr "el significat de \"\\x\" és diferent en C tradicional" + +#: cppcharset.c:984 f/lex.c:580 +msgid "\\x used with no following hex digits" +msgstr "es va usar \\x sense dígits hexadecimales a continuació" + +#: cppcharset.c:991 +msgid "hex escape sequence out of range" +msgstr "seqüència d'escapi hexadecimal fora de rang" + +#: cppcharset.c:1030 +msgid "octal escape sequence out of range" +msgstr "seqüència d'escapi octal fora de rang" + +#: cppcharset.c:1098 +msgid "the meaning of '\\a' is different in traditional C" +msgstr "el significat de \"\\a\" és diferent en C tradicional" + +#: cppcharset.c:1105 +#, c-format +msgid "non-ISO-standard escape sequence, '\\%c'" +msgstr "seqüència d'escapi que no és estàndard ISO, \"\\%c\"" + +#: cppcharset.c:1113 +#, c-format +msgid "unknown escape sequence '\\%c'" +msgstr "seqüència d'escapi \"\\%c\" desconeguda" + +#: cppcharset.c:1116 +#, c-format +msgid "unknown escape sequence: '\\%03o'" +msgstr "seqüència d'escapi desconeguda: '\\%03o'" + +#: cppcharset.c:1122 +#, fuzzy +msgid "converting escape sequence to execution character set" +msgstr "seqüència d'escapi octal fora de rang" + +#: cppcharset.c:1181 +msgid "converting to execution character set" +msgstr "" + +#: cppcharset.c:1244 cppcharset.c:1307 +msgid "character constant too long for its type" +msgstr "constant de caràcter massa gran pel seu tipus" + +#: cppcharset.c:1247 +msgid "multi-character character constant" +msgstr "constant de caràcter amb múltiples caràcters" + +#: cppcharset.c:1339 +msgid "empty character constant" +msgstr "constant de caràter buida" + +#: cppcharset.c:1378 +#, fuzzy, c-format +msgid "failure to convert %s to %s" +msgstr "no es pot convertir \"%E\" a \"%T\"" + +#: cpperror.c:110 diagnostic.def:5 +msgid "warning: " +msgstr "avís: " + +#: cpperror.c:112 +msgid "internal error: " +msgstr "error intern: " + +#: cpperror.c:174 +msgid "stdout" +msgstr "stdout" + +#: cppexp.c:192 +msgid "too many decimal points in number" +msgstr "massa punts decimals en el nombre" + +#: cppexp.c:212 +#, c-format +msgid "invalid digit \"%c\" in octal constant" +msgstr "dígit \"%c\" invàlid en la constant octal" + +#: cppexp.c:218 +msgid "use of C99 hexadecimal floating constant" +msgstr "ús d'una constant de coma flotant hexadecimal C99" + +#: cppexp.c:227 +msgid "exponent has no digits" +msgstr "exponent no té dígits" + +#: cppexp.c:234 +msgid "hexadecimal floating constants require an exponent" +msgstr "la constant de coma flotant hexadecimal requereixe un exponent" + +#: cppexp.c:240 +#, c-format +msgid "invalid suffix \"%.*s\" on floating constant" +msgstr "sufix \"%.*s\" invàlid en la constant de coma flotant" + +#: cppexp.c:250 cppexp.c:275 +#, c-format +msgid "traditional C rejects the \"%.*s\" suffix" +msgstr "C tradicional rebutja el sufix \"%.*s\"" + +#: cppexp.c:261 +#, c-format +msgid "invalid suffix \"%.*s\" on integer constant" +msgstr "sufix \"%.*s\" invàlid en constant entera" + +#: cppexp.c:283 +msgid "use of C99 long long integer constant" +msgstr "ús d'una constant entera long long C99" + +#: cppexp.c:290 +msgid "imaginary constants are a GCC extension" +msgstr "les constants imaginàries són una extensió GCC" + +#: cppexp.c:376 +msgid "integer constant is too large for its type" +msgstr "la constant entera és massa gran per al seu tipus" + +#: cppexp.c:388 +msgid "integer constant is so large that it is unsigned" +msgstr "la constant entera és tan gran que és unsigned" + +#: cppexp.c:470 +msgid "missing ')' after \"defined\"" +msgstr "falta \")\" després de \"defined\"" + +#: cppexp.c:477 +msgid "operator \"defined\" requires an identifier" +msgstr "l'operador \"defined\" requereix un identificador" + +#: cppexp.c:485 +#, c-format +msgid "(\"%s\" is an alternative token for \"%s\" in C++)" +msgstr "(\"%s\" és un element alternatiu per a \"%s\" en C++)" + +#: cppexp.c:495 +msgid "this use of \"defined\" may not be portable" +msgstr "aquest ùs de \"defined\" podria ser no portable" + +#: cppexp.c:531 +msgid "floating constant in preprocessor expression" +msgstr "constant de coma flotant en l'expressió del preprocessador" + +#: cppexp.c:537 +msgid "imaginary number in preprocessor expression" +msgstr "nombre imaginari en l'expressió del preprocessador" + +#: cppexp.c:582 +#, c-format +msgid "\"%s\" is not defined" +msgstr "\"%s\" no és definit" + +#: cppexp.c:714 cppexp.c:743 +#, c-format +msgid "missing binary operator before token \"%s\"" +msgstr "operador binari faltant abans de l'element \"%s\"" + +#: cppexp.c:734 +#, c-format +msgid "token \"%s\" is not valid in preprocessor expressions" +msgstr "l'element \"%s\" no és vàlid en les expressions del preprocesador" + +#: cppexp.c:753 +msgid "void expression between '(' and ')'" +msgstr "expressión void entre \"(\" i \")\"" + +#: cppexp.c:756 +msgid "#if with no expression" +msgstr "#if sense expressió" + +#: cppexp.c:758 +#, c-format +msgid "operator '%s' has no right operand" +msgstr "l'operador \"%s\" no té operant de dreta" + +#: cppexp.c:784 +msgid " ':' without preceding '?'" +msgstr " \":\" sense \"?\" precedent" + +#: cppexp.c:811 +msgid "unbalanced stack in #if" +msgstr "pila desequilibrada en #if" + +#: cppexp.c:830 +#, c-format +msgid "impossible operator '%u'" +msgstr "operador \"%u\" impossible" + +#: cppexp.c:922 +msgid "missing ')' in expression" +msgstr "\")\" faltant en l'expressió" + +#: cppexp.c:943 +msgid "'?' without following ':'" +msgstr " \"?\" sense \":\" següent" + +#: cppexp.c:953 +msgid "integer overflow in preprocessor expression" +msgstr "desbordament d'enter en l'expressió del preprocessador" + +#: cppexp.c:958 +msgid "missing '(' in expression" +msgstr "\"(\" faltant en l'expressió" + +#: cppexp.c:990 +#, c-format +msgid "the left operand of \"%s\" changes sign when promoted" +msgstr "l'operant esquerre de \"%s\" canvia el signe quan és promogut" + +#: cppexp.c:995 +#, c-format +msgid "the right operand of \"%s\" changes sign when promoted" +msgstr "l'operant dret de \"%s\" canvia el signe quan és promogut" + +#: cppexp.c:1352 +msgid "comma operator in operand of #if" +msgstr "operador coma en operant de #if" + +#: cppexp.c:1483 +msgid "division by zero in #if" +msgstr "divisió per zero en #if" + +#: cppfiles.c:375 +msgid "NULL directory in find_file" +msgstr "" + +#: cppfiles.c:402 +msgid "one or more PCH files were found, but they were invalid" +msgstr "" + +#: cppfiles.c:405 +msgid "use -Winvalid-pch for more information" +msgstr "" + +#: cppfiles.c:463 +#, c-format +msgid "%s is a block device" +msgstr "%s és un dispositiu de blocs" + +#: cppfiles.c:480 +#, c-format +msgid "%s is too large" +msgstr "%s és massa gran" + +#: cppfiles.c:515 +#, c-format +msgid "%s is shorter than expected" +msgstr "%s és més curt de l'esperat" + +#: cppfiles.c:714 +#, fuzzy, c-format +msgid "no include path in which to search for %s" +msgstr "no hi ha ruta d'inclusió en la qual es trobi %s" + +#: cppfiles.c:974 +msgid "Multiple include guards may be useful for:\n" +msgstr "Guàrdies múltiples de include poden ser útils per a:\n" + +#: cppinit.c:389 +msgid "cppchar_t must be an unsigned type" +msgstr "cppchar_t deu ser d'un tipus unsigned" + +#: cppinit.c:393 +#, c-format +msgid "" +"preprocessor arithmetic has maximum precision of %lu bits; target requires %" +"lu bits" +msgstr "" +"l'aritmètica del preprocesador té una precisió màxima de %lu bits; " +"l'objectiu requereix %lu bits" + +#: cppinit.c:400 +msgid "CPP arithmetic must be at least as precise as a target int" +msgstr "" +"l'aritmètica de CPP deu ser almenys tan precisa com un int de l'objectiu" + +#: cppinit.c:403 +msgid "target char is less than 8 bits wide" +msgstr "el char de l'objectiu té menys de 8 bits d'ample" + +#: cppinit.c:407 +msgid "target wchar_t is narrower than target char" +msgstr "el wchar_t de l'objectiu és més estret que el char de l'objectiu" + +#: cppinit.c:411 +msgid "target int is narrower than target char" +msgstr "el int de l'objectiu és més estret que el char de l'objectiu" + +#: cppinit.c:416 +msgid "CPP half-integer narrower than CPP character" +msgstr "el mitj-enter de CPP és més estret que el caràcter de CPP" + +#: cppinit.c:420 +#, c-format +msgid "" +"CPP on this host cannot handle wide character constants over %lu bits, but " +"the target requires %lu bits" +msgstr "" +"CPP no pot manejar constants de caràcter amples més enllà de %lu bits en " +"aquestobjectiu, però l'objectiu requereix %lu bits" + +#: cpplex.c:410 +msgid "null character(s) ignored" +msgstr "caràter(es) nul(s) ignorats" + +#: cpplex.c:445 +#, fuzzy +msgid "'$' in identifier or number" +msgstr "caràcter/(es) \"$\" en l'identificador o nombre" + +#: cpplex.c:492 +#, c-format +msgid "attempt to use poisoned \"%s\"" +msgstr "intent d'usar \"%s\" enverinat" + +#: cpplex.c:500 +msgid "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro" +msgstr "" +"__VA_ARGS__ solament pot aparèixer en l'expansió d'una macro variadic C99" + +#: cpplex.c:596 +msgid "null character(s) preserved in literal" +msgstr "caràcter(es) nul(s) preservats en la literal" + +#: cpplex.c:916 +msgid "unterminated comment" +msgstr "comentari sense acabar" + +#: cpplex.c:927 +msgid "C++ style comments are not allowed in ISO C90" +msgstr "els comentaris d'estil C++ no són permesos en ISO C90" + +#: cpplex.c:929 +msgid "(this will be reported only once per input file)" +msgstr "(això es reportarà solament una vegada per cada fitxer d'entrada)" + +#: cpplex.c:934 +msgid "multi-line comment" +msgstr "comentari en múltiples línies" + +#: cpplex.c:1198 +#, c-format +msgid "unspellable token %s" +msgstr "Element %s impronunciable" + +#: cpplib.c:218 +#, c-format +msgid "extra tokens at end of #%s directive" +msgstr "elements extra al final de la directiva #%s" + +#: cpplib.c:304 +#, c-format +msgid "#%s is a GCC extension" +msgstr "#%s és una extenció del GCC" + +#: cpplib.c:316 +msgid "suggest not using #elif in traditional C" +msgstr "es suggereix no usar #elif en C tradicional" + +#: cpplib.c:319 +#, c-format +msgid "traditional C ignores #%s with the # indented" +msgstr "C tradicional ignora #%s amb el # indentat" + +#: cpplib.c:323 +#, c-format +msgid "suggest hiding #%s from traditional C with an indented #" +msgstr "es suggereix ocultar #%s del C tradicional amb el # indentat" + +#: cpplib.c:345 +msgid "embedding a directive within macro arguments is not portable" +msgstr "" + +#: cpplib.c:365 +msgid "style of line directive is a GCC extension" +msgstr "l'estil de la directiva de línia és una extenció del GCC" + +#: cpplib.c:415 +#, c-format +msgid "invalid preprocessing directive #%s" +msgstr "directiva de preprocessament #%s invàlida" + +#: cpplib.c:484 +msgid "\"defined\" cannot be used as a macro name" +msgstr "\"defined\" no es pot usar com un nom de macro" + +#: cpplib.c:490 +#, c-format +msgid "\"%s\" cannot be used as a macro name as it is an operator in C++" +msgstr "no es pot usar \"%s\" com un nom de macro perquè és un operador en C++" + +#: cpplib.c:493 +#, c-format +msgid "no macro name given in #%s directive" +msgstr "no es va donar un nom de macro en la directiva #%s" + +#: cpplib.c:496 +msgid "macro names must be identifiers" +msgstr "els noms de macro deuen ser identificadors" + +#: cpplib.c:537 +#, c-format +msgid "undefining \"%s\"" +msgstr "esborrant la definició de \"%s\"" + +#: cpplib.c:609 +msgid "missing terminating > character" +msgstr "falta el caràcter de terminació >" + +#: cpplib.c:662 +#, c-format +msgid "#%s expects \"FILENAME\" or <FILENAME>" +msgstr "#%s espera \"NOM_DE_FITXER\" o <NOM_DE_FITXER>" + +#: cpplib.c:685 +msgid "#include nested too deeply" +msgstr "#include niat amb massa profunditat" + +#: cpplib.c:723 +msgid "#include_next in primary source file" +msgstr "#include_next en el fitxer font primari" + +#: cpplib.c:749 +#, c-format +msgid "invalid flag \"%s\" in line directive" +msgstr "indicador \"%s\" invàlid en la línia de la directiva" + +#: cpplib.c:794 +#, c-format +msgid "\"%s\" after #line is not a positive integer" +msgstr "\"%s\" desprès de #line no és un enter positiu" + +#: cpplib.c:800 +msgid "line number out of range" +msgstr "nombre de línia fora de rang" + +#: cpplib.c:812 cpplib.c:885 +#, c-format +msgid "\"%s\" is not a valid filename" +msgstr "\"%s\" no és un nom de fitxer vàlid" + +#: cpplib.c:847 +#, c-format +msgid "\"%s\" after # is not a positive integer" +msgstr "\"%s\" desprès de # no és un enter positiu" + +#: cpplib.c:947 +msgid "invalid #ident directive" +msgstr "directiva #ident invàlida" + +#: cpplib.c:1027 +#, c-format +msgid "registering \"%s\" as both a pragma and a pragma namespace" +msgstr "desant \"%s\" com a pragma i espai de noms de pragma" + +#: cpplib.c:1030 +#, c-format +msgid "#pragma %s %s is already registered" +msgstr "ja s'ha desat #pragma %s %s" + +#: cpplib.c:1033 +#, c-format +msgid "#pragma %s is already registered" +msgstr "ja s'ha desat #pragma %s" + +#: cpplib.c:1178 +msgid "#pragma once in main file" +msgstr "#pragma una vegada en el fitxer principal" + +#: cpplib.c:1201 +msgid "invalid #pragma GCC poison directive" +msgstr "directiva #pragma de GCC enverinada invàlida" + +#: cpplib.c:1210 +#, c-format +msgid "poisoning existing macro \"%s\"" +msgstr "enverinant la macro existent \"%s\"" + +#: cpplib.c:1231 +msgid "#pragma system_header ignored outside include file" +msgstr "#pragma system_header ignorat fora del fitxer d'inclusió" + +#: cpplib.c:1255 +#, fuzzy, c-format +msgid "cannot find source file %s" +msgstr "no es pot trobar la font %s" + +#: cpplib.c:1259 +#, c-format +msgid "current file is older than %s" +msgstr "el fitxer actual és més vell que %s" + +#: cpplib.c:1373 +msgid "_Pragma takes a parenthesized string literal" +msgstr "_Pragma duu una cadena literal entre parèntesis" + +#: cpplib.c:1451 +msgid "#else without #if" +msgstr "#else sense #if" + +#: cpplib.c:1456 +msgid "#else after #else" +msgstr "#else després de #else" + +#: cpplib.c:1484 +msgid "#elif without #if" +msgstr "#elif sense #if" + +#: cpplib.c:1489 +msgid "#elif after #else" +msgstr "#elif després de #else" + +#: cpplib.c:1519 +msgid "#endif without #if" +msgstr "#endif sense #if" + +#: cpplib.c:1596 +msgid "missing '(' after predicate" +msgstr "falta \"(\" abans del predicat" + +#: cpplib.c:1611 +msgid "missing ')' to complete answer" +msgstr "falta \")\" per a completar la resposta" + +#: cpplib.c:1631 +msgid "predicate's answer is empty" +msgstr "el predicat de la resposta està buidor" + +#: cpplib.c:1658 +msgid "assertion without predicate" +msgstr "afirmació sense predicat" + +#: cpplib.c:1660 +msgid "predicate must be an identifier" +msgstr "el predicat deu ser un identificador" + +#: cpplib.c:1744 +#, c-format +msgid "\"%s\" re-asserted" +msgstr "\"%s\" reafirmat" + +#: cppmacro.c:125 cppmacro.c:280 +#, c-format +msgid "invalid built-in macro \"%s\"" +msgstr "macro interna \"%s\" invàlida" + +#: cppmacro.c:221 +msgid "could not determine date and time" +msgstr "no es pot determinar la data i l'hora" + +#: cppmacro.c:393 +msgid "invalid string literal, ignoring final '\\'" +msgstr "cadena literal invàlida, s'ignora el \"\\\" finals" + +#: cppmacro.c:476 +#, c-format +msgid "pasting \"%s\" and \"%s\" does not give a valid preprocessing token" +msgstr "pegar \"%s\" i \"%s\" no dóna un element vàlid de preprocessament" + +#: cppmacro.c:514 +msgid "ISO C99 requires rest arguments to be used" +msgstr "ISO C99 requereix que la resta dels arguments sigui usat" + +#: cppmacro.c:519 +#, c-format +msgid "macro \"%s\" requires %u arguments, but only %u given" +msgstr "la macro \"%s\" requereix %u arguments, però sol es proporcionen %u" + +#: cppmacro.c:524 +#, c-format +msgid "macro \"%s\" passed %u arguments, but takes just %u" +msgstr "la macro \"%s\" va rebre %u arguments, però solament va prendre %u" + +#: cppmacro.c:635 +#, c-format +msgid "unterminated argument list invoking macro \"%s\"" +msgstr "llista d'arguments sense acabar a l'invocar la macro \"%s\"" + +#: cppmacro.c:738 +#, c-format +msgid "function-like macro \"%s\" must be used with arguments in traditional C" +msgstr "la funció de macro \"%s\" es deu usar amb arguments en C tradicional" + +#: cppmacro.c:1241 +#, c-format +msgid "duplicate macro parameter \"%s\"" +msgstr "paràmetre de macro \"%s\" duplicat" + +#: cppmacro.c:1286 +#, c-format +msgid "\"%s\" may not appear in macro parameter list" +msgstr "\"%s\" podria faltar en la llista de paràmetre de macro" + +#: cppmacro.c:1294 +msgid "macro parameters must be comma-separated" +msgstr "els paràmetres de macro deuen ser separats per comes" + +#: cppmacro.c:1311 +msgid "parameter name missing" +msgstr "falta el nom del paràmetre" + +#: cppmacro.c:1326 +msgid "anonymous variadic macros were introduced in C99" +msgstr "els macros variadic anònims es van introduir en C99" + +#: cppmacro.c:1330 +msgid "ISO C does not permit named variadic macros" +msgstr "ISO C no permet macros variadic nomenats" + +#: cppmacro.c:1339 +msgid "missing ')' in macro parameter list" +msgstr "falta parèntesi dret en la llista de paràmetres de macro" + +#: cppmacro.c:1402 +msgid "ISO C requires whitespace after the macro name" +msgstr "ISO C requereix espais en blanc després del nom de macro" + +#: cppmacro.c:1430 +msgid "'#' is not followed by a macro parameter" +msgstr "\"#\" no és seguit per un paràmetre de macro" + +#: cppmacro.c:1449 +msgid "'##' cannot appear at either end of a macro expansion" +msgstr "\"##\" no pot apareixer en o al final d'una expansió de macro" + +#: cppmacro.c:1588 +#, c-format +msgid "macro argument \"%s\" would be stringified in traditional C" +msgstr "" +"l'argument de macro \"%s\" deuria ser convertit a cadena en C traditional" + +#: cppmacro.c:1611 +#, c-format +msgid "invalid hash type %d in cpp_macro_definition" +msgstr "tipus de hash %d invàlid en cpp_macro_definition" + +#: cpppch.c:84 cpppch.c:332 cpppch.c:356 cpppch.c:365 cpppch.c:371 +msgid "while writing precompiled header" +msgstr "" + +#: cpppch.c:469 +#, fuzzy, c-format +msgid "%s: not used because `%.*s' not defined" +msgstr "s'usa l'etiqueta \"%s\" però no està definida" + +#: cpppch.c:481 +#, c-format +msgid "%s: not used because `%.*s' defined as `%s' not `%.*s'" +msgstr "" + +#: cpppch.c:522 +#, fuzzy, c-format +msgid "%s: not used because `%s' is defined" +msgstr "\"%s\" utilitzat però mai definit" + +#: cpppch.c:535 cpppch.c:724 +msgid "while reading precompiled header" +msgstr "" + +#: cppspec.c:106 +#, c-format +msgid "\"%s\" is not a valid option to the preprocessor" +msgstr "\"%s\" no es una opció vàlida per el preprocessador" + +#: cppspec.c:128 +msgid "too many input files" +msgstr "massa fitxers d'entrada" + +#: cpptrad.c:744 +#, c-format +msgid "detected recursion whilst expanding macro \"%s\"" +msgstr "" + +#: cpptrad.c:911 +#, fuzzy +msgid "syntax error in macro parameter list" +msgstr "\"%s\" podria faltar en la llista de paràmetre de macro" + +#: line-map.c:218 +#, c-format +msgid "In file included from %s:%u" +msgstr "En el fitxer inclòs dès de %s:%u" + +#. Translators note: this message is used in conjunction +#. with "In file included from %s:%ld" and some other +#. tricks. We want something like this: +#. +#. | In file included from sys/select.h:123, +#. | from sys/types.h:234, +#. | from userfile.c:31: +#. | bits/select.h:45: <error message here> +#. +#. with all the "from"s lined up. +#. The trailing comma is at the beginning of this message, +#. and the trailing colon is not translated. +#: line-map.c:236 +#, c-format +msgid "" +",\n" +" from %s:%u" +msgstr "" +",\n" +" dès de %s:%u" + diff --git a/libcpp/po/cpplib.pot b/libcpp/po/cpplib.pot new file mode 100644 index 00000000000..882bc6f6d71 --- /dev/null +++ b/libcpp/po/cpplib.pot @@ -0,0 +1,774 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" +"POT-Creation-Date: 2004-02-06 01:34+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: cppexp.c:1253 +msgid "traditional C rejects the unary plus operator" +msgstr "" + +#: cpperror.c:176 +#, c-format +msgid "%s: %s" +msgstr "" + +#: cppcharset.c:653 +#, c-format +msgid "conversion from %s to %s not supported by iconv" +msgstr "" + +#: cppcharset.c:656 +msgid "iconv_open" +msgstr "" + +#. FIXME: should be DL_SORRY +#: cppcharset.c:664 +#, c-format +msgid "no iconv implementation, cannot convert from %s to %s" +msgstr "" + +#: cppcharset.c:808 +msgid "universal character names are only valid in C++ and C99" +msgstr "" + +#: cppcharset.c:811 +#, c-format +msgid "the meaning of '\\%c' is different in traditional C" +msgstr "" + +#: cppcharset.c:837 +#, c-format +msgid "incomplete universal character name %.*s" +msgstr "" + +#: cppcharset.c:849 +#, c-format +msgid "%.*s is not a valid universal character" +msgstr "" + +#: cppcharset.c:859 +#, c-format +msgid "universal character %.*s is not valid in an identifier" +msgstr "" + +#: cppcharset.c:863 +#, c-format +msgid "universal character %.*s is not valid at the start of an identifier" +msgstr "" + +#: cppcharset.c:898 +msgid "converting UCN to source character set" +msgstr "" + +#: cppcharset.c:902 +msgid "converting UCN to execution character set" +msgstr "" + +#: cppcharset.c:967 +msgid "the meaning of '\\x' is different in traditional C" +msgstr "" + +#: cppcharset.c:984 f/lex.c:580 +msgid "\\x used with no following hex digits" +msgstr "" + +#: cppcharset.c:991 +msgid "hex escape sequence out of range" +msgstr "" + +#: cppcharset.c:1030 +msgid "octal escape sequence out of range" +msgstr "" + +#: cppcharset.c:1098 +msgid "the meaning of '\\a' is different in traditional C" +msgstr "" + +#: cppcharset.c:1105 +#, c-format +msgid "non-ISO-standard escape sequence, '\\%c'" +msgstr "" + +#: cppcharset.c:1113 +#, c-format +msgid "unknown escape sequence '\\%c'" +msgstr "" + +#: cppcharset.c:1116 +#, c-format +msgid "unknown escape sequence: '\\%03o'" +msgstr "" + +#: cppcharset.c:1122 +msgid "converting escape sequence to execution character set" +msgstr "" + +#: cppcharset.c:1181 +msgid "converting to execution character set" +msgstr "" + +#: cppcharset.c:1244 cppcharset.c:1307 +msgid "character constant too long for its type" +msgstr "" + +#: cppcharset.c:1247 +msgid "multi-character character constant" +msgstr "" + +#: cppcharset.c:1339 +msgid "empty character constant" +msgstr "" + +#: cppcharset.c:1378 +#, c-format +msgid "failure to convert %s to %s" +msgstr "" + +#: cpperror.c:110 diagnostic.def:5 +msgid "warning: " +msgstr "" + +#: cpperror.c:112 +msgid "internal error: " +msgstr "" + +#: cpperror.c:174 +msgid "stdout" +msgstr "" + +#: cppexp.c:192 +msgid "too many decimal points in number" +msgstr "" + +#: cppexp.c:212 +#, c-format +msgid "invalid digit \"%c\" in octal constant" +msgstr "" + +#: cppexp.c:218 +msgid "use of C99 hexadecimal floating constant" +msgstr "" + +#: cppexp.c:227 +msgid "exponent has no digits" +msgstr "" + +#: cppexp.c:234 +msgid "hexadecimal floating constants require an exponent" +msgstr "" + +#: cppexp.c:240 +#, c-format +msgid "invalid suffix \"%.*s\" on floating constant" +msgstr "" + +#: cppexp.c:250 cppexp.c:275 +#, c-format +msgid "traditional C rejects the \"%.*s\" suffix" +msgstr "" + +#: cppexp.c:261 +#, c-format +msgid "invalid suffix \"%.*s\" on integer constant" +msgstr "" + +#: cppexp.c:283 +msgid "use of C99 long long integer constant" +msgstr "" + +#: cppexp.c:290 +msgid "imaginary constants are a GCC extension" +msgstr "" + +#: cppexp.c:376 +msgid "integer constant is too large for its type" +msgstr "" + +#: cppexp.c:388 +msgid "integer constant is so large that it is unsigned" +msgstr "" + +#: cppexp.c:470 +msgid "missing ')' after \"defined\"" +msgstr "" + +#: cppexp.c:477 +msgid "operator \"defined\" requires an identifier" +msgstr "" + +#: cppexp.c:485 +#, c-format +msgid "(\"%s\" is an alternative token for \"%s\" in C++)" +msgstr "" + +#: cppexp.c:495 +msgid "this use of \"defined\" may not be portable" +msgstr "" + +#: cppexp.c:531 +msgid "floating constant in preprocessor expression" +msgstr "" + +#: cppexp.c:537 +msgid "imaginary number in preprocessor expression" +msgstr "" + +#: cppexp.c:582 +#, c-format +msgid "\"%s\" is not defined" +msgstr "" + +#: cppexp.c:714 cppexp.c:743 +#, c-format +msgid "missing binary operator before token \"%s\"" +msgstr "" + +#: cppexp.c:734 +#, c-format +msgid "token \"%s\" is not valid in preprocessor expressions" +msgstr "" + +#: cppexp.c:753 +msgid "void expression between '(' and ')'" +msgstr "" + +#: cppexp.c:756 +msgid "#if with no expression" +msgstr "" + +#: cppexp.c:758 +#, c-format +msgid "operator '%s' has no right operand" +msgstr "" + +#: cppexp.c:784 +msgid " ':' without preceding '?'" +msgstr "" + +#: cppexp.c:811 +msgid "unbalanced stack in #if" +msgstr "" + +#: cppexp.c:830 +#, c-format +msgid "impossible operator '%u'" +msgstr "" + +#: cppexp.c:922 +msgid "missing ')' in expression" +msgstr "" + +#: cppexp.c:943 +msgid "'?' without following ':'" +msgstr "" + +#: cppexp.c:953 +msgid "integer overflow in preprocessor expression" +msgstr "" + +#: cppexp.c:958 +msgid "missing '(' in expression" +msgstr "" + +#: cppexp.c:990 +#, c-format +msgid "the left operand of \"%s\" changes sign when promoted" +msgstr "" + +#: cppexp.c:995 +#, c-format +msgid "the right operand of \"%s\" changes sign when promoted" +msgstr "" + +#: cppexp.c:1352 +msgid "comma operator in operand of #if" +msgstr "" + +#: cppexp.c:1483 +msgid "division by zero in #if" +msgstr "" + +#: cppfiles.c:375 +msgid "NULL directory in find_file" +msgstr "" + +#: cppfiles.c:402 +msgid "one or more PCH files were found, but they were invalid" +msgstr "" + +#: cppfiles.c:405 +msgid "use -Winvalid-pch for more information" +msgstr "" + +#: cppfiles.c:463 +#, c-format +msgid "%s is a block device" +msgstr "" + +#: cppfiles.c:480 +#, c-format +msgid "%s is too large" +msgstr "" + +#: cppfiles.c:515 +#, c-format +msgid "%s is shorter than expected" +msgstr "" + +#: cppfiles.c:714 +#, c-format +msgid "no include path in which to search for %s" +msgstr "" + +#: cppfiles.c:974 +msgid "Multiple include guards may be useful for:\n" +msgstr "" + +#: cppinit.c:389 +msgid "cppchar_t must be an unsigned type" +msgstr "" + +#: cppinit.c:393 +#, c-format +msgid "" +"preprocessor arithmetic has maximum precision of %lu bits; target requires %" +"lu bits" +msgstr "" + +#: cppinit.c:400 +msgid "CPP arithmetic must be at least as precise as a target int" +msgstr "" + +#: cppinit.c:403 +msgid "target char is less than 8 bits wide" +msgstr "" + +#: cppinit.c:407 +msgid "target wchar_t is narrower than target char" +msgstr "" + +#: cppinit.c:411 +msgid "target int is narrower than target char" +msgstr "" + +#: cppinit.c:416 +msgid "CPP half-integer narrower than CPP character" +msgstr "" + +#: cppinit.c:420 +#, c-format +msgid "" +"CPP on this host cannot handle wide character constants over %lu bits, but " +"the target requires %lu bits" +msgstr "" + +#: cpplex.c:410 +msgid "null character(s) ignored" +msgstr "" + +#: cpplex.c:445 +msgid "'$' in identifier or number" +msgstr "" + +#: cpplex.c:492 +#, c-format +msgid "attempt to use poisoned \"%s\"" +msgstr "" + +#: cpplex.c:500 +msgid "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro" +msgstr "" + +#: cpplex.c:596 +msgid "null character(s) preserved in literal" +msgstr "" + +#: cpplex.c:916 +msgid "unterminated comment" +msgstr "" + +#: cpplex.c:927 +msgid "C++ style comments are not allowed in ISO C90" +msgstr "" + +#: cpplex.c:929 +msgid "(this will be reported only once per input file)" +msgstr "" + +#: cpplex.c:934 +msgid "multi-line comment" +msgstr "" + +#: cpplex.c:1198 +#, c-format +msgid "unspellable token %s" +msgstr "" + +#: cpplib.c:218 +#, c-format +msgid "extra tokens at end of #%s directive" +msgstr "" + +#: cpplib.c:304 +#, c-format +msgid "#%s is a GCC extension" +msgstr "" + +#: cpplib.c:316 +msgid "suggest not using #elif in traditional C" +msgstr "" + +#: cpplib.c:319 +#, c-format +msgid "traditional C ignores #%s with the # indented" +msgstr "" + +#: cpplib.c:323 +#, c-format +msgid "suggest hiding #%s from traditional C with an indented #" +msgstr "" + +#: cpplib.c:345 +msgid "embedding a directive within macro arguments is not portable" +msgstr "" + +#: cpplib.c:365 +msgid "style of line directive is a GCC extension" +msgstr "" + +#: cpplib.c:415 +#, c-format +msgid "invalid preprocessing directive #%s" +msgstr "" + +#: cpplib.c:484 +msgid "\"defined\" cannot be used as a macro name" +msgstr "" + +#: cpplib.c:490 +#, c-format +msgid "\"%s\" cannot be used as a macro name as it is an operator in C++" +msgstr "" + +#: cpplib.c:493 +#, c-format +msgid "no macro name given in #%s directive" +msgstr "" + +#: cpplib.c:496 +msgid "macro names must be identifiers" +msgstr "" + +#: cpplib.c:537 +#, c-format +msgid "undefining \"%s\"" +msgstr "" + +#: cpplib.c:609 +msgid "missing terminating > character" +msgstr "" + +#: cpplib.c:662 +#, c-format +msgid "#%s expects \"FILENAME\" or <FILENAME>" +msgstr "" + +#: cpplib.c:685 +msgid "#include nested too deeply" +msgstr "" + +#: cpplib.c:723 +msgid "#include_next in primary source file" +msgstr "" + +#: cpplib.c:749 +#, c-format +msgid "invalid flag \"%s\" in line directive" +msgstr "" + +#: cpplib.c:794 +#, c-format +msgid "\"%s\" after #line is not a positive integer" +msgstr "" + +#: cpplib.c:800 +msgid "line number out of range" +msgstr "" + +#: cpplib.c:812 cpplib.c:885 +#, c-format +msgid "\"%s\" is not a valid filename" +msgstr "" + +#: cpplib.c:847 +#, c-format +msgid "\"%s\" after # is not a positive integer" +msgstr "" + +#: cpplib.c:947 +msgid "invalid #ident directive" +msgstr "" + +#: cpplib.c:1027 +#, c-format +msgid "registering \"%s\" as both a pragma and a pragma namespace" +msgstr "" + +#: cpplib.c:1030 +#, c-format +msgid "#pragma %s %s is already registered" +msgstr "" + +#: cpplib.c:1033 +#, c-format +msgid "#pragma %s is already registered" +msgstr "" + +#: cpplib.c:1178 +msgid "#pragma once in main file" +msgstr "" + +#: cpplib.c:1201 +msgid "invalid #pragma GCC poison directive" +msgstr "" + +#: cpplib.c:1210 +#, c-format +msgid "poisoning existing macro \"%s\"" +msgstr "" + +#: cpplib.c:1231 +msgid "#pragma system_header ignored outside include file" +msgstr "" + +#: cpplib.c:1255 +#, c-format +msgid "cannot find source file %s" +msgstr "" + +#: cpplib.c:1259 +#, c-format +msgid "current file is older than %s" +msgstr "" + +#: cpplib.c:1373 +msgid "_Pragma takes a parenthesized string literal" +msgstr "" + +#: cpplib.c:1451 +msgid "#else without #if" +msgstr "" + +#: cpplib.c:1456 +msgid "#else after #else" +msgstr "" + +#: cpplib.c:1484 +msgid "#elif without #if" +msgstr "" + +#: cpplib.c:1489 +msgid "#elif after #else" +msgstr "" + +#: cpplib.c:1519 +msgid "#endif without #if" +msgstr "" + +#: cpplib.c:1596 +msgid "missing '(' after predicate" +msgstr "" + +#: cpplib.c:1611 +msgid "missing ')' to complete answer" +msgstr "" + +#: cpplib.c:1631 +msgid "predicate's answer is empty" +msgstr "" + +#: cpplib.c:1658 +msgid "assertion without predicate" +msgstr "" + +#: cpplib.c:1660 +msgid "predicate must be an identifier" +msgstr "" + +#: cpplib.c:1744 +#, c-format +msgid "\"%s\" re-asserted" +msgstr "" + +#: cppmacro.c:125 cppmacro.c:280 +#, c-format +msgid "invalid built-in macro \"%s\"" +msgstr "" + +#: cppmacro.c:221 +msgid "could not determine date and time" +msgstr "" + +#: cppmacro.c:393 +msgid "invalid string literal, ignoring final '\\'" +msgstr "" + +#: cppmacro.c:476 +#, c-format +msgid "pasting \"%s\" and \"%s\" does not give a valid preprocessing token" +msgstr "" + +#: cppmacro.c:514 +msgid "ISO C99 requires rest arguments to be used" +msgstr "" + +#: cppmacro.c:519 +#, c-format +msgid "macro \"%s\" requires %u arguments, but only %u given" +msgstr "" + +#: cppmacro.c:524 +#, c-format +msgid "macro \"%s\" passed %u arguments, but takes just %u" +msgstr "" + +#: cppmacro.c:635 +#, c-format +msgid "unterminated argument list invoking macro \"%s\"" +msgstr "" + +#: cppmacro.c:738 +#, c-format +msgid "function-like macro \"%s\" must be used with arguments in traditional C" +msgstr "" + +#: cppmacro.c:1241 +#, c-format +msgid "duplicate macro parameter \"%s\"" +msgstr "" + +#: cppmacro.c:1286 +#, c-format +msgid "\"%s\" may not appear in macro parameter list" +msgstr "" + +#: cppmacro.c:1294 +msgid "macro parameters must be comma-separated" +msgstr "" + +#: cppmacro.c:1311 +msgid "parameter name missing" +msgstr "" + +#: cppmacro.c:1326 +msgid "anonymous variadic macros were introduced in C99" +msgstr "" + +#: cppmacro.c:1330 +msgid "ISO C does not permit named variadic macros" +msgstr "" + +#: cppmacro.c:1339 +msgid "missing ')' in macro parameter list" +msgstr "" + +#: cppmacro.c:1402 +msgid "ISO C requires whitespace after the macro name" +msgstr "" + +#: cppmacro.c:1430 +msgid "'#' is not followed by a macro parameter" +msgstr "" + +#: cppmacro.c:1449 +msgid "'##' cannot appear at either end of a macro expansion" +msgstr "" + +#: cppmacro.c:1588 +#, c-format +msgid "macro argument \"%s\" would be stringified in traditional C" +msgstr "" + +#: cppmacro.c:1611 +#, c-format +msgid "invalid hash type %d in cpp_macro_definition" +msgstr "" + +#: cpppch.c:84 cpppch.c:332 cpppch.c:356 cpppch.c:365 cpppch.c:371 +msgid "while writing precompiled header" +msgstr "" + +#: cpppch.c:469 +#, c-format +msgid "%s: not used because `%.*s' not defined" +msgstr "" + +#: cpppch.c:481 +#, c-format +msgid "%s: not used because `%.*s' defined as `%s' not `%.*s'" +msgstr "" + +#: cpppch.c:522 +#, c-format +msgid "%s: not used because `%s' is defined" +msgstr "" + +#: cpppch.c:535 cpppch.c:724 +msgid "while reading precompiled header" +msgstr "" + +#: cppspec.c:106 +#, c-format +msgid "\"%s\" is not a valid option to the preprocessor" +msgstr "" + +#: cppspec.c:128 +msgid "too many input files" +msgstr "" + +#: cpptrad.c:744 +#, c-format +msgid "detected recursion whilst expanding macro \"%s\"" +msgstr "" + +#: cpptrad.c:911 +msgid "syntax error in macro parameter list" +msgstr "" + +#: line-map.c:218 +#, c-format +msgid "In file included from %s:%u" +msgstr "" + +#. Translators note: this message is used in conjunction +#. with "In file included from %s:%ld" and some other +#. tricks. We want something like this: +#. +#. | In file included from sys/select.h:123, +#. | from sys/types.h:234, +#. | from userfile.c:31: +#. | bits/select.h:45: <error message here> +#. +#. with all the "from"s lined up. +#. The trailing comma is at the beginning of this message, +#. and the trailing colon is not translated. +#: line-map.c:236 +#, c-format +msgid "" +",\n" +" from %s:%u" +msgstr "" + diff --git a/libcpp/po/da.po b/libcpp/po/da.po new file mode 100644 index 00000000000..d35d6666640 --- /dev/null +++ b/libcpp/po/da.po @@ -0,0 +1,911 @@ +# Danish version of GCC strings. +# Copyright (C) 2002, 03 Free Software Foundation, Inc. +# Ole Laursen <olau@hardworking.dk>, 2001, 02, 03. +# +# Konventioner: +# +# ABI -> binær grænseflade +# ANSI -> (har jeg tilladt mig at opdatere til (modsvarer Info-hjælpen)) ISO +# access -> tilgangs- +# aggregate -> en variabel af en sammensat type (fx struct, class) +# ambigeous -> tvetydig +# arg, argument -> parameter (for ikke at blande sammen med diskussionsargument) +# array -> tabel +# assembler -> maskinkodeoversætter +# assertion -> postulat +# attribute -> egenskab +# base class -> stamklasse +# basic block -> basisblok (funktioner deles op i disse under oversættelsen) +# braces -> krøllede paranteser +# braced-group -> sætningsblok +# branch -> forgrening +# buffer -> mellemlager +# cast -> typetildeling, omtvingelse af typen +# con-/destructor -> kon-/destruktionsfunktion +# conflicting -> modstridende +# convert -> konvertere, omdanne +# declared -> erklæret +# defaults to -> antages at være +# dereference -> følge +# discard -> fjerne +# discard -> kassere +# driver -> styringsprogram +# duplicate -> optræder mere end én gang; mangfoldiggøre +# edge list -> kantliste +# elt -> udtrykstræ +# endian -> endet (fx storendet, lillendet) +# endianness -> endethed +# exception handling -> håndtering af undtagelser +# excess -> for mange +# expansion -> udfoldning +# extra -> (ret ofte) overskydende +# floating point -> kommatal +# formals -> parametre +# format string -> formateringsstreng +# forward -> forhånd (f.eks. forhåndserklæring) +# frame table -> rammetabel +# friend -> ven(ne-) +# gp (general purpose) register -> alment register (havde først brug- med, med det er overflødigt) +# hard register -> hardware-register +# have no effect -> udvirker intet +# identifier -> kaldenavn +# incompatible -> uforenelig, passer ikke +# incomplete -> ufuldstændig +# initialize -> tildele startværdi, klargøre +# initializer -> startværdi +# initializer list -> klargøringsliste +# inline -> integrede, indbygges (eller som reserveret ord: inline) +# instance -> instans (fx af en klasse) +# issue (fx warnings) -> fremkom med +# iterator -> løkkevariabel +# junk -> ragelse +# keyword -> reserveret ord +# label -> etiket +# linking -> sammenkædning +# lvalue -> venstreværdi +# macro -> makro +# malformed -> forkert udformet, misdannet +# member function/method -> [medlems]funktion (metode i Objective C) +# mismatch -> passer ikke med +# mmap -> indlæse +# modifier, qualifier -> modifikation +# multiple inheritance -> multipel nedarvning +# newline -> linjeskift +# non-numeric -> ikke et tal +# null character -> nultegn +# null pointer -> nul[-]henvisning +# offset -> forskydning +# opcodes (til ovenstående) -> instruktioner +# out of range -> uden for det gyldige (til tider mulige) interval +# overflow -> (til tider) løber over +# overlap -> [interval]sammenfald +# overloading -> flertydiggørelse +# padding -> udfylning +# pass -> overbringe (fx parametre), videregive +# pointer -> henvisning[svariabel] +# preprocessor -> præprocessor +# profiling -> profilering +# promote -> forfremme +# request -> (til tider) forespørgsel +# return -> returnerer +# schedule -> planlæg +# scope -> virkningsfelt +# shadowing -> skygger for +# shift -> skift +# specified -> (oftest) angivet +# specifier -> anvisning, angivelse +# stab -> stik (?) +# statement -> sætning +# storage class -> lagringsklasse +# strict -> nøje +# string -> streng +# subscript -> indeks, opslag +# target -> mål[arkitektur] +# template -> skabelon +# thrown -> kastet +# token -> symbol +# top-level -> øverste niveau +# trigraphs ('??%c'-dimser) -> trigrafer +# undefine -> glemme definitionen +# undefined blahblah -> blahblah er ikke defineret +# underscore -> understreg +# universal-character-name -> universelt tegn[navn] +# unsigned -> uden fortegn +# varargs -> variable parameterlister +# variadic macro -> makro med vilkårligt antal parametre +# variabels -> variabler (med afslutnings-r) +# vtable -> virtuel tabel +# wide character -> bredtegn +# white space -> mellemrum +# whitespace -> mellemrum +# +# Reserverede ord ofte ikke oversat, ej heller er der anbragt ' omkring +# (fx unsigned -> unsigned; derimod function -> funktion). Forkortelser +# som decl (for declaration) og arg (for argument) er oversat uforkortet +# - der er jo masser af plads at tage af. +# +msgid "" +msgstr "" +"Project-Id-Version: gcc 3.3\n" +"POT-Creation-Date: 2004-02-06 01:34+0000\n" +"PO-Revision-Date: 2003-05-25 18:00+0200\n" +"Last-Translator: Ole Laursen <olau@hardworking.dk>\n" +"Language-Team: Danish <dansk@klid.dk>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" +"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" + +#: cppexp.c:1253 +msgid "traditional C rejects the unary plus operator" +msgstr "traditionel C tillader ikke operatoren unær plus" + +#: cpperror.c:176 +#, c-format +msgid "%s: %s" +msgstr "%s: %s" + +#: cppcharset.c:653 +#, fuzzy, c-format +msgid "conversion from %s to %s not supported by iconv" +msgstr "konvertering fra NaN til unsigned int" + +#: cppcharset.c:656 +msgid "iconv_open" +msgstr "" + +#. FIXME: should be DL_SORRY +#: cppcharset.c:664 +#, c-format +msgid "no iconv implementation, cannot convert from %s to %s" +msgstr "" + +#: cppcharset.c:808 +#, fuzzy +msgid "universal character names are only valid in C++ and C99" +msgstr "universelt tegn '\\U%08x' er ikke gyldigt i kaldenavne" + +#: cppcharset.c:811 +#, c-format +msgid "the meaning of '\\%c' is different in traditional C" +msgstr "betydningen af '\\%c' er anderledes i traditionel C" + +#: cppcharset.c:837 +#, fuzzy, c-format +msgid "incomplete universal character name %.*s" +msgstr "ufuldstændigt universelt tegnnavn" + +#: cppcharset.c:849 +#, fuzzy, c-format +msgid "%.*s is not a valid universal character" +msgstr "'%T::%D' er ikke en gyldig erklærer" + +#: cppcharset.c:859 +#, fuzzy, c-format +msgid "universal character %.*s is not valid in an identifier" +msgstr "universelt tegn '\\U%08x' er ikke gyldigt i kaldenavne" + +#: cppcharset.c:863 +#, fuzzy, c-format +msgid "universal character %.*s is not valid at the start of an identifier" +msgstr "universelt tegn '\\U%08x' er ikke gyldigt i kaldenavne" + +#: cppcharset.c:898 +#, fuzzy +msgid "converting UCN to source character set" +msgstr "konverterer NULL til en ikke-henvisningstype" + +#: cppcharset.c:902 +#, fuzzy +msgid "converting UCN to execution character set" +msgstr "konverterer NULL til en ikke-henvisningstype" + +#: cppcharset.c:967 +msgid "the meaning of '\\x' is different in traditional C" +msgstr "betydningen af '\\x' er anderledes i traditionel C" + +#: cppcharset.c:984 f/lex.c:580 +msgid "\\x used with no following hex digits" +msgstr "\\x angivet uden efterfølgende hexadecimale cifre" + +#: cppcharset.c:991 +msgid "hex escape sequence out of range" +msgstr "den hexadecimale undvigesekvens er uden for det gyldige interval" + +#: cppcharset.c:1030 +msgid "octal escape sequence out of range" +msgstr "den oktale undvigesekvens er uden for det gyldige interval" + +#: cppcharset.c:1098 +msgid "the meaning of '\\a' is different in traditional C" +msgstr "betydningen af '\\a' er anderledes i traditionel C" + +#: cppcharset.c:1105 +#, c-format +msgid "non-ISO-standard escape sequence, '\\%c'" +msgstr "undvigesekvensen '\\%c' er ikke ISO-standard" + +#: cppcharset.c:1113 +#, c-format +msgid "unknown escape sequence '\\%c'" +msgstr "ukendt undvigesekvensen '\\%c'" + +#: cppcharset.c:1116 +#, c-format +msgid "unknown escape sequence: '\\%03o'" +msgstr "ukendt undvigesekvensen '\\%03o'" + +#: cppcharset.c:1122 +#, fuzzy +msgid "converting escape sequence to execution character set" +msgstr "undvigesekvens er uden for det gyldig interval for tegn" + +#: cppcharset.c:1181 +msgid "converting to execution character set" +msgstr "" + +#: cppcharset.c:1244 cppcharset.c:1307 +msgid "character constant too long for its type" +msgstr "tegnkonstanten er for lang for dens type" + +#: cppcharset.c:1247 +msgid "multi-character character constant" +msgstr "flerbyte-tegnkonstant" + +#: cppcharset.c:1339 +msgid "empty character constant" +msgstr "tom tegnkonstant" + +#: cppcharset.c:1378 +#, fuzzy, c-format +msgid "failure to convert %s to %s" +msgstr "kunne ikke konvertere '%E' til '%T'" + +#: cpperror.c:110 diagnostic.def:5 +msgid "warning: " +msgstr "advarsel: " + +#: cpperror.c:112 +msgid "internal error: " +msgstr "intern fejl: " + +#: cpperror.c:174 +msgid "stdout" +msgstr "std-ud" + +#: cppexp.c:192 +msgid "too many decimal points in number" +msgstr "for mange decimalkommaer i tal" + +#: cppexp.c:212 +#, c-format +msgid "invalid digit \"%c\" in octal constant" +msgstr "ugyldig ciffer \"%c\" i oktal konstant" + +#: cppexp.c:218 +msgid "use of C99 hexadecimal floating constant" +msgstr "brug af C99 hexadecimal kommatalskonstant" + +#: cppexp.c:227 +msgid "exponent has no digits" +msgstr "der er ingen cifre i eksponent" + +#: cppexp.c:234 +msgid "hexadecimal floating constants require an exponent" +msgstr "hexadecimal kommatalskonstant skal have en eksponent" + +#: cppexp.c:240 +#, c-format +msgid "invalid suffix \"%.*s\" on floating constant" +msgstr "ugyldig endelse \"%.*s\" i kommatalskonstant" + +#: cppexp.c:250 cppexp.c:275 +#, c-format +msgid "traditional C rejects the \"%.*s\" suffix" +msgstr "traditionel C tillader ikke endelsen \"%.*s\"" + +#: cppexp.c:261 +#, c-format +msgid "invalid suffix \"%.*s\" on integer constant" +msgstr "ugyldig endelse \"%.*s\" i heltalskonstant" + +#: cppexp.c:283 +msgid "use of C99 long long integer constant" +msgstr "brug af ISO C99 long long-heltalskonstanter" + +#: cppexp.c:290 +msgid "imaginary constants are a GCC extension" +msgstr "imaginære konstanter er en GCC-udvidelse" + +#: cppexp.c:376 +msgid "integer constant is too large for its type" +msgstr "heltalskonstanten er for stor for dens type" + +#: cppexp.c:388 +msgid "integer constant is so large that it is unsigned" +msgstr "heltalskonstanten er så stor at den er unsigned" + +#: cppexp.c:470 +msgid "missing ')' after \"defined\"" +msgstr "manglende ')' efter \"defined\"" + +#: cppexp.c:477 +msgid "operator \"defined\" requires an identifier" +msgstr "operatoren \"defined\" kræver et kaldenavn" + +#: cppexp.c:485 +#, c-format +msgid "(\"%s\" is an alternative token for \"%s\" in C++)" +msgstr "(\"%s\" er et alternativt symbol for \"%s\" i C++)" + +#: cppexp.c:495 +msgid "this use of \"defined\" may not be portable" +msgstr "denne brug af \"defined\" er muligvis ikke portabel" + +#: cppexp.c:531 +msgid "floating constant in preprocessor expression" +msgstr "kommatalskonstant i præprocessorudtryk" + +#: cppexp.c:537 +msgid "imaginary number in preprocessor expression" +msgstr "imaginært tal i præprocessorudtryk" + +#: cppexp.c:582 +#, c-format +msgid "\"%s\" is not defined" +msgstr "\"%s\" er ikke defineret" + +#: cppexp.c:714 cppexp.c:743 +#, c-format +msgid "missing binary operator before token \"%s\"" +msgstr "manglende binær operator før symbolet \"%s\"" + +#: cppexp.c:734 +#, c-format +msgid "token \"%s\" is not valid in preprocessor expressions" +msgstr "symbolet \"%s\" er ikke gyldigt i præprocessorudtryk" + +#: cppexp.c:753 +msgid "void expression between '(' and ')'" +msgstr "tomt udtryk mellem '(' og ')'" + +#: cppexp.c:756 +msgid "#if with no expression" +msgstr "#if uden noget udtryk" + +#: cppexp.c:758 +#, c-format +msgid "operator '%s' has no right operand" +msgstr "operatoren '%s' har ikke nogen højre operand" + +#: cppexp.c:784 +msgid " ':' without preceding '?'" +msgstr " ':' uden forudgående '?'" + +#: cppexp.c:811 +msgid "unbalanced stack in #if" +msgstr "uafbalanceret stak i #if" + +#: cppexp.c:830 +#, c-format +msgid "impossible operator '%u'" +msgstr "umulig operator '%u'" + +#: cppexp.c:922 +msgid "missing ')' in expression" +msgstr "manglende ')' i udtryk" + +#: cppexp.c:943 +msgid "'?' without following ':'" +msgstr "'?' uden efterfølgende ':'" + +#: cppexp.c:953 +msgid "integer overflow in preprocessor expression" +msgstr "heltallet løber over i præprocessorudtrykket" + +#: cppexp.c:958 +msgid "missing '(' in expression" +msgstr "manglende '(' i udtryk" + +#: cppexp.c:990 +#, c-format +msgid "the left operand of \"%s\" changes sign when promoted" +msgstr "den venstre operand til \"%s\" ændrer fortegn ved forfremmelse" + +#: cppexp.c:995 +#, c-format +msgid "the right operand of \"%s\" changes sign when promoted" +msgstr "den højre operand til \"%s\" ændrer fortegn ved forfremmelse" + +#: cppexp.c:1352 +msgid "comma operator in operand of #if" +msgstr "kommeoperator i en operand til #if" + +#: cppexp.c:1483 +msgid "division by zero in #if" +msgstr "division med nul i #if" + +#: cppfiles.c:375 +msgid "NULL directory in find_file" +msgstr "" + +#: cppfiles.c:402 +msgid "one or more PCH files were found, but they were invalid" +msgstr "" + +#: cppfiles.c:405 +msgid "use -Winvalid-pch for more information" +msgstr "" + +#: cppfiles.c:463 +#, c-format +msgid "%s is a block device" +msgstr "%s er en blokenhed" + +#: cppfiles.c:480 +#, c-format +msgid "%s is too large" +msgstr "%s er for stor" + +#: cppfiles.c:515 +#, c-format +msgid "%s is shorter than expected" +msgstr "%s er kortere end forventet" + +#: cppfiles.c:714 +#, fuzzy, c-format +msgid "no include path in which to search for %s" +msgstr "der er ingen inkluderingssti at finde %s i" + +#: cppfiles.c:974 +msgid "Multiple include guards may be useful for:\n" +msgstr "Flere inkluderingsvagter kan være nyttige til:\n" + +#: cppinit.c:389 +msgid "cppchar_t must be an unsigned type" +msgstr "cppchar_t skal være en unsigned type" + +#: cppinit.c:393 +#, c-format +msgid "" +"preprocessor arithmetic has maximum precision of %lu bits; target requires %" +"lu bits" +msgstr "" +"præprocessorberegning har en maksimal præcision på %lu bit; målarkitektur " +"kræver %lu bit" + +#: cppinit.c:400 +msgid "CPP arithmetic must be at least as precise as a target int" +msgstr "" +"CPP-beregning skal være mindst lige så præcis som en målarkitekturs int" + +#: cppinit.c:403 +msgid "target char is less than 8 bits wide" +msgstr "målarkitekturs char er mindre end 8 bit bred" + +#: cppinit.c:407 +msgid "target wchar_t is narrower than target char" +msgstr "målarkitekturs wchar_t er mindre end målarkitekturs char" + +#: cppinit.c:411 +msgid "target int is narrower than target char" +msgstr "målarkitekturs int er mindre end målarkitekturs char" + +#: cppinit.c:416 +msgid "CPP half-integer narrower than CPP character" +msgstr "CPP-halvheltal er mindre end CPP-tegn" + +#: cppinit.c:420 +#, c-format +msgid "" +"CPP on this host cannot handle wide character constants over %lu bits, but " +"the target requires %lu bits" +msgstr "" +"CPP på denne vært kan ikke håndtere bredtegnkonstanter over %lu bit, men " +"målarkitekturen kræver %lu bit" + +#: cpplex.c:410 +msgid "null character(s) ignored" +msgstr "nultegn ignoreret" + +#: cpplex.c:445 +#, fuzzy +msgid "'$' in identifier or number" +msgstr "'$'-tegn i kaldenavn eller tal" + +#: cpplex.c:492 +#, c-format +msgid "attempt to use poisoned \"%s\"" +msgstr "forsøg på at bruge forgiftet \"%s\"" + +#: cpplex.c:500 +msgid "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro" +msgstr "" +"__VA_ARGS__ kan kun optræde i udfoldelsen af en C99-makro med vilkårligt " +"antal parametre" + +#: cpplex.c:596 +msgid "null character(s) preserved in literal" +msgstr "nultegn bevaret i strengkonstant" + +#: cpplex.c:916 +msgid "unterminated comment" +msgstr "uafsluttet kommentar" + +#: cpplex.c:927 +msgid "C++ style comments are not allowed in ISO C90" +msgstr "kommentarer i C++-stil er ikke tilladt i ISO C90" + +#: cpplex.c:929 +msgid "(this will be reported only once per input file)" +msgstr "(dette rapporteres kun en enkelt gang per inddatafil)" + +#: cpplex.c:934 +msgid "multi-line comment" +msgstr "flerlinjers kommentar" + +#: cpplex.c:1198 +#, c-format +msgid "unspellable token %s" +msgstr "symbol %s kan ikke staves" + +#: cpplib.c:218 +#, c-format +msgid "extra tokens at end of #%s directive" +msgstr "ekstra symboler i slutningen af #%s-direktiv" + +#: cpplib.c:304 +#, c-format +msgid "#%s is a GCC extension" +msgstr "#%s er en GCC-udvidelse" + +#: cpplib.c:316 +msgid "suggest not using #elif in traditional C" +msgstr "foreslår undladelse af brug af #elif i traditionel C" + +#: cpplib.c:319 +#, c-format +msgid "traditional C ignores #%s with the # indented" +msgstr "traditionel C ignorerer #%s når '#' er indrykket" + +#: cpplib.c:323 +#, c-format +msgid "suggest hiding #%s from traditional C with an indented #" +msgstr "foreslår at skjule #%s fra traditionel C vha. indrykket '#'" + +#: cpplib.c:345 +msgid "embedding a directive within macro arguments is not portable" +msgstr "indlejring af et direktiv inden i makroparametre er ikke portabelt" + +#: cpplib.c:365 +msgid "style of line directive is a GCC extension" +msgstr "linjestilsdirektiv er en GCC-udvidelse" + +#: cpplib.c:415 +#, c-format +msgid "invalid preprocessing directive #%s" +msgstr "ugyldigt præprocessordirektiv #%s" + +#: cpplib.c:484 +msgid "\"defined\" cannot be used as a macro name" +msgstr "\"defined\" kan ikke bruges som makronavn" + +#: cpplib.c:490 +#, c-format +msgid "\"%s\" cannot be used as a macro name as it is an operator in C++" +msgstr "\"%s\" kan ikke bruges som et makronavn da det er en operator i C++" + +#: cpplib.c:493 +#, c-format +msgid "no macro name given in #%s directive" +msgstr "intet makronavn angivet i direktivet #%s" + +#: cpplib.c:496 +msgid "macro names must be identifiers" +msgstr "makronavne skal være kaldenavne" + +#: cpplib.c:537 +#, c-format +msgid "undefining \"%s\"" +msgstr "glemmer definitionen af \"%s\"" + +#: cpplib.c:609 +msgid "missing terminating > character" +msgstr "manglende afsluttende '>'-tegn" + +#: cpplib.c:662 +#, c-format +msgid "#%s expects \"FILENAME\" or <FILENAME>" +msgstr "#%s forventer \"FILNAVN\" eller <FILNAVN>" + +#: cpplib.c:685 +msgid "#include nested too deeply" +msgstr "#include indlejret for dybt" + +#: cpplib.c:723 +msgid "#include_next in primary source file" +msgstr "#include_next i den primære kildekodefil" + +#: cpplib.c:749 +#, c-format +msgid "invalid flag \"%s\" in line directive" +msgstr "ugyldigt flag \"%s\" i linjedirektiv" + +#: cpplib.c:794 +#, c-format +msgid "\"%s\" after #line is not a positive integer" +msgstr "\"%s\" efter #line er ikke et positivt heltal" + +#: cpplib.c:800 +msgid "line number out of range" +msgstr "linjenummer er uden for det gyldige interval" + +#: cpplib.c:812 cpplib.c:885 +#, c-format +msgid "\"%s\" is not a valid filename" +msgstr "\"%s\" er ikke et ugyldigt filnavn" + +#: cpplib.c:847 +#, c-format +msgid "\"%s\" after # is not a positive integer" +msgstr "\"%s\" efter # er ikke et positivt heltal" + +#: cpplib.c:947 +msgid "invalid #ident directive" +msgstr "ugyldigt #ident-direktiv" + +#: cpplib.c:1027 +#, c-format +msgid "registering \"%s\" as both a pragma and a pragma namespace" +msgstr "registrerer \"%s\" som både et pragma og som et pragmanavnerum" + +#: cpplib.c:1030 +#, c-format +msgid "#pragma %s %s is already registered" +msgstr "#pragma %s %s er allerede registreret" + +#: cpplib.c:1033 +#, c-format +msgid "#pragma %s is already registered" +msgstr "#pragma %s er allerede registreret" + +#: cpplib.c:1178 +msgid "#pragma once in main file" +msgstr "'#pragma once' i hovedfil" + +#: cpplib.c:1201 +msgid "invalid #pragma GCC poison directive" +msgstr "ugyldigt #pragma GCC poison-direktiv" + +#: cpplib.c:1210 +#, c-format +msgid "poisoning existing macro \"%s\"" +msgstr "forgifter eksisterende makro \"%s\"" + +#: cpplib.c:1231 +msgid "#pragma system_header ignored outside include file" +msgstr "'#pragma system_header' ignoreret uden for inkluderingsfil" + +#: cpplib.c:1255 +#, fuzzy, c-format +msgid "cannot find source file %s" +msgstr "kan ikke finde kilden %s" + +#: cpplib.c:1259 +#, c-format +msgid "current file is older than %s" +msgstr "aktuel fil er ældre end %s" + +#: cpplib.c:1373 +msgid "_Pragma takes a parenthesized string literal" +msgstr "_Pragma tager en strengkonstant med paranteser omkring" + +#: cpplib.c:1451 +msgid "#else without #if" +msgstr "#else uden #if" + +#: cpplib.c:1456 +msgid "#else after #else" +msgstr "#else efter #else" + +#: cpplib.c:1484 +msgid "#elif without #if" +msgstr "#elif uden #if" + +#: cpplib.c:1489 +msgid "#elif after #else" +msgstr "#elif efter #else" + +#: cpplib.c:1519 +msgid "#endif without #if" +msgstr "#endif uden #if" + +#: cpplib.c:1596 +msgid "missing '(' after predicate" +msgstr "manglende '(' efter udsagn" + +#: cpplib.c:1611 +msgid "missing ')' to complete answer" +msgstr "manglende ')' til at fuldføre svar" + +#: cpplib.c:1631 +msgid "predicate's answer is empty" +msgstr "udsagnets svar et tomt" + +#: cpplib.c:1658 +msgid "assertion without predicate" +msgstr "postulat uden udsagn" + +#: cpplib.c:1660 +msgid "predicate must be an identifier" +msgstr "udsagn skal være et kaldenavn" + +#: cpplib.c:1744 +#, c-format +msgid "\"%s\" re-asserted" +msgstr "\"%s\" genpostuleret" + +#: cppmacro.c:125 cppmacro.c:280 +#, c-format +msgid "invalid built-in macro \"%s\"" +msgstr "ugyldig indbygget makro \"%s\"" + +#: cppmacro.c:221 +msgid "could not determine date and time" +msgstr "kunne ikke bestemme dato og tid" + +#: cppmacro.c:393 +msgid "invalid string literal, ignoring final '\\'" +msgstr "ugyldig strengkonstant, ignorerer afsluttende '\\'" + +#: cppmacro.c:476 +#, c-format +msgid "pasting \"%s\" and \"%s\" does not give a valid preprocessing token" +msgstr "" +"indsættelse af \"%s\" og \"%s\" giver ikke et gyldigt præprocessorsymbol" + +#: cppmacro.c:514 +msgid "ISO C99 requires rest arguments to be used" +msgstr "ISO C99 påkræver at restparametrene skal bruges" + +#: cppmacro.c:519 +#, c-format +msgid "macro \"%s\" requires %u arguments, but only %u given" +msgstr "makroen \"%s\" kræver %u parametre, men modtager kun %u" + +#: cppmacro.c:524 +#, c-format +msgid "macro \"%s\" passed %u arguments, but takes just %u" +msgstr "makroen \"%s\" bliver viderebragt %u parametre, men tager kun mod %u" + +#: cppmacro.c:635 +#, c-format +msgid "unterminated argument list invoking macro \"%s\"" +msgstr "uafsluttet parameterliste ved kald af makroen \"%s\"" + +#: cppmacro.c:738 +#, c-format +msgid "function-like macro \"%s\" must be used with arguments in traditional C" +msgstr "funktionsagtig makro \"%s\" skal bruges med parametre i traditionel C" + +#: cppmacro.c:1241 +#, c-format +msgid "duplicate macro parameter \"%s\"" +msgstr "makroparameternavnet \"%s\" optræder mere end én gang" + +#: cppmacro.c:1286 +#, c-format +msgid "\"%s\" may not appear in macro parameter list" +msgstr "\"%s\" må ikke optræde i makroparameterliste" + +#: cppmacro.c:1294 +msgid "macro parameters must be comma-separated" +msgstr "makroparametre skal være komma-adskilte" + +#: cppmacro.c:1311 +msgid "parameter name missing" +msgstr "parameternavn mangler" + +#: cppmacro.c:1326 +msgid "anonymous variadic macros were introduced in C99" +msgstr "anonyme makroer med vilkårligt antal parametre blev introduceret i C99" + +#: cppmacro.c:1330 +msgid "ISO C does not permit named variadic macros" +msgstr "ISO C tillader ikke navngivne makroer med vilkårligt antal parametre" + +#: cppmacro.c:1339 +msgid "missing ')' in macro parameter list" +msgstr "manglende ')' i makroparameterliste" + +#: cppmacro.c:1402 +msgid "ISO C requires whitespace after the macro name" +msgstr "ISO C påkræver mellemrum efter makronavnet" + +#: cppmacro.c:1430 +msgid "'#' is not followed by a macro parameter" +msgstr "'#' efterfølges ikke af en makroparameter" + +#: cppmacro.c:1449 +msgid "'##' cannot appear at either end of a macro expansion" +msgstr "'##' må ikke optræde ved nogen af enderne i en makrokrop" + +#: cppmacro.c:1588 +#, c-format +msgid "macro argument \"%s\" would be stringified in traditional C" +msgstr "" +"makroparameteren \"%s\" ville blive gjort til en streng i traditionel C" + +#: cppmacro.c:1611 +#, c-format +msgid "invalid hash type %d in cpp_macro_definition" +msgstr "ugyldig hashtype %d i cpp_macro_definition" + +#: cpppch.c:84 cpppch.c:332 cpppch.c:356 cpppch.c:365 cpppch.c:371 +msgid "while writing precompiled header" +msgstr "" + +#: cpppch.c:469 +#, fuzzy, c-format +msgid "%s: not used because `%.*s' not defined" +msgstr "etiketten '%s' er benyttet, men ikke defineret" + +#: cpppch.c:481 +#, c-format +msgid "%s: not used because `%.*s' defined as `%s' not `%.*s'" +msgstr "" + +#: cpppch.c:522 +#, fuzzy, c-format +msgid "%s: not used because `%s' is defined" +msgstr "'%s' brugt, men aldrig defineret" + +#: cpppch.c:535 cpppch.c:724 +msgid "while reading precompiled header" +msgstr "" + +#: cppspec.c:106 +#, c-format +msgid "\"%s\" is not a valid option to the preprocessor" +msgstr "\"%s\" er ikke et gyldigt tilvalg til præprocessoren" + +#: cppspec.c:128 +msgid "too many input files" +msgstr "for mange inddatafiler" + +#: cpptrad.c:744 +#, c-format +msgid "detected recursion whilst expanding macro \"%s\"" +msgstr "opdagede rekursion ved udfoldelse af makroen \"%s\"" + +#: cpptrad.c:911 +#, fuzzy +msgid "syntax error in macro parameter list" +msgstr "\"%s\" må ikke optræde i makroparameterliste" + +#: line-map.c:218 +#, c-format +msgid "In file included from %s:%u" +msgstr "I filen inkluderet af %s:%u" + +#. Translators note: this message is used in conjunction +#. with "In file included from %s:%ld" and some other +#. tricks. We want something like this: +#. +#. | In file included from sys/select.h:123, +#. | from sys/types.h:234, +#. | from userfile.c:31: +#. | bits/select.h:45: <error message here> +#. +#. with all the "from"s lined up. +#. The trailing comma is at the beginning of this message, +#. and the trailing colon is not translated. +#: line-map.c:236 +#, c-format +msgid "" +",\n" +" from %s:%u" +msgstr "" +",\n" +" af %s:%u" + diff --git a/libcpp/po/de.po b/libcpp/po/de.po new file mode 100644 index 00000000000..41936e1a957 --- /dev/null +++ b/libcpp/po/de.po @@ -0,0 +1,790 @@ +# German translation of gcc messages. +# Copyright © 2002, 2003, 2004 Free Software Foundation, Inc. +# Karl Eichwalder <ke@suse.de>, 2002, 2003. +# Roland Stigge <stigge@antcom.de>, 2003, 2004. +# This file is distributed under the same license as the gcc package. +# +msgid "" +msgstr "" +"Project-Id-Version: gcc 3.4-b20040206\n" +"POT-Creation-Date: 2004-02-06 01:34+0000\n" +"PO-Revision-Date: 2004-02-15 12:14+0100\n" +"Last-Translator: Roland Stigge <stigge@antcom.de>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" + +#: cppexp.c:1253 +msgid "traditional C rejects the unary plus operator" +msgstr "traditionelles C weist den unären Plus-Operator zurück" + +#: cpperror.c:176 +#, c-format +msgid "%s: %s" +msgstr "%s: %s" + +#: cppcharset.c:653 +#, c-format +msgid "conversion from %s to %s not supported by iconv" +msgstr "Konvertierung von %s nach %s wird von iconv nicht unterstützt" + +#: cppcharset.c:656 +msgid "iconv_open" +msgstr "iconv_open" + +#. FIXME: should be DL_SORRY +#: cppcharset.c:664 +#, c-format +msgid "no iconv implementation, cannot convert from %s to %s" +msgstr "" +"keine Implementation für iconv, es kann nicht von %s nach %s konvertiert " +"werden" + +#: cppcharset.c:808 +msgid "universal character names are only valid in C++ and C99" +msgstr "universelle Zeichennamen sind nur in C++ und C99 gültig" + +#: cppcharset.c:811 +#, c-format +msgid "the meaning of '\\%c' is different in traditional C" +msgstr "die Bedeutung von '\\%c' ist in traditionellem C anders" + +#: cppcharset.c:837 +#, c-format +msgid "incomplete universal character name %.*s" +msgstr "unvollständiger Universal-Zeichenname %.*s" + +#: cppcharset.c:849 +#, c-format +msgid "%.*s is not a valid universal character" +msgstr "»%.*s« ist kein gültiges universelles Zeichen" + +#: cppcharset.c:859 +#, c-format +msgid "universal character %.*s is not valid in an identifier" +msgstr "universelles Zeichen %.*s ist nicht gültig in Bezeichner" + +#: cppcharset.c:863 +#, c-format +msgid "universal character %.*s is not valid at the start of an identifier" +msgstr "universelles Zeichen %.*s ist nicht gültig am Anfang eines Bezeichners" + +#: cppcharset.c:898 +msgid "converting UCN to source character set" +msgstr "UCN wird in Quellzeichensatz konvertiert" + +#: cppcharset.c:902 +msgid "converting UCN to execution character set" +msgstr "UCN wird in Ausführungszeichensatz konvertiert" + +#: cppcharset.c:967 +msgid "the meaning of '\\x' is different in traditional C" +msgstr "die Bedeutung von '\\x' ist in traditionellem C anders" + +#: cppcharset.c:984 f/lex.c:580 +msgid "\\x used with no following hex digits" +msgstr "\\x ohne folgende Hex-Ziffern verwendet" + +#: cppcharset.c:991 +msgid "hex escape sequence out of range" +msgstr "Hex-Fluchtsequenz außerhalb des Wertebereiches" + +#: cppcharset.c:1030 +msgid "octal escape sequence out of range" +msgstr "Oktal-Fluchtsequenz außerhalb des Wertebereiches" + +#: cppcharset.c:1098 +msgid "the meaning of '\\a' is different in traditional C" +msgstr "die Bedeutung von '\\a' ist in traditionellem C anders" + +#: cppcharset.c:1105 +#, c-format +msgid "non-ISO-standard escape sequence, '\\%c'" +msgstr "nicht-ISO-standardkonforme Fluchtsequenz '\\%c'" + +#: cppcharset.c:1113 +#, c-format +msgid "unknown escape sequence '\\%c'" +msgstr "unbekannte Fluchtsequenz '\\%c'" + +#: cppcharset.c:1116 +#, c-format +msgid "unknown escape sequence: '\\%03o'" +msgstr "unbekannte Fluchtsequenz: '\\%03o'" + +#: cppcharset.c:1122 +msgid "converting escape sequence to execution character set" +msgstr "Fluchtsequenz wird in Zeichensatz der Ausführung konvertiert" + +#: cppcharset.c:1181 +msgid "converting to execution character set" +msgstr "Konvertierung in Zeichensatz der Ausführung" + +#: cppcharset.c:1244 cppcharset.c:1307 +msgid "character constant too long for its type" +msgstr "Zeichenkonstante zu lang für ihren Typ" + +#: cppcharset.c:1247 +msgid "multi-character character constant" +msgstr "Zeichenkonstante mit mehreren Zeichen" + +#: cppcharset.c:1339 +msgid "empty character constant" +msgstr "Leere Zeichenkonstante" + +#: cppcharset.c:1378 +#, c-format +msgid "failure to convert %s to %s" +msgstr "Fehler beim Konvertieren von %s in %s" + +#: cpperror.c:110 diagnostic.def:5 +msgid "warning: " +msgstr "Warnung: " + +#: cpperror.c:112 +msgid "internal error: " +msgstr "interner Fehler: " + +#: cpperror.c:174 +msgid "stdout" +msgstr "Standardausgabe" + +#: cppexp.c:192 +msgid "too many decimal points in number" +msgstr "zu viele Dezimalpunkte in Zahl" + +#: cppexp.c:212 +#, c-format +msgid "invalid digit \"%c\" in octal constant" +msgstr "ungültige Ziffer »%c« in Oktal-Konstante" + +#: cppexp.c:218 +msgid "use of C99 hexadecimal floating constant" +msgstr "Verwendung von C99 hexadezimaler Gleitkommakonstante" + +#: cppexp.c:227 +msgid "exponent has no digits" +msgstr "Exponent hat keine Ziffern" + +#: cppexp.c:234 +msgid "hexadecimal floating constants require an exponent" +msgstr "hexadezimale Gleitkommakonstanten benötigen Exponenten" + +#: cppexp.c:240 +#, c-format +msgid "invalid suffix \"%.*s\" on floating constant" +msgstr "ungültiger Suffix »%.*s« an Gleitkommakonstante" + +#: cppexp.c:250 cppexp.c:275 +#, c-format +msgid "traditional C rejects the \"%.*s\" suffix" +msgstr "traditionelles C lehnt den Suffix »%.*s« ab" + +#: cppexp.c:261 +#, c-format +msgid "invalid suffix \"%.*s\" on integer constant" +msgstr "ungültiger Suffix »%.*s« an Ganzzahlkonstante" + +#: cppexp.c:283 +msgid "use of C99 long long integer constant" +msgstr "C99 long long Ganzzahlkonstante verwendet" + +#: cppexp.c:290 +msgid "imaginary constants are a GCC extension" +msgstr "imaginäre Konstanten sind eine GCC-Erweiterung" + +#: cppexp.c:376 +msgid "integer constant is too large for its type" +msgstr "Ganzzahlkonstante ist zu groß für ihren Typ" + +#: cppexp.c:388 +msgid "integer constant is so large that it is unsigned" +msgstr "Ganzzahlkonstante ist so groß, dass sie vorzeichenlos ist" + +#: cppexp.c:470 +msgid "missing ')' after \"defined\"" +msgstr "fehlendes ')' hinter »defined«" + +#: cppexp.c:477 +msgid "operator \"defined\" requires an identifier" +msgstr "Operator »defined« erfordert einen Bezeichner" + +#: cppexp.c:485 +#, c-format +msgid "(\"%s\" is an alternative token for \"%s\" in C++)" +msgstr "(»%s« ist ein alternatives Token for »%s« in C++)" + +#: cppexp.c:495 +msgid "this use of \"defined\" may not be portable" +msgstr "diese Verwendung von »defined« könnte nicht portierbar sein" + +#: cppexp.c:531 +msgid "floating constant in preprocessor expression" +msgstr "Gleitkommakonstante in Präprozessorausdruck" + +#: cppexp.c:537 +msgid "imaginary number in preprocessor expression" +msgstr "imaginäre Zahl in Präprozessorausdruck" + +#: cppexp.c:582 +#, c-format +msgid "\"%s\" is not defined" +msgstr "»%s« ist nicht definiert" + +#: cppexp.c:714 cppexp.c:743 +#, c-format +msgid "missing binary operator before token \"%s\"" +msgstr "fehlender binärer Operator vor Token »%s«" + +#: cppexp.c:734 +#, c-format +msgid "token \"%s\" is not valid in preprocessor expressions" +msgstr "Token »%s« ist nicht gültig in Präprozessorausdrücken" + +#: cppexp.c:753 +msgid "void expression between '(' and ')'" +msgstr "ungültiger Ausdruck zwischen '(' und ')'" + +#: cppexp.c:756 +msgid "#if with no expression" +msgstr "#if ohne Ausdruck" + +#: cppexp.c:758 +#, c-format +msgid "operator '%s' has no right operand" +msgstr "Operator »%s« hat keinen rechten Operanden" + +#: cppexp.c:784 +msgid " ':' without preceding '?'" +msgstr " ':' ohne vorangehendes '?'" + +#: cppexp.c:811 +msgid "unbalanced stack in #if" +msgstr "unausgeglichener Keller in #if" + +#: cppexp.c:830 +#, c-format +msgid "impossible operator '%u'" +msgstr "unmöglicher Operator '%u'" + +#: cppexp.c:922 +msgid "missing ')' in expression" +msgstr "fehlendes ')' in Ausdruck" + +#: cppexp.c:943 +msgid "'?' without following ':'" +msgstr "'?' ohne folgendes ':'" + +#: cppexp.c:953 +msgid "integer overflow in preprocessor expression" +msgstr "Ganzzahlüberlauf in Präprozessorausdruck" + +#: cppexp.c:958 +msgid "missing '(' in expression" +msgstr "fehlendes '(' in Ausdruck" + +#: cppexp.c:990 +#, c-format +msgid "the left operand of \"%s\" changes sign when promoted" +msgstr "der linke Operand von »%s« ändert bei der Weitergabe das Vorzeichen" + +#: cppexp.c:995 +#, c-format +msgid "the right operand of \"%s\" changes sign when promoted" +msgstr "der rechte Operand von »%s« ändert bei der Weitergabe das Vorzeichen" + +#: cppexp.c:1352 +msgid "comma operator in operand of #if" +msgstr "Kommaoperator in Operand von #if" + +#: cppexp.c:1483 +msgid "division by zero in #if" +msgstr "Division durch null in #if" + +#: cppfiles.c:375 +msgid "NULL directory in find_file" +msgstr "NULL-Verzeichnis in find_file" + +#: cppfiles.c:402 +msgid "one or more PCH files were found, but they were invalid" +msgstr "ein oder mehrere PCH-Dateien wurden gefunden, aber sie sind ungültig" + +#: cppfiles.c:405 +msgid "use -Winvalid-pch for more information" +msgstr "verwenden Sie -Winvalid-pch für mehr Informationen" + +#: cppfiles.c:463 +#, c-format +msgid "%s is a block device" +msgstr "%s ist ein Block-Gerät" + +#: cppfiles.c:480 +#, c-format +msgid "%s is too large" +msgstr "%s ist zu groß" + +#: cppfiles.c:515 +#, c-format +msgid "%s is shorter than expected" +msgstr "%s ist kürzer als erwartet" + +#: cppfiles.c:714 +#, c-format +msgid "no include path in which to search for %s" +msgstr "kein Include-Pfad, um %s zu finden" + +#: cppfiles.c:974 +msgid "Multiple include guards may be useful for:\n" +msgstr "Mehrere Include-Wächter könnten nützlich sein für:\n" + +#: cppinit.c:389 +msgid "cppchar_t must be an unsigned type" +msgstr "cppchar_t muss ein vorzeichenloser Typ sein" + +#: cppinit.c:393 +#, c-format +msgid "" +"preprocessor arithmetic has maximum precision of %lu bits; target requires %" +"lu bits" +msgstr "" +"Präprozessorarithmetik hat maximale Präzision von %lu Bits; Ziel erfordert %" +"lu Bits" + +#: cppinit.c:400 +msgid "CPP arithmetic must be at least as precise as a target int" +msgstr "CPP-Arithmetik muss mindestens so genau sein wie das Ziel int" + +#: cppinit.c:403 +msgid "target char is less than 8 bits wide" +msgstr "Ziel-char ist weniger als 8 Bits breit" + +#: cppinit.c:407 +msgid "target wchar_t is narrower than target char" +msgstr "Ziel-wchar_t ist schmaler als Ziel char" + +#: cppinit.c:411 +msgid "target int is narrower than target char" +msgstr "Ziel-int ist schmaler als Ziel-char" + +#: cppinit.c:416 +msgid "CPP half-integer narrower than CPP character" +msgstr "CPP Halb-Ganzzahl ist schmaler als CPP-Zeichen" + +#: cppinit.c:420 +#, c-format +msgid "" +"CPP on this host cannot handle wide character constants over %lu bits, but " +"the target requires %lu bits" +msgstr "" +"CPP kann auf diesem Computer keine Wide-Zeichenkonstanten über %lu Bits " +"Breite behandeln, das Ziel benötigt %lu Bits" + +#: cpplex.c:410 +msgid "null character(s) ignored" +msgstr "Null-Zeichen ignoriert" + +#: cpplex.c:445 +msgid "'$' in identifier or number" +msgstr "'$' in Bezeichner oder Zahl" + +#: cpplex.c:492 +#, c-format +msgid "attempt to use poisoned \"%s\"" +msgstr "Versuch, schlechtes »%s« zu verwenden" + +#: cpplex.c:500 +msgid "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro" +msgstr "" +"__VA_ARGS__ kann nur in Erweiterung eines variadischen C99-Makros auftreten" + +#: cpplex.c:596 +msgid "null character(s) preserved in literal" +msgstr "Null-Zeichen im Literal erhalten" + +#: cpplex.c:916 +msgid "unterminated comment" +msgstr "nicht beendeter Kommentar" + +#: cpplex.c:927 +msgid "C++ style comments are not allowed in ISO C90" +msgstr "C++-Stil-Kommentare sind in ISO-C90 nicht erlaubt" + +#: cpplex.c:929 +msgid "(this will be reported only once per input file)" +msgstr "(dies wird nur einmal pro Eingabedatei gemeldet)" + +#: cpplex.c:934 +msgid "multi-line comment" +msgstr "mehrzeiliger Kommentar" + +#: cpplex.c:1198 +#, c-format +msgid "unspellable token %s" +msgstr "nicht buchstabierbares Token %s" + +#: cpplib.c:218 +#, c-format +msgid "extra tokens at end of #%s directive" +msgstr "mehrere Token am Ende der Direktive #%s" + +#: cpplib.c:304 +#, c-format +msgid "#%s is a GCC extension" +msgstr "#%s ist eine Erweiterung des GCC" + +#: cpplib.c:316 +msgid "suggest not using #elif in traditional C" +msgstr "empfehle, in traditionellem C nicht #elif zu verwenden" + +#: cpplib.c:319 +#, c-format +msgid "traditional C ignores #%s with the # indented" +msgstr "traditionelles C ignoriert #%s mit eingerücktem #" + +#: cpplib.c:323 +#, c-format +msgid "suggest hiding #%s from traditional C with an indented #" +msgstr "empfehle, #%s vor traditionellem C mit # zu verbergen" + +#: cpplib.c:345 +msgid "embedding a directive within macro arguments is not portable" +msgstr "" +"das Einbetten einer Direktive innerhalb von Makroargumenten ist nicht " +"portierbar" + +#: cpplib.c:365 +msgid "style of line directive is a GCC extension" +msgstr "der Stil der line-Direktive ist eine Erweiterung des GCC" + +#: cpplib.c:415 +#, c-format +msgid "invalid preprocessing directive #%s" +msgstr "ungültige Präprozessordirektive #%s" + +#: cpplib.c:484 +msgid "\"defined\" cannot be used as a macro name" +msgstr "»defined« kann nicht als Makroname verwendet werden" + +#: cpplib.c:490 +#, c-format +msgid "\"%s\" cannot be used as a macro name as it is an operator in C++" +msgstr "" +"»%s« kann nicht als Makroname verwendet werden, da es ein Operator in C++ ist" + +#: cpplib.c:493 +#, c-format +msgid "no macro name given in #%s directive" +msgstr "kein Makroname in Direktive #%s angegeben" + +#: cpplib.c:496 +msgid "macro names must be identifiers" +msgstr "Makronamen müssen Bezeichner sein" + +#: cpplib.c:537 +#, c-format +msgid "undefining \"%s\"" +msgstr "un-definiere »%s«" + +#: cpplib.c:609 +msgid "missing terminating > character" +msgstr "fehlendes abschließendes »>«-Zeichen" + +#: cpplib.c:662 +#, c-format +msgid "#%s expects \"FILENAME\" or <FILENAME>" +msgstr "#%s erwartet \"DATEINAME\" oder <DATEINAME>" + +#: cpplib.c:685 +msgid "#include nested too deeply" +msgstr "#include ist zu tief geschachtelt" + +#: cpplib.c:723 +msgid "#include_next in primary source file" +msgstr "#include_next in erster Quelldatei" + +#: cpplib.c:749 +#, c-format +msgid "invalid flag \"%s\" in line directive" +msgstr "ungültiges Flag »%s« in line-Direktive" + +#: cpplib.c:794 +#, c-format +msgid "\"%s\" after #line is not a positive integer" +msgstr "»%s« hinter #line ist keine positive Ganzzahl" + +#: cpplib.c:800 +msgid "line number out of range" +msgstr "Zeilennummer ist außerhalb des Wertebereiches" + +#: cpplib.c:812 cpplib.c:885 +#, c-format +msgid "\"%s\" is not a valid filename" +msgstr "»%s« ist kein gültiger Dateiname" + +#: cpplib.c:847 +#, c-format +msgid "\"%s\" after # is not a positive integer" +msgstr "»%s« hinter # ist keine positive Ganzzahl" + +#: cpplib.c:947 +msgid "invalid #ident directive" +msgstr "ungültige #ident-Direktive" + +#: cpplib.c:1027 +#, c-format +msgid "registering \"%s\" as both a pragma and a pragma namespace" +msgstr "registriere »%s« sowohl als Pragma als auch als Pragma-Namespace" + +#: cpplib.c:1030 +#, c-format +msgid "#pragma %s %s is already registered" +msgstr "#pragma %s %s ist bereits registriert" + +#: cpplib.c:1033 +#, c-format +msgid "#pragma %s is already registered" +msgstr "#pragma %s ist bereits registriert" + +#: cpplib.c:1178 +msgid "#pragma once in main file" +msgstr "#pragma once in Hauptdatei" + +#: cpplib.c:1201 +msgid "invalid #pragma GCC poison directive" +msgstr "ungültige #pragma GCC Direktive" + +#: cpplib.c:1210 +#, c-format +msgid "poisoning existing macro \"%s\"" +msgstr "schlechtes existierendes Makro »%s«" + +#: cpplib.c:1231 +msgid "#pragma system_header ignored outside include file" +msgstr "#pragma system_header außerhalb include-Datei ignoriert" + +#: cpplib.c:1255 +#, c-format +msgid "cannot find source file %s" +msgstr "Quelldatei %s kann nicht gefunden werden" + +#: cpplib.c:1259 +#, c-format +msgid "current file is older than %s" +msgstr "aktuelle Datei ist älter als %s" + +#: cpplib.c:1373 +msgid "_Pragma takes a parenthesized string literal" +msgstr "_Pragma nimmt ein geklammertes Zeichenkettenliteral" + +#: cpplib.c:1451 +msgid "#else without #if" +msgstr "#else ohne #if" + +#: cpplib.c:1456 +msgid "#else after #else" +msgstr "#else hinter #else" + +#: cpplib.c:1484 +msgid "#elif without #if" +msgstr "#elif ohne #if" + +#: cpplib.c:1489 +msgid "#elif after #else" +msgstr "#elif hinter #else" + +#: cpplib.c:1519 +msgid "#endif without #if" +msgstr "#endif ohne #if" + +#: cpplib.c:1596 +msgid "missing '(' after predicate" +msgstr "fehlendes '(' hinter Prädikat" + +#: cpplib.c:1611 +msgid "missing ')' to complete answer" +msgstr "fehlendes ')', um Antwort abzuschließen" + +#: cpplib.c:1631 +msgid "predicate's answer is empty" +msgstr "Prädikatantwort ist leer" + +#: cpplib.c:1658 +msgid "assertion without predicate" +msgstr "Behauptung ohne Prädikat" + +#: cpplib.c:1660 +msgid "predicate must be an identifier" +msgstr "Prädikat muss ein Bezeichner sein" + +#: cpplib.c:1744 +#, c-format +msgid "\"%s\" re-asserted" +msgstr "»%s« wieder behauptet" + +#: cppmacro.c:125 cppmacro.c:280 +#, c-format +msgid "invalid built-in macro \"%s\"" +msgstr "ungültiges eingebautes Makro »%s«" + +#: cppmacro.c:221 +msgid "could not determine date and time" +msgstr "Datum und Zeit konnten nicht bestimmt werden" + +#: cppmacro.c:393 +msgid "invalid string literal, ignoring final '\\'" +msgstr "ungültiges Zeichenkettenliteral, ignoriere abschließendes '\\'" + +#: cppmacro.c:476 +#, c-format +msgid "pasting \"%s\" and \"%s\" does not give a valid preprocessing token" +msgstr "das Einfügen von »%s« und »%s« ergibt kein gültiges Präprozessor-Token" + +#: cppmacro.c:514 +msgid "ISO C99 requires rest arguments to be used" +msgstr "ISO-C99 erfordert, dass Restargumente verwendet werden" + +#: cppmacro.c:519 +#, c-format +msgid "macro \"%s\" requires %u arguments, but only %u given" +msgstr "Makro »%s« erfordert %u Argumente, aber nur %u wurden angegeben" + +#: cppmacro.c:524 +#, c-format +msgid "macro \"%s\" passed %u arguments, but takes just %u" +msgstr "dem Makro »%s« wurden %u Argumente übergeben, aber es nimmt nur %u" + +#: cppmacro.c:635 +#, c-format +msgid "unterminated argument list invoking macro \"%s\"" +msgstr "unvollendete Argumentliste beim Makroaufruf »%s«" + +#: cppmacro.c:738 +#, c-format +msgid "function-like macro \"%s\" must be used with arguments in traditional C" +msgstr "" +"funktionsähnliches Makro »%s« muss mit Argumenten in traditionellem C " +"verwendet werden" + +#: cppmacro.c:1241 +#, c-format +msgid "duplicate macro parameter \"%s\"" +msgstr "doppelter Makroparameter »%s«" + +#: cppmacro.c:1286 +#, c-format +msgid "\"%s\" may not appear in macro parameter list" +msgstr "»%s« darf nicht in Makroparameterliste auftreten" + +#: cppmacro.c:1294 +msgid "macro parameters must be comma-separated" +msgstr "Makroparameter müssen mit Komma getrennt sein" + +#: cppmacro.c:1311 +msgid "parameter name missing" +msgstr "Parametername fehlt" + +#: cppmacro.c:1326 +msgid "anonymous variadic macros were introduced in C99" +msgstr "anonyme variadische Makros wurden in C99 eingeführt" + +#: cppmacro.c:1330 +msgid "ISO C does not permit named variadic macros" +msgstr "ISO-C erlaubt keine benannten variadischen Makros" + +#: cppmacro.c:1339 +msgid "missing ')' in macro parameter list" +msgstr "fehlendes ')' in Makroparameterliste" + +#: cppmacro.c:1402 +msgid "ISO C requires whitespace after the macro name" +msgstr "ISO-C erfordert Whitespace hinter Makroname" + +#: cppmacro.c:1430 +msgid "'#' is not followed by a macro parameter" +msgstr "'#' wird nicht von einem Makroparameter gefolgt" + +#: cppmacro.c:1449 +msgid "'##' cannot appear at either end of a macro expansion" +msgstr "'##' kann nicht an den Enden einer Makroexpansion auftreten" + +#: cppmacro.c:1588 +#, c-format +msgid "macro argument \"%s\" would be stringified in traditional C" +msgstr "" +"Makroargument »%s« würde in traditionellem C zum String gewandelt werden" + +#: cppmacro.c:1611 +#, c-format +msgid "invalid hash type %d in cpp_macro_definition" +msgstr "ungültiger Hash-Typ %d in cpp_macro_definition" + +#: cpppch.c:84 cpppch.c:332 cpppch.c:356 cpppch.c:365 cpppch.c:371 +msgid "while writing precompiled header" +msgstr "beim Schreiben des vorkompilierten Headers" + +#: cpppch.c:469 +#, c-format +msgid "%s: not used because `%.*s' not defined" +msgstr "%s: nicht verwendet, da »%.*s« nicht definiert" + +#: cpppch.c:481 +#, c-format +msgid "%s: not used because `%.*s' defined as `%s' not `%.*s'" +msgstr "" +"%s: nicht verwendet, da »%.*s« als »%s« statt als »%.*s« definiert wurde" + +#: cpppch.c:522 +#, c-format +msgid "%s: not used because `%s' is defined" +msgstr "%s: nicht verwendet, da »%s« definiert ist" + +#: cpppch.c:535 cpppch.c:724 +msgid "while reading precompiled header" +msgstr "beim Lesen des vorkompilierten Headers" + +#: cppspec.c:106 +#, c-format +msgid "\"%s\" is not a valid option to the preprocessor" +msgstr "»%s« ist keine gültige Präprozessoroption" + +#: cppspec.c:128 +msgid "too many input files" +msgstr "zu viele Eingabedateien" + +#: cpptrad.c:744 +#, c-format +msgid "detected recursion whilst expanding macro \"%s\"" +msgstr "Rekursion bei Expansion des Makros »%s« entdeckt" + +#: cpptrad.c:911 +msgid "syntax error in macro parameter list" +msgstr "Syntaxfehler in Makroparameterliste" + +#: line-map.c:218 +#, c-format +msgid "In file included from %s:%u" +msgstr "In Datei, eingefügt von %s:%u" + +#. Translators note: this message is used in conjunction +#. with "In file included from %s:%ld" and some other +#. tricks. We want something like this: +#. +#. | In file included from sys/select.h:123, +#. | from sys/types.h:234, +#. | from userfile.c:31: +#. | bits/select.h:45: <error message here> +#. +#. with all the "from"s lined up. +#. The trailing comma is at the beginning of this message, +#. and the trailing colon is not translated. +#: line-map.c:236 +#, c-format +msgid "" +",\n" +" from %s:%u" +msgstr "" +",\n" +" von %s:%u" + diff --git a/libcpp/po/el.po b/libcpp/po/el.po new file mode 100644 index 00000000000..a1f6d0dece3 --- /dev/null +++ b/libcpp/po/el.po @@ -0,0 +1,808 @@ +# Greek translation of gcc. +# Copyright (C) 2001, 2002 Free Software Foundation, Inc. +# Simos Xenitellis <simos@hellug.gr>, 2001, 2002. +# +msgid "" +msgstr "" +"Project-Id-Version: gcc 3.2\n" +"POT-Creation-Date: 2004-02-06 01:34+0000\n" +"PO-Revision-Date: 2002-08-18 15:46+0100\n" +"Last-Translator: Simos Xenitellis <simos@hellug.gr>\n" +"Language-Team: Greek <nls@tux.hellug.gr>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-7\n" +"Content-Transfer-Encoding: 8bit\n" +"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" + +#: cppexp.c:1253 +msgid "traditional C rejects the unary plus operator" +msgstr "" + +# src/request.c:37 +#: cpperror.c:176 +#, c-format +msgid "%s: %s" +msgstr "%s: %s" + +#: cppcharset.c:653 +#, fuzzy, c-format +msgid "conversion from %s to %s not supported by iconv" +msgstr "ç ìåôáôñïðÞ áðü `%s' óå `%s' äåí õðïóôçñßæåôå" + +#: cppcharset.c:656 +msgid "iconv_open" +msgstr "" + +#. FIXME: should be DL_SORRY +#: cppcharset.c:664 +#, c-format +msgid "no iconv implementation, cannot convert from %s to %s" +msgstr "" + +#: cppcharset.c:808 +#, fuzzy +msgid "universal character names are only valid in C++ and C99" +msgstr "U+%04X: åêôüò ïñßùí ÷áñáêôÞñáò" + +#: cppcharset.c:811 +#, c-format +msgid "the meaning of '\\%c' is different in traditional C" +msgstr "" + +#: cppcharset.c:837 +#, c-format +msgid "incomplete universal character name %.*s" +msgstr "" + +#: cppcharset.c:849 +#, fuzzy, c-format +msgid "%.*s is not a valid universal character" +msgstr "Ôï `%s' äåí åßíáé êáôÜëïãïò." + +#: cppcharset.c:859 +#, c-format +msgid "universal character %.*s is not valid in an identifier" +msgstr "" + +#: cppcharset.c:863 +#, c-format +msgid "universal character %.*s is not valid at the start of an identifier" +msgstr "" + +#: cppcharset.c:898 +msgid "converting UCN to source character set" +msgstr "" + +#: cppcharset.c:902 +msgid "converting UCN to execution character set" +msgstr "" + +#: cppcharset.c:967 +msgid "the meaning of '\\x' is different in traditional C" +msgstr "" + +#: cppcharset.c:984 f/lex.c:580 +msgid "\\x used with no following hex digits" +msgstr "" + +#: cppcharset.c:991 +#, fuzzy +msgid "hex escape sequence out of range" +msgstr "ìç Ýãêõñç äéáäéêáóßá äéáöõãÞò óôï ôÝëïò ôïõ áëöáñéèìéôéêïý" + +#: cppcharset.c:1030 +#, fuzzy +msgid "octal escape sequence out of range" +msgstr "ìç Ýãêõñç äéáäéêáóßá äéáöõãÞò óôï ôÝëïò ôïõ áëöáñéèìéôéêïý" + +#: cppcharset.c:1098 +msgid "the meaning of '\\a' is different in traditional C" +msgstr "" + +#: cppcharset.c:1105 +#, c-format +msgid "non-ISO-standard escape sequence, '\\%c'" +msgstr "" + +# src/main.c:663 +#: cppcharset.c:1113 +#, fuzzy, c-format +msgid "unknown escape sequence '\\%c'" +msgstr "¶ãíùóôç óõìâïëïóåéñÜ `%s'" + +# src/main.c:663 +#: cppcharset.c:1116 +#, fuzzy, c-format +msgid "unknown escape sequence: '\\%03o'" +msgstr "¶ãíùóôç óõìâïëïóåéñÜ `%s'" + +#: cppcharset.c:1122 +#, fuzzy +msgid "converting escape sequence to execution character set" +msgstr "ìç Ýãêõñç äéáäéêáóßá äéáöõãÞò óôï ôÝëïò ôïõ áëöáñéèìéôéêïý" + +#: cppcharset.c:1181 +msgid "converting to execution character set" +msgstr "" + +#: cppcharset.c:1244 cppcharset.c:1307 +#, fuzzy +msgid "character constant too long for its type" +msgstr "ìç Ýãêõñïò óôáèåñüò ÷áñáêôÞñáò óôï áëöáñéèìéôéêü" + +#: cppcharset.c:1247 +#, fuzzy +msgid "multi-character character constant" +msgstr "äéðëü üíïìá ÷áñáêôÞñá `%s'" + +#: cppcharset.c:1339 +#, fuzzy +msgid "empty character constant" +msgstr "êåíü áëöáñéèìçôéêü" + +#: cppcharset.c:1378 +#, fuzzy, c-format +msgid "failure to convert %s to %s" +msgstr "äåí åßíáé äõíáôü íá äçìéïõñãçèåß ôï %s `%s' óôï `%s'" + +#: cpperror.c:110 diagnostic.def:5 +msgid "warning: " +msgstr "ðñïåéäïðïßçóç: " + +#: cpperror.c:112 +msgid "internal error: " +msgstr "åóùôåñéêü óöÜëìá: " + +#: cpperror.c:174 +#, fuzzy +msgid "stdout" +msgstr "äïìÞ" + +#: cppexp.c:192 +#, fuzzy +msgid "too many decimal points in number" +msgstr "Õðåñâïëéêá ðïëëÜ áíïéêôÜ áñ÷åßá óôï óýóôçìá" + +#: cppexp.c:212 +#, fuzzy, c-format +msgid "invalid digit \"%c\" in octal constant" +msgstr "Ìç Ýãêõñç áêÝñáéá ðáñÜìåôñïò `%s'" + +#: cppexp.c:218 +msgid "use of C99 hexadecimal floating constant" +msgstr "" + +#: cppexp.c:227 +msgid "exponent has no digits" +msgstr "" + +#: cppexp.c:234 +msgid "hexadecimal floating constants require an exponent" +msgstr "" + +#: cppexp.c:240 +#, fuzzy, c-format +msgid "invalid suffix \"%.*s\" on floating constant" +msgstr "Ç ðáñÜìåôñïò êéíçôÞò õðïäéáóôïëÞò äåí åßíáé Ýãêõñç: %s" + +#: cppexp.c:250 cppexp.c:275 +#, c-format +msgid "traditional C rejects the \"%.*s\" suffix" +msgstr "" + +#: cppexp.c:261 +#, fuzzy, c-format +msgid "invalid suffix \"%.*s\" on integer constant" +msgstr "Ìç Ýãêõñç áêÝñáéá ðáñÜìåôñïò `%s'" + +#: cppexp.c:283 +#, fuzzy +msgid "use of C99 long long integer constant" +msgstr "Ìç Ýãêõñç áêÝñáéá ðáñÜìåôñïò `%s'" + +#: cppexp.c:290 +msgid "imaginary constants are a GCC extension" +msgstr "" + +#: cppexp.c:376 +#, fuzzy +msgid "integer constant is too large for its type" +msgstr "%s: ôï %s åßíáé ôüóï ìåãÜëï ðïõ äå ìðïñåß íá áíáðáñáóôáèåß" + +#: cppexp.c:388 +#, fuzzy +msgid "integer constant is so large that it is unsigned" +msgstr "%s: ôï %s åßíáé ôüóï ìåãÜëï ðïõ äå ìðïñåß íá áíáðáñáóôáèåß" + +#: cppexp.c:470 +#, fuzzy +msgid "missing ')' after \"defined\"" +msgstr "Ý÷åé ðáñáëçöèåß ç ëßóôá ìå ôá ðåäßá" + +#: cppexp.c:477 +msgid "operator \"defined\" requires an identifier" +msgstr "" + +#: cppexp.c:485 +#, c-format +msgid "(\"%s\" is an alternative token for \"%s\" in C++)" +msgstr "" + +#: cppexp.c:495 +msgid "this use of \"defined\" may not be portable" +msgstr "" + +#: cppexp.c:531 +#, fuzzy +msgid "floating constant in preprocessor expression" +msgstr "Åîáßñåóç êéíçôÞò õðïäéáóôïëÞò" + +#: cppexp.c:537 +#, fuzzy +msgid "imaginary number in preprocessor expression" +msgstr "ìç Ýãêõñïò áñéèìüò áðü ãñáììÝò" + +#: cppexp.c:582 +#, fuzzy, c-format +msgid "\"%s\" is not defined" +msgstr "ôï `%s' äåí åßíáé êáíïíéêü áñ÷åßï" + +#: cppexp.c:714 cppexp.c:743 +#, fuzzy, c-format +msgid "missing binary operator before token \"%s\"" +msgstr "%s: Áíáìåíüôáí äõáäéêüò ÷åéñéóôÞò.\n" + +#: cppexp.c:734 +#, fuzzy, c-format +msgid "token \"%s\" is not valid in preprocessor expressions" +msgstr "%s: ìç Ýãêõñç êáíïíéêÞ Ýêöñáóç: %s" + +#: cppexp.c:753 +msgid "void expression between '(' and ')'" +msgstr "" + +#: cppexp.c:756 +msgid "#if with no expression" +msgstr "" + +#: cppexp.c:758 +#, c-format +msgid "operator '%s' has no right operand" +msgstr "" + +#: cppexp.c:784 +msgid " ':' without preceding '?'" +msgstr "" + +#: cppexp.c:811 +msgid "unbalanced stack in #if" +msgstr "" + +#: cppexp.c:830 +#, fuzzy, c-format +msgid "impossible operator '%u'" +msgstr "RPC: Ìç óõìâáôÝò åêäüóåéò ôïõ RPC" + +#: cppexp.c:922 +#, fuzzy +msgid "missing ')' in expression" +msgstr "Ý÷åé ðáñáëçöèåß ç ëßóôá ìå ôéò èÝóåéò" + +#: cppexp.c:943 +#, fuzzy +msgid "'?' without following ':'" +msgstr "óõíôáêôéêü óöÜëìá óôïí ðñüëïãï: %s" + +#: cppexp.c:953 +msgid "integer overflow in preprocessor expression" +msgstr "" + +#: cppexp.c:958 +#, fuzzy +msgid "missing '(' in expression" +msgstr "Ý÷åé ðáñáëçöèåß ç ëßóôá ìå ôéò èÝóåéò" + +#: cppexp.c:990 +#, c-format +msgid "the left operand of \"%s\" changes sign when promoted" +msgstr "" + +#: cppexp.c:995 +#, c-format +msgid "the right operand of \"%s\" changes sign when promoted" +msgstr "" + +#: cppexp.c:1352 +msgid "comma operator in operand of #if" +msgstr "" + +#: cppexp.c:1483 +#, fuzzy +msgid "division by zero in #if" +msgstr "Äéáßñåóç ìå ìçäÝí óôçí áðïôßìçóç: %s" + +#: cppfiles.c:375 +msgid "NULL directory in find_file" +msgstr "" + +#: cppfiles.c:402 +msgid "one or more PCH files were found, but they were invalid" +msgstr "" + +#: cppfiles.c:405 +msgid "use -Winvalid-pch for more information" +msgstr "" + +#: cppfiles.c:463 +#, fuzzy, c-format +msgid "%s is a block device" +msgstr "Äåí Ýìåéíå êáèüëïõ ÷þñïò óôç óõóêåõÞ" + +# src/shred.c:1134 +#: cppfiles.c:480 +#, fuzzy, c-format +msgid "%s is too large" +msgstr "%s: ôï áñ÷åßï åßíáé ðïëý ìåãÜëï" + +#: cppfiles.c:515 +#, fuzzy, c-format +msgid "%s is shorter than expected" +msgstr "%s: Áíáìåíüôáí äõáäéêüò ÷åéñéóôÞò.\n" + +#: cppfiles.c:714 +#, c-format +msgid "no include path in which to search for %s" +msgstr "" + +#: cppfiles.c:974 +msgid "Multiple include guards may be useful for:\n" +msgstr "" + +#: cppinit.c:389 +#, fuzzy +msgid "cppchar_t must be an unsigned type" +msgstr "äéðëüò ðñïóäéïñéóôÞò ìçíýìáôïò" + +#: cppinit.c:393 +#, c-format +msgid "" +"preprocessor arithmetic has maximum precision of %lu bits; target requires %" +"lu bits" +msgstr "" + +#: cppinit.c:400 +msgid "CPP arithmetic must be at least as precise as a target int" +msgstr "" + +#: cppinit.c:403 +msgid "target char is less than 8 bits wide" +msgstr "" + +#: cppinit.c:407 +msgid "target wchar_t is narrower than target char" +msgstr "" + +#: cppinit.c:411 +msgid "target int is narrower than target char" +msgstr "" + +#: cppinit.c:416 +msgid "CPP half-integer narrower than CPP character" +msgstr "" + +#: cppinit.c:420 +#, c-format +msgid "" +"CPP on this host cannot handle wide character constants over %lu bits, but " +"the target requires %lu bits" +msgstr "" + +#: cpplex.c:410 +#, fuzzy +msgid "null character(s) ignored" +msgstr "ìç Ýãêõñïò ÷áñáêôÞñáò óôï áñ÷åßï: " + +#: cpplex.c:445 +msgid "'$' in identifier or number" +msgstr "" + +#: cpplex.c:492 +#, c-format +msgid "attempt to use poisoned \"%s\"" +msgstr "" + +#: cpplex.c:500 +msgid "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro" +msgstr "" + +#: cpplex.c:596 +msgid "null character(s) preserved in literal" +msgstr "" + +#: cpplex.c:916 +#, fuzzy +msgid "unterminated comment" +msgstr "Ìç ôåñìáôéóìÝíç åíôïëÞ `s'" + +#: cpplex.c:927 +msgid "C++ style comments are not allowed in ISO C90" +msgstr "" + +#: cpplex.c:929 +msgid "(this will be reported only once per input file)" +msgstr "" + +#: cpplex.c:934 +msgid "multi-line comment" +msgstr "" + +#: cpplex.c:1198 +#, fuzzy, c-format +msgid "unspellable token %s" +msgstr "%s: áäýíáôï ôï Üíïéãìá ôïõ %s: %m\n" + +#: cpplib.c:218 +#, c-format +msgid "extra tokens at end of #%s directive" +msgstr "" + +#: cpplib.c:304 +#, c-format +msgid "#%s is a GCC extension" +msgstr "" + +#: cpplib.c:316 +msgid "suggest not using #elif in traditional C" +msgstr "" + +#: cpplib.c:319 +#, c-format +msgid "traditional C ignores #%s with the # indented" +msgstr "" + +#: cpplib.c:323 +#, c-format +msgid "suggest hiding #%s from traditional C with an indented #" +msgstr "" + +#: cpplib.c:345 +msgid "embedding a directive within macro arguments is not portable" +msgstr "" + +#: cpplib.c:365 +msgid "style of line directive is a GCC extension" +msgstr "" + +#: cpplib.c:415 +#, c-format +msgid "invalid preprocessing directive #%s" +msgstr "" + +#: cpplib.c:484 +msgid "\"defined\" cannot be used as a macro name" +msgstr "" + +#: cpplib.c:490 +#, c-format +msgid "\"%s\" cannot be used as a macro name as it is an operator in C++" +msgstr "" + +#: cpplib.c:493 +#, c-format +msgid "no macro name given in #%s directive" +msgstr "" + +#: cpplib.c:496 +#, fuzzy +msgid "macro names must be identifiers" +msgstr "äéðëüò ðñïóäéïñéóôÞò ìçíýìáôïò" + +#: cpplib.c:537 +#, fuzzy, c-format +msgid "undefining \"%s\"" +msgstr "Ìç ïñéóìÝíï üíïìá %s" + +#: cpplib.c:609 +#, fuzzy +msgid "missing terminating > character" +msgstr "Ý÷åé ðáñáëçöèåß ôï áñ÷åßï ðñïïñéóìïý" + +#: cpplib.c:662 +#, c-format +msgid "#%s expects \"FILENAME\" or <FILENAME>" +msgstr "" + +#: cpplib.c:685 +msgid "#include nested too deeply" +msgstr "" + +#: cpplib.c:723 +msgid "#include_next in primary source file" +msgstr "" + +#: cpplib.c:749 +#, c-format +msgid "invalid flag \"%s\" in line directive" +msgstr "" + +#: cpplib.c:794 +#, fuzzy, c-format +msgid "\"%s\" after #line is not a positive integer" +msgstr "%s' äåí åßíáé éó÷ýùí èåôéêüò áêÝñáéïò." + +#: cpplib.c:800 +#, fuzzy +msgid "line number out of range" +msgstr "%s: áñéèìüò ãñáììÞò Ýîù áðü ôá üñéá" + +#: cpplib.c:812 cpplib.c:885 +#, fuzzy, c-format +msgid "\"%s\" is not a valid filename" +msgstr "%s' äåí åßíáé éó÷ýùí èåôéêüò áêÝñáéïò." + +#: cpplib.c:847 +#, fuzzy, c-format +msgid "\"%s\" after # is not a positive integer" +msgstr "%s' äåí åßíáé éó÷ýùí èåôéêüò áêÝñáéïò." + +#: cpplib.c:947 +#, fuzzy +msgid "invalid #ident directive" +msgstr "%%%c: êáôåõèõíôÞñéïò ãñáììÞ ìç Ýãêõñç." + +#: cpplib.c:1027 +#, c-format +msgid "registering \"%s\" as both a pragma and a pragma namespace" +msgstr "" + +#: cpplib.c:1030 +#, c-format +msgid "#pragma %s %s is already registered" +msgstr "" + +#: cpplib.c:1033 +#, fuzzy, c-format +msgid "#pragma %s is already registered" +msgstr "ï ÷Üñôçò ÷áñáêôÞñùí `%s' ïñßóôçêå Þäç" + +#: cpplib.c:1178 +msgid "#pragma once in main file" +msgstr "" + +#: cpplib.c:1201 +msgid "invalid #pragma GCC poison directive" +msgstr "" + +#: cpplib.c:1210 +#, c-format +msgid "poisoning existing macro \"%s\"" +msgstr "" + +#: cpplib.c:1231 +msgid "#pragma system_header ignored outside include file" +msgstr "" + +#: cpplib.c:1255 +#, fuzzy, c-format +msgid "cannot find source file %s" +msgstr "áäõíáìßá áíïßãìáôïò õðïäï÷Þò: %s" + +#: cpplib.c:1259 +#, c-format +msgid "current file is older than %s" +msgstr "" + +#: cpplib.c:1373 +msgid "_Pragma takes a parenthesized string literal" +msgstr "" + +#: cpplib.c:1451 +msgid "#else without #if" +msgstr "" + +#: cpplib.c:1456 +msgid "#else after #else" +msgstr "#else ìåôÜ áðü #else" + +#: cpplib.c:1484 +msgid "#elif without #if" +msgstr "" + +#: cpplib.c:1489 +msgid "#elif after #else" +msgstr "#elif ìåôÜ áðü #else" + +#: cpplib.c:1519 +msgid "#endif without #if" +msgstr "" + +#: cpplib.c:1596 +msgid "missing '(' after predicate" +msgstr "" + +#: cpplib.c:1611 +msgid "missing ')' to complete answer" +msgstr "" + +#: cpplib.c:1631 +msgid "predicate's answer is empty" +msgstr "" + +#: cpplib.c:1658 +#, fuzzy +msgid "assertion without predicate" +msgstr "Ç ëåéôïõñãßá äåí åðéôñÝðåôáé" + +#: cpplib.c:1660 +#, fuzzy +msgid "predicate must be an identifier" +msgstr "äéðëüò ðñïóäéïñéóôÞò ìçíýìáôïò" + +#: cpplib.c:1744 +#, c-format +msgid "\"%s\" re-asserted" +msgstr "" + +#: cppmacro.c:125 cppmacro.c:280 +#, fuzzy, c-format +msgid "invalid built-in macro \"%s\"" +msgstr "ìç Ýãêõñï ìÞêïò ãñáììÞò: %s" + +#: cppmacro.c:221 +#, fuzzy +msgid "could not determine date and time" +msgstr "Äåí ìðüñåóá íá áíïßîù ôï áñ÷åßï %s" + +#: cppmacro.c:393 +#, fuzzy +msgid "invalid string literal, ignoring final '\\'" +msgstr "ìç Ýãêõñïò áñ÷éêüò áñéèìüò ãñáììÞò: `%s'" + +#: cppmacro.c:476 +#, c-format +msgid "pasting \"%s\" and \"%s\" does not give a valid preprocessing token" +msgstr "" + +#: cppmacro.c:514 +#, fuzzy +msgid "ISO C99 requires rest arguments to be used" +msgstr "ÊáêÞ áßôçóç ðáñáìÝôñùí" + +#: cppmacro.c:519 +#, c-format +msgid "macro \"%s\" requires %u arguments, but only %u given" +msgstr "" + +#: cppmacro.c:524 +#, c-format +msgid "macro \"%s\" passed %u arguments, but takes just %u" +msgstr "" + +#: cppmacro.c:635 +#, c-format +msgid "unterminated argument list invoking macro \"%s\"" +msgstr "" + +#: cppmacro.c:738 +#, c-format +msgid "function-like macro \"%s\" must be used with arguments in traditional C" +msgstr "" + +#: cppmacro.c:1241 +#, fuzzy, c-format +msgid "duplicate macro parameter \"%s\"" +msgstr "äéðëü üíïìá ÷áñáêôÞñá `%s'" + +#: cppmacro.c:1286 +#, c-format +msgid "\"%s\" may not appear in macro parameter list" +msgstr "" + +#: cppmacro.c:1294 +msgid "macro parameters must be comma-separated" +msgstr "" + +#: cppmacro.c:1311 +msgid "parameter name missing" +msgstr "" + +#: cppmacro.c:1326 +msgid "anonymous variadic macros were introduced in C99" +msgstr "" + +#: cppmacro.c:1330 +msgid "ISO C does not permit named variadic macros" +msgstr "" + +#: cppmacro.c:1339 +msgid "missing ')' in macro parameter list" +msgstr "" + +#: cppmacro.c:1402 +msgid "ISO C requires whitespace after the macro name" +msgstr "" + +#: cppmacro.c:1430 +msgid "'#' is not followed by a macro parameter" +msgstr "" + +#: cppmacro.c:1449 +msgid "'##' cannot appear at either end of a macro expansion" +msgstr "" + +#: cppmacro.c:1588 +#, c-format +msgid "macro argument \"%s\" would be stringified in traditional C" +msgstr "" + +#: cppmacro.c:1611 +#, c-format +msgid "invalid hash type %d in cpp_macro_definition" +msgstr "" + +#: cpppch.c:84 cpppch.c:332 cpppch.c:356 cpppch.c:365 cpppch.c:371 +msgid "while writing precompiled header" +msgstr "" + +#: cpppch.c:469 +#, c-format +msgid "%s: not used because `%.*s' not defined" +msgstr "" + +#: cpppch.c:481 +#, c-format +msgid "%s: not used because `%.*s' defined as `%s' not `%.*s'" +msgstr "" + +#: cpppch.c:522 +#, c-format +msgid "%s: not used because `%s' is defined" +msgstr "" + +#: cpppch.c:535 cpppch.c:724 +msgid "while reading precompiled header" +msgstr "" + +#: cppspec.c:106 +#, fuzzy, c-format +msgid "\"%s\" is not a valid option to the preprocessor" +msgstr "%s' äåí åßíáé éó÷ýùí èåôéêüò áêÝñáéïò." + +#: cppspec.c:128 +msgid "too many input files" +msgstr "õðåñâïëéêÜ ðïëëÜ áñ÷åßá åéóüäïõ" + +#: cpptrad.c:744 +#, c-format +msgid "detected recursion whilst expanding macro \"%s\"" +msgstr "" + +#: cpptrad.c:911 +#, fuzzy +msgid "syntax error in macro parameter list" +msgstr "óõíôáêôéêü óöÜëìá óôïí ïñéóìü êëÜóçò ÷áñáêôÞñùí" + +#: line-map.c:218 +#, c-format +msgid "In file included from %s:%u" +msgstr "" + +#. Translators note: this message is used in conjunction +#. with "In file included from %s:%ld" and some other +#. tricks. We want something like this: +#. +#. | In file included from sys/select.h:123, +#. | from sys/types.h:234, +#. | from userfile.c:31: +#. | bits/select.h:45: <error message here> +#. +#. with all the "from"s lined up. +#. The trailing comma is at the beginning of this message, +#. and the trailing colon is not translated. +#: line-map.c:236 +#, c-format +msgid "" +",\n" +" from %s:%u" +msgstr "" + diff --git a/libcpp/po/es.po b/libcpp/po/es.po new file mode 100644 index 00000000000..118dd103af9 --- /dev/null +++ b/libcpp/po/es.po @@ -0,0 +1,793 @@ +# Mensajes en español para gcc-3.3 +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +# Cristian Othón Martínez Vera <cfuga@itam.mx>, 2001, 2002, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: gcc 3.3\n" +"POT-Creation-Date: 2004-02-06 01:34+0000\n" +"PO-Revision-Date: 2003-06-29 15:48-0500\n" +"Last-Translator: Cristian Othón Martínez Vera <cfuga@itam.mx>\n" +"Language-Team: Spanish <es@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" +"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" + +#: cppexp.c:1253 +msgid "traditional C rejects the unary plus operator" +msgstr "C tradicional rechaza el operador unario mas" + +#: cpperror.c:176 +#, c-format +msgid "%s: %s" +msgstr "%s: %s" + +#: cppcharset.c:653 +#, fuzzy, c-format +msgid "conversion from %s to %s not supported by iconv" +msgstr "conversión de NaNa a unsigned int" + +#: cppcharset.c:656 +msgid "iconv_open" +msgstr "" + +#. FIXME: should be DL_SORRY +#: cppcharset.c:664 +#, c-format +msgid "no iconv implementation, cannot convert from %s to %s" +msgstr "" + +#: cppcharset.c:808 +#, fuzzy +msgid "universal character names are only valid in C++ and C99" +msgstr "universal-character-name `\\U%08x' no es válido en el identificador" + +#: cppcharset.c:811 +#, c-format +msgid "the meaning of '\\%c' is different in traditional C" +msgstr "el significado de '\\%c' es diferente en C tradicional" + +#: cppcharset.c:837 +#, fuzzy, c-format +msgid "incomplete universal character name %.*s" +msgstr "universal-character-name incompleto" + +#: cppcharset.c:849 +#, fuzzy, c-format +msgid "%.*s is not a valid universal character" +msgstr "`%T::%D' no es una declaración válida" + +#: cppcharset.c:859 +#, fuzzy, c-format +msgid "universal character %.*s is not valid in an identifier" +msgstr "universal-character-name `\\U%08x' no es válido en el identificador" + +#: cppcharset.c:863 +#, fuzzy, c-format +msgid "universal character %.*s is not valid at the start of an identifier" +msgstr "universal-character-name `\\U%08x' no es válido en el identificador" + +#: cppcharset.c:898 +#, fuzzy +msgid "converting UCN to source character set" +msgstr "convirtiendo NULL a un tipo que no es puntero" + +#: cppcharset.c:902 +#, fuzzy +msgid "converting UCN to execution character set" +msgstr "convirtiendo NULL a un tipo que no es puntero" + +#: cppcharset.c:967 +msgid "the meaning of '\\x' is different in traditional C" +msgstr "el significado de '\\x' es diferente en C tradicional" + +#: cppcharset.c:984 f/lex.c:580 +msgid "\\x used with no following hex digits" +msgstr "se usó \\x sin dígitos hexadecimales a continuación" + +#: cppcharset.c:991 +msgid "hex escape sequence out of range" +msgstr "secuencia de escape hexadecimal fuera de rango" + +#: cppcharset.c:1030 +msgid "octal escape sequence out of range" +msgstr "secuencia de escape octal fuera de rango" + +#: cppcharset.c:1098 +msgid "the meaning of '\\a' is different in traditional C" +msgstr "el significado de '\\a' es diferente en C tradicional" + +#: cppcharset.c:1105 +#, c-format +msgid "non-ISO-standard escape sequence, '\\%c'" +msgstr "secuencia de escape que no es estándard ISO, '\\%c'" + +#: cppcharset.c:1113 +#, c-format +msgid "unknown escape sequence '\\%c'" +msgstr "secuencia de escape desconocida, '\\%c'" + +#: cppcharset.c:1116 +#, c-format +msgid "unknown escape sequence: '\\%03o'" +msgstr "secuencia de escape desconocida: '\\%03o'" + +#: cppcharset.c:1122 +#, fuzzy +msgid "converting escape sequence to execution character set" +msgstr "secuencia de escape fuera de rango para el carácter" + +#: cppcharset.c:1181 +msgid "converting to execution character set" +msgstr "" + +#: cppcharset.c:1244 cppcharset.c:1307 +msgid "character constant too long for its type" +msgstr "constante de carácter demasiado grande para su tipo" + +#: cppcharset.c:1247 +msgid "multi-character character constant" +msgstr "constante de carácter con múltiples caracteres" + +#: cppcharset.c:1339 +msgid "empty character constant" +msgstr "constante de carácter vacía" + +#: cppcharset.c:1378 +#, fuzzy, c-format +msgid "failure to convert %s to %s" +msgstr "no se puede convertir `%E' a `%T'" + +#: cpperror.c:110 diagnostic.def:5 +msgid "warning: " +msgstr "aviso: " + +#: cpperror.c:112 +msgid "internal error: " +msgstr "error interno: " + +#: cpperror.c:174 +msgid "stdout" +msgstr "salida estándard" + +#: cppexp.c:192 +msgid "too many decimal points in number" +msgstr "demasiados puntos decimales en el número" + +#: cppexp.c:212 +#, c-format +msgid "invalid digit \"%c\" in octal constant" +msgstr "dígito \"%c\" inválido en la constante octal" + +#: cppexp.c:218 +msgid "use of C99 hexadecimal floating constant" +msgstr "uso de una constante de coma flotante hexadecimal C99" + +#: cppexp.c:227 +msgid "exponent has no digits" +msgstr "el exponente no tiene dígitos" + +#: cppexp.c:234 +msgid "hexadecimal floating constants require an exponent" +msgstr "las constantes de coma flotante hexadecimal requieren un exponente" + +#: cppexp.c:240 +#, c-format +msgid "invalid suffix \"%.*s\" on floating constant" +msgstr "sufijo \"%.*s\" inválido en la constante de coma flotante" + +#: cppexp.c:250 cppexp.c:275 +#, c-format +msgid "traditional C rejects the \"%.*s\" suffix" +msgstr "C tradicional rechaza el sufijo \"%.*s\"" + +#: cppexp.c:261 +#, c-format +msgid "invalid suffix \"%.*s\" on integer constant" +msgstr "sufijo \"%.*s\" inválido en la constante entera" + +#: cppexp.c:283 +msgid "use of C99 long long integer constant" +msgstr "uso de una constante entera long long C99" + +#: cppexp.c:290 +msgid "imaginary constants are a GCC extension" +msgstr "las constantes imaginarias son una extensión GCC" + +#: cppexp.c:376 +msgid "integer constant is too large for its type" +msgstr "la constante entera es demasiado grande para su tipo" + +#: cppexp.c:388 +msgid "integer constant is so large that it is unsigned" +msgstr "la constante entera es tan grande que es unsigned" + +#: cppexp.c:470 +msgid "missing ')' after \"defined\"" +msgstr "falta `)' después de \"defined\"" + +#: cppexp.c:477 +msgid "operator \"defined\" requires an identifier" +msgstr "el operador \"defined\" requiere un identificador" + +#: cppexp.c:485 +#, c-format +msgid "(\"%s\" is an alternative token for \"%s\" in C++)" +msgstr "(\"%s\" es un elemento alternativo para \"%s\" en C++)" + +#: cppexp.c:495 +msgid "this use of \"defined\" may not be portable" +msgstr "este uso de \"defined\" puede no ser transportable" + +#: cppexp.c:531 +msgid "floating constant in preprocessor expression" +msgstr "constante de coma flotante en una expresión del preprocesador" + +#: cppexp.c:537 +msgid "imaginary number in preprocessor expression" +msgstr "número imaginario en una expresión del preprocesador" + +#: cppexp.c:582 +#, c-format +msgid "\"%s\" is not defined" +msgstr "\"%s\" no está definido" + +#: cppexp.c:714 cppexp.c:743 +#, c-format +msgid "missing binary operator before token \"%s\"" +msgstr "falta un operador binario antes del elemento \"%s\"" + +#: cppexp.c:734 +#, c-format +msgid "token \"%s\" is not valid in preprocessor expressions" +msgstr "el elemento \"%s\" no es válido en las expresiones del preprocesador" + +#: cppexp.c:753 +msgid "void expression between '(' and ')'" +msgstr "expresión void entre '(' y ')'" + +#: cppexp.c:756 +msgid "#if with no expression" +msgstr "#if sin expresión" + +#: cppexp.c:758 +#, c-format +msgid "operator '%s' has no right operand" +msgstr "el operador '%s' no tiene operando derecho" + +#: cppexp.c:784 +msgid " ':' without preceding '?'" +msgstr " ':' sin una '?' precedente" + +#: cppexp.c:811 +msgid "unbalanced stack in #if" +msgstr "pila desbalanceada en #if" + +#: cppexp.c:830 +#, c-format +msgid "impossible operator '%u'" +msgstr "operador '%u' imposible" + +#: cppexp.c:922 +msgid "missing ')' in expression" +msgstr "falta un ')' en la expresión" + +#: cppexp.c:943 +msgid "'?' without following ':'" +msgstr "'?' sin ':' a continuación" + +#: cppexp.c:953 +msgid "integer overflow in preprocessor expression" +msgstr "desbordamiento entero en expresión del preprocesador" + +#: cppexp.c:958 +msgid "missing '(' in expression" +msgstr "falta un '(' en la expresión" + +#: cppexp.c:990 +#, c-format +msgid "the left operand of \"%s\" changes sign when promoted" +msgstr "el operando izquierdo de \"%s\" cambia el signo cuando es promovido" + +#: cppexp.c:995 +#, c-format +msgid "the right operand of \"%s\" changes sign when promoted" +msgstr "el operando derecho de \"%s\" cambia el signo cuando es promovido" + +#: cppexp.c:1352 +msgid "comma operator in operand of #if" +msgstr "operador coma en operando de #if" + +#: cppexp.c:1483 +msgid "division by zero in #if" +msgstr "división por cero en #if" + +#: cppfiles.c:375 +msgid "NULL directory in find_file" +msgstr "" + +#: cppfiles.c:402 +msgid "one or more PCH files were found, but they were invalid" +msgstr "" + +#: cppfiles.c:405 +msgid "use -Winvalid-pch for more information" +msgstr "" + +#: cppfiles.c:463 +#, c-format +msgid "%s is a block device" +msgstr "%s es un dispositivo de bloques" + +#: cppfiles.c:480 +#, c-format +msgid "%s is too large" +msgstr "%s es demasiado grande" + +#: cppfiles.c:515 +#, c-format +msgid "%s is shorter than expected" +msgstr "%s es más corto de lo esperado" + +#: cppfiles.c:714 +#, fuzzy, c-format +msgid "no include path in which to search for %s" +msgstr "no hay ruta de inclusión en la cual se encuentre %s" + +#: cppfiles.c:974 +msgid "Multiple include guards may be useful for:\n" +msgstr "Guardias múltiples de include pueden ser útiles para:\n" + +#: cppinit.c:389 +msgid "cppchar_t must be an unsigned type" +msgstr "cppchar_t debe ser de un tipo unsigned" + +#: cppinit.c:393 +#, c-format +msgid "" +"preprocessor arithmetic has maximum precision of %lu bits; target requires %" +"lu bits" +msgstr "" +"la aritmética del preprocesador tiene una precisión máxima de %lu bits; el " +"objetivo requiere de %lu bits" + +#: cppinit.c:400 +msgid "CPP arithmetic must be at least as precise as a target int" +msgstr "" +"la aritmética de CPP debe se al menos tan precisa como un int del objetivo" + +#: cppinit.c:403 +msgid "target char is less than 8 bits wide" +msgstr "el char del objetivo tiene menos de 8 bits de ancho" + +#: cppinit.c:407 +msgid "target wchar_t is narrower than target char" +msgstr "el wchar_t del objetivo es más estrecho que el char del objetivo" + +#: cppinit.c:411 +msgid "target int is narrower than target char" +msgstr "el int del objetivo es más estrecho que el char del objetivo" + +#: cppinit.c:416 +msgid "CPP half-integer narrower than CPP character" +msgstr "el medio-entero de CPP es más estrecho que el carácter de CPP" + +#: cppinit.c:420 +#, c-format +msgid "" +"CPP on this host cannot handle wide character constants over %lu bits, but " +"the target requires %lu bits" +msgstr "" +"CPP no puede manejar constantes de carácter anchas más allá de %lu bits en " +"este objetivo, pero el objetivo requiere %lu bits" + +#: cpplex.c:410 +msgid "null character(s) ignored" +msgstr "caracter(es) nulo(s) ignorados" + +#: cpplex.c:445 +#, fuzzy +msgid "'$' in identifier or number" +msgstr "caracter(es) '$' en el identificador o número" + +#: cpplex.c:492 +#, c-format +msgid "attempt to use poisoned \"%s\"" +msgstr "intento de usar \"%s\" envenenado" + +#: cpplex.c:500 +msgid "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro" +msgstr "" +"__VA_ARGS__ solamente puede aparecer en la expansión de una macro variadic " +"C99" + +#: cpplex.c:596 +msgid "null character(s) preserved in literal" +msgstr "caracter(es) nulo(s) preservados en la literal" + +#: cpplex.c:916 +msgid "unterminated comment" +msgstr "comentario sin terminar" + +#: cpplex.c:927 +msgid "C++ style comments are not allowed in ISO C90" +msgstr "los comentarios de estilo C++ no se permiten en ISO C90" + +#: cpplex.c:929 +msgid "(this will be reported only once per input file)" +msgstr "(esto se reportará solamente una vez por cada fichero de entrada)" + +#: cpplex.c:934 +msgid "multi-line comment" +msgstr "comentario en múltiples líneas" + +#: cpplex.c:1198 +#, c-format +msgid "unspellable token %s" +msgstr "elemento %s impronunciable" + +#: cpplib.c:218 +#, c-format +msgid "extra tokens at end of #%s directive" +msgstr "elementos extra al final de la directiva #%s" + +#: cpplib.c:304 +#, c-format +msgid "#%s is a GCC extension" +msgstr "#%s es una extensión de GCC" + +#: cpplib.c:316 +msgid "suggest not using #elif in traditional C" +msgstr "se sugiere no usar #elif en C tradicional" + +#: cpplib.c:319 +#, c-format +msgid "traditional C ignores #%s with the # indented" +msgstr "C tradicional ignora #%s con el # indentado" + +#: cpplib.c:323 +#, c-format +msgid "suggest hiding #%s from traditional C with an indented #" +msgstr "se sugiere ocultar #%s de C tradicional con un # indentado" + +#: cpplib.c:345 +msgid "embedding a directive within macro arguments is not portable" +msgstr "" +"imbuir una directiva dentro de los argumentos de una macro no es " +"transportable" + +#: cpplib.c:365 +msgid "style of line directive is a GCC extension" +msgstr "la directiva de estilo de línea es una extensión de GCC" + +#: cpplib.c:415 +#, c-format +msgid "invalid preprocessing directive #%s" +msgstr "directiva de preprocesamiento #%s inválida" + +#: cpplib.c:484 +msgid "\"defined\" cannot be used as a macro name" +msgstr "\"defined\" no se puede usar como un nombre de macro" + +#: cpplib.c:490 +#, c-format +msgid "\"%s\" cannot be used as a macro name as it is an operator in C++" +msgstr "" +"no se puede usar \"%s\" como un nombre de macro porque es un operador en C++" + +#: cpplib.c:493 +#, c-format +msgid "no macro name given in #%s directive" +msgstr "no se dio un nombre de macro en la directiva #%s" + +#: cpplib.c:496 +msgid "macro names must be identifiers" +msgstr "los nombres de macro deben ser identificadores" + +#: cpplib.c:537 +#, c-format +msgid "undefining \"%s\"" +msgstr "borrando la definición de \"%s\"" + +#: cpplib.c:609 +msgid "missing terminating > character" +msgstr "falta el carácter de terminación >" + +#: cpplib.c:662 +#, c-format +msgid "#%s expects \"FILENAME\" or <FILENAME>" +msgstr "#%s espera \"NOMBRE_ARCHIVO\" ó <NOMBRE_ARCHIVO>" + +#: cpplib.c:685 +msgid "#include nested too deeply" +msgstr "#include anidado con demasiada profundidad" + +#: cpplib.c:723 +msgid "#include_next in primary source file" +msgstr "#include_next en fichero primario de código fuente" + +#: cpplib.c:749 +#, c-format +msgid "invalid flag \"%s\" in line directive" +msgstr "indicador \"%s\" inválido en la línea de la directiva" + +#: cpplib.c:794 +#, c-format +msgid "\"%s\" after #line is not a positive integer" +msgstr "\"%s\" después de #line no es un entero positivo" + +#: cpplib.c:800 +msgid "line number out of range" +msgstr "número de línea fuera de rango" + +#: cpplib.c:812 cpplib.c:885 +#, c-format +msgid "\"%s\" is not a valid filename" +msgstr "\"%s\" no es un nombre de fichero válido" + +#: cpplib.c:847 +#, c-format +msgid "\"%s\" after # is not a positive integer" +msgstr "\"%s\" después de # no es un entero positivo" + +#: cpplib.c:947 +msgid "invalid #ident directive" +msgstr "directiva #ident inválida" + +#: cpplib.c:1027 +#, c-format +msgid "registering \"%s\" as both a pragma and a pragma namespace" +msgstr "" +"registrando \"%s\" como un pragma y como un espacio de nombres de pragma" + +#: cpplib.c:1030 +#, c-format +msgid "#pragma %s %s is already registered" +msgstr "#pragma %s %s ya está registrado" + +#: cpplib.c:1033 +#, c-format +msgid "#pragma %s is already registered" +msgstr "#pragma %s ya está registrado" + +#: cpplib.c:1178 +msgid "#pragma once in main file" +msgstr "#pragma una vez en el fichero principal" + +#: cpplib.c:1201 +msgid "invalid #pragma GCC poison directive" +msgstr "directiva #pragma de GCC envenenada inválida" + +#: cpplib.c:1210 +#, c-format +msgid "poisoning existing macro \"%s\"" +msgstr "envenenando la macro existente \"%s\"" + +#: cpplib.c:1231 +msgid "#pragma system_header ignored outside include file" +msgstr "#pragma system_header ignorado fuera del fichero a incluir" + +#: cpplib.c:1255 +#, fuzzy, c-format +msgid "cannot find source file %s" +msgstr "no se puede encontrar la fuente %s" + +#: cpplib.c:1259 +#, c-format +msgid "current file is older than %s" +msgstr "el fichero actual es más antiguo que %s" + +#: cpplib.c:1373 +msgid "_Pragma takes a parenthesized string literal" +msgstr "_Pragma lleva una cadena literal entre paréntesis" + +#: cpplib.c:1451 +msgid "#else without #if" +msgstr "#else sin #if" + +#: cpplib.c:1456 +msgid "#else after #else" +msgstr "#else después de #else" + +#: cpplib.c:1484 +msgid "#elif without #if" +msgstr "#elif sin #if" + +#: cpplib.c:1489 +msgid "#elif after #else" +msgstr "#elif después de #else" + +#: cpplib.c:1519 +msgid "#endif without #if" +msgstr "#endif sin #if" + +#: cpplib.c:1596 +msgid "missing '(' after predicate" +msgstr "falta '(' antes del predicado" + +#: cpplib.c:1611 +msgid "missing ')' to complete answer" +msgstr "falta ')' para completar la respuesta" + +#: cpplib.c:1631 +msgid "predicate's answer is empty" +msgstr "el predicado de la respuesta está vacío" + +#: cpplib.c:1658 +msgid "assertion without predicate" +msgstr "afirmación sin predicado" + +#: cpplib.c:1660 +msgid "predicate must be an identifier" +msgstr "el predicado debe ser un identificador" + +#: cpplib.c:1744 +#, c-format +msgid "\"%s\" re-asserted" +msgstr "\"%s\" reafirmado" + +#: cppmacro.c:125 cppmacro.c:280 +#, c-format +msgid "invalid built-in macro \"%s\"" +msgstr "macro interna \"%s\" inválida" + +#: cppmacro.c:221 +msgid "could not determine date and time" +msgstr "no se puede determinar la fecha y la hora" + +#: cppmacro.c:393 +msgid "invalid string literal, ignoring final '\\'" +msgstr "cadena literal inválida, se ignora el '\\' finales" + +#: cppmacro.c:476 +#, c-format +msgid "pasting \"%s\" and \"%s\" does not give a valid preprocessing token" +msgstr "pegar \"%s\" y \"%s\" no da un elemento válido de preprocesamiento" + +#: cppmacro.c:514 +msgid "ISO C99 requires rest arguments to be used" +msgstr "ISO C99 requiere que el resto de los argumentos sea usado" + +#: cppmacro.c:519 +#, c-format +msgid "macro \"%s\" requires %u arguments, but only %u given" +msgstr "la macro \"%s\" requiere %u argumentos, pero solo se proporcionan %u" + +#: cppmacro.c:524 +#, c-format +msgid "macro \"%s\" passed %u arguments, but takes just %u" +msgstr "la macro \"%s\" recibió %u argumentos, pero solamente tomó %u" + +#: cppmacro.c:635 +#, c-format +msgid "unterminated argument list invoking macro \"%s\"" +msgstr "lista de argumentos sin terminar al invocar la macro \"%s\"" + +#: cppmacro.c:738 +#, c-format +msgid "function-like macro \"%s\" must be used with arguments in traditional C" +msgstr "" +"la función de macro \"%s\" se debe usar con argumentos en C tradicional" + +#: cppmacro.c:1241 +#, c-format +msgid "duplicate macro parameter \"%s\"" +msgstr "parámetro de macro \"%s\" duplicado" + +#: cppmacro.c:1286 +#, c-format +msgid "\"%s\" may not appear in macro parameter list" +msgstr "\"%s\" podría faltar en la lista de parámetro de macro" + +#: cppmacro.c:1294 +msgid "macro parameters must be comma-separated" +msgstr "los parámetros de macro deben ser separados por comas" + +#: cppmacro.c:1311 +msgid "parameter name missing" +msgstr "falta el nombre del parámetro" + +#: cppmacro.c:1326 +msgid "anonymous variadic macros were introduced in C99" +msgstr "los macros variadic anónimos se introdujeron en C99" + +#: cppmacro.c:1330 +msgid "ISO C does not permit named variadic macros" +msgstr "ISO C no permite macros variadic nombrados" + +#: cppmacro.c:1339 +msgid "missing ')' in macro parameter list" +msgstr "falta paréntesis derecho en la lista de parámetros de macro" + +#: cppmacro.c:1402 +msgid "ISO C requires whitespace after the macro name" +msgstr "ISO C requiere espacios en blanco después del nombre de macro" + +#: cppmacro.c:1430 +msgid "'#' is not followed by a macro parameter" +msgstr "'#' no es seguido por un parámetro de macro" + +#: cppmacro.c:1449 +msgid "'##' cannot appear at either end of a macro expansion" +msgstr "'##' no puede aparece en o al final de una expansión de macro" + +#: cppmacro.c:1588 +#, c-format +msgid "macro argument \"%s\" would be stringified in traditional C" +msgstr "" +"el argumento de macro \"%s\" debería ser convertido a cadena en C tradicional" + +#: cppmacro.c:1611 +#, c-format +msgid "invalid hash type %d in cpp_macro_definition" +msgstr "tipo de hash %d inválido en cpp_macro_definition" + +#: cpppch.c:84 cpppch.c:332 cpppch.c:356 cpppch.c:365 cpppch.c:371 +msgid "while writing precompiled header" +msgstr "" + +#: cpppch.c:469 +#, fuzzy, c-format +msgid "%s: not used because `%.*s' not defined" +msgstr "se usa la etiqueta `%s' pero no está definida" + +#: cpppch.c:481 +#, c-format +msgid "%s: not used because `%.*s' defined as `%s' not `%.*s'" +msgstr "" + +#: cpppch.c:522 +#, fuzzy, c-format +msgid "%s: not used because `%s' is defined" +msgstr "se usa `%s' pero nunca se definió" + +#: cpppch.c:535 cpppch.c:724 +msgid "while reading precompiled header" +msgstr "" + +#: cppspec.c:106 +#, c-format +msgid "\"%s\" is not a valid option to the preprocessor" +msgstr "\"%s\" no es una opción válida para el preprocesador" + +#: cppspec.c:128 +msgid "too many input files" +msgstr "demasiados ficheros de entrada" + +#: cpptrad.c:744 +#, c-format +msgid "detected recursion whilst expanding macro \"%s\"" +msgstr "se detectó recursión al expandir la macro \"%s\"" + +#: cpptrad.c:911 +#, fuzzy +msgid "syntax error in macro parameter list" +msgstr "error de sintaxis en la lista nombres de parámetros" + +#: line-map.c:218 +#, c-format +msgid "In file included from %s:%u" +msgstr "En el fichero incluído de %s:%u" + +#. Translators note: this message is used in conjunction +#. with "In file included from %s:%ld" and some other +#. tricks. We want something like this: +#. +#. | In file included from sys/select.h:123, +#. | from sys/types.h:234, +#. | from userfile.c:31: +#. | bits/select.h:45: <error message here> +#. +#. with all the "from"s lined up. +#. The trailing comma is at the beginning of this message, +#. and the trailing colon is not translated. +#: line-map.c:236 +#, c-format +msgid "" +",\n" +" from %s:%u" +msgstr "" +",\n" +" de %s:%u" + diff --git a/libcpp/po/fr.po b/libcpp/po/fr.po new file mode 100644 index 00000000000..07e562e1b7f --- /dev/null +++ b/libcpp/po/fr.po @@ -0,0 +1,920 @@ +# Messages français pour GNU concernant gcc. +# Copyright © 2001 Free Software Foundation, Inc. +# Michel Robitaille <robitail@IRO.UMontreal.CA>, traducteur depuis/since 1996. +# +# Vocabulaire utilisé +# lvalue = membre gauche +# deprecated = obsolète +# out of range = hors des limites +# range = gamme +# scope = porté, champ +# shadowing = masquer +# embedded PIC = PIC enchâssé +# CPU = processeur +# structure with flexible member +# = structure ayant un membre flexible +# flag = fanion +# forward declaration +# = déclaration anticipée +# token = élément lexical (dans le contexte du parsing) +# to subscript = indicer +# top-level = hors de toute fonction +# member function = fonction membre +# +# Pas traduit: +# thread +# +# J'ai des doutes pour : +# inline = enligne (pas systématiquement) +# oui dans le contexte du langage C par exemple MR +# non autrement ...de manière générale MR +# section attribute attribut de section OK MR +# wide char caractère long ...non mieux caractère large MR +# plus conforme à l'esprit. +# +# ------ +# literals littéral, ou mot composé ? +# msgid "ISO C89 forbids compound literals" +# msgstr "le C89 ISO interdit les mots composés" +# +# symbol table table des symboles ou table de symbole +# command map carte des commandes +# Combiner combinateur +# msgid "" +# ";; Combiner statistics: %d attempts, %d substitutions (%d requiring new space),\n" +# ";; %d successes.\n" +# "\n" +# msgstr "" +# ";; Statistiques du combinateur : %d tentatives, %d substitutions (%d requérant un nouvel espace),\n" +# ";; %d succès.\n" +# "\n" +# +# promote promouvoir +# msgid "the left operand of \"%s\" changes sign when promoted" +# msgstr "L'opérande gauche de « %s » change de signe lors de sa promotion" +# +# include guards ??? +# msgid "Multiple include guards may be useful for:\n" +# msgstr "De multiples balises pour les inclusions peuvent être utiles pour :\n" +# +# +# universal-character-name ??? +# msgid "incomplete universal-character-name" +# msgid "non-hex digit '%c' in universal-character-name" +# msgid "universal-character-name on EBCDIC target" +# +# poisoning empoisonnement +# msgid "poisoning existing macro \"%s\"" +# msgstr "empoisonnement de la macro existente « %s »" +# MR 9-jan 2004: poisoning etc... transformé par corruption corrompu etc.. +# +# Autres règles: +# - j'ai ajouté un adjectif par rapport à l'anglais si le message est +# une phrase avec verbe conjugé. +# - ISO est considéré comme un adjectif dans « C ISO » +# +# Erreurs corrigées: +# librairies, assumer +# +# A faire: +# - s/en ligne/en-ligne/ modifié 9-janv-2004 MR +# - s/en-ligne/enligne/ modifié 18-février-2004 MR pcq expression ou terme enlignage vs inlining +# - hors gamme a été changé pour hors limite ...MR 09-jan-2004 +# - literal +# - chaine de format => formatage +# - scope +# - supporté est un faux ami +# +# A rapporter upstream: +# <<<<<<<< +# In c-opts.c, begining line 1732, a lot of options are of the kind: +# " -W[no-]trigraphs Warn if trigraphs are encountered\n" +# I guess it would be better to change them all to something like +# " -W[no-]trigraphs Warn [or not] if trigraphs are encountered\n" +# +# +# #: c-opts.c:1759 +# " -MP\t\t\t Generate phony targets for all headers\n" +# you may want to change the \t to spaces, as it is done for the other lines. +# +# #: c-typeck.c:3166 c-typeck.c:4632 c-typeck.c:4648 c-typeck.c:4664 +# #: final.c:3146 final.c:3148 gcc.c:4397 rtl-error.c:122 toplev.c:1694 +# #: config/cris/cris.c:529 cp/typeck.c:4341 java/expr.c:364 java/verify.c:1467 +# #: java/verify.c:1468 java/verify.c:1483 +# #, c-format +# msgid "%s" +# msgstr "%s" +# +# Are you sure you want to translate the messages in cfgrtl.c, or are they +# debugging informations ? +# +# You may want to use ngettext instead of putting (s) in text. +# msgid "null character(s) preserved in literal" +# +# >>>>>>>>> +# +msgid "" +msgstr "" +"Project-Id-Version: GNU gcc 3.4-b20040206\n" +"POT-Creation-Date: 2004-02-06 01:34+0000\n" +"PO-Revision-Date: 2004-02-20 21:00-0500\n" +"Last-Translator: Michel Robitaille <robitail@IRO.UMontreal.CA>\n" +"Language-Team: French <traduc@traduc.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" +"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" + +#: cppexp.c:1253 +msgid "traditional C rejects the unary plus operator" +msgstr "le C traditionnel rejette le plus unaire" + +#: cpperror.c:176 +#, c-format +msgid "%s: %s" +msgstr "%s : %s" + +#: cppcharset.c:653 +#, c-format +msgid "conversion from %s to %s not supported by iconv" +msgstr "conversion de %s vers %s n'est pas supporté par iconv" + +#: cppcharset.c:656 +msgid "iconv_open" +msgstr "iconv_open" + +#. FIXME: should be DL_SORRY +#: cppcharset.c:664 +#, c-format +msgid "no iconv implementation, cannot convert from %s to %s" +msgstr "pas d'implantation iconv, ne peut convertir de %s vers %s" + +#: cppcharset.c:808 +msgid "universal character names are only valid in C++ and C99" +msgstr "noms de caractère universel sont seulement valides en C++ et C89" + +#: cppcharset.c:811 +#, c-format +msgid "the meaning of '\\%c' is different in traditional C" +msgstr "la signification de « \\%c » est différente en C traditionel" + +# FIXME +#: cppcharset.c:837 +#, c-format +msgid "incomplete universal character name %.*s" +msgstr "nom de caractère universel incomplet %.*s" + +#: cppcharset.c:849 +#, c-format +msgid "%.*s is not a valid universal character" +msgstr "%.*s n'est pas un caractère universel valide" + +#: cppcharset.c:859 +#, c-format +msgid "universal character %.*s is not valid in an identifier" +msgstr "caractère universel %.*s n'est pas valide dans un identificcateur" + +#: cppcharset.c:863 +#, c-format +msgid "universal character %.*s is not valid at the start of an identifier" +msgstr "" +"caractère universel %.*s n'est pas valide au début d'un identificcateur" + +#: cppcharset.c:898 +msgid "converting UCN to source character set" +msgstr "conversion UCN vers le jeu source de caractères" + +#: cppcharset.c:902 +msgid "converting UCN to execution character set" +msgstr "conversion UCN vers le jeu d'exécution de caractères" + +#: cppcharset.c:967 +msgid "the meaning of '\\x' is different in traditional C" +msgstr "la signification de « \\x » est différente en C traditionel" + +#: cppcharset.c:984 f/lex.c:580 +msgid "\\x used with no following hex digits" +msgstr "\\x utilisé sans être suivi de chiffres en hexdécimal" + +#: cppcharset.c:991 +msgid "hex escape sequence out of range" +msgstr "séquence d'échappement hexadécimale hors limite" + +#: cppcharset.c:1030 +msgid "octal escape sequence out of range" +msgstr "séquence d'échappement octale hors limite" + +#: cppcharset.c:1098 +msgid "the meaning of '\\a' is different in traditional C" +msgstr "la signification de « \\a » est différente en C traditionel" + +#: cppcharset.c:1105 +#, c-format +msgid "non-ISO-standard escape sequence, '\\%c'" +msgstr "séquence d'échappement « \\%c » non conforme au standard ISO" + +#: cppcharset.c:1113 +#, c-format +msgid "unknown escape sequence '\\%c'" +msgstr "séquence d'échappement « \\%c » inconnue" + +#: cppcharset.c:1116 +#, c-format +msgid "unknown escape sequence: '\\%03o'" +msgstr "séquence d'échappement « \\%03o » inconnue" + +#: cppcharset.c:1122 +msgid "converting escape sequence to execution character set" +msgstr "" +"conversion d'une séquence d'échappement vers un jeu d'exécution de caractères" + +#: cppcharset.c:1181 +msgid "converting to execution character set" +msgstr "conversion vers un jeu d'exécution de caractères" + +#: cppcharset.c:1244 cppcharset.c:1307 +msgid "character constant too long for its type" +msgstr "constante caractère trop longue pour son type" + +#: cppcharset.c:1247 +msgid "multi-character character constant" +msgstr "constante caractère multi-caractères" + +#: cppcharset.c:1339 +msgid "empty character constant" +msgstr "constante caractère vide" + +#: cppcharset.c:1378 +#, c-format +msgid "failure to convert %s to %s" +msgstr "échec de conversion de %s vers %s" + +#: cpperror.c:110 diagnostic.def:5 +msgid "warning: " +msgstr "attention : " + +#: cpperror.c:112 +msgid "internal error: " +msgstr "erreur interne : " + +#: cpperror.c:174 +msgid "stdout" +msgstr "stdout" + +#: cppexp.c:192 +msgid "too many decimal points in number" +msgstr "trop de points décimaux dans le nombre" + +#: cppexp.c:212 +#, c-format +msgid "invalid digit \"%c\" in octal constant" +msgstr "chiffre « %c » invalide dans la constante en base 8" + +#: cppexp.c:218 +msgid "use of C99 hexadecimal floating constant" +msgstr "usage d'une constante hexadécimale constante à la C99" + +#: cppexp.c:227 +msgid "exponent has no digits" +msgstr "l'exposant n'a pas de chiffre" + +#: cppexp.c:234 +msgid "hexadecimal floating constants require an exponent" +msgstr "la contante hexadécimale flottante requière un exposant" + +#: cppexp.c:240 +#, c-format +msgid "invalid suffix \"%.*s\" on floating constant" +msgstr "suffixe « %.*s » invalide pour une constante flottante" + +#: cppexp.c:250 cppexp.c:275 +#, c-format +msgid "traditional C rejects the \"%.*s\" suffix" +msgstr "le C traditionnel interdit le suffixe « %.*s »" + +#: cppexp.c:261 +#, c-format +msgid "invalid suffix \"%.*s\" on integer constant" +msgstr "suffixe « %.*s » invalide pour une constante entière" + +#: cppexp.c:283 +msgid "use of C99 long long integer constant" +msgstr "usage d'une constante entière « long long » à la C99" + +#: cppexp.c:290 +msgid "imaginary constants are a GCC extension" +msgstr "les constantes imaginaires sont une extension GCC" + +#: cppexp.c:376 +msgid "integer constant is too large for its type" +msgstr "constante entière trop grande pour tenir dans son type" + +#: cppexp.c:388 +msgid "integer constant is so large that it is unsigned" +msgstr "cette constante entière est si grande qu'elle ne peut être signée" + +#: cppexp.c:470 +msgid "missing ')' after \"defined\"" +msgstr "« ) » manquant après « defined »" + +#: cppexp.c:477 +msgid "operator \"defined\" requires an identifier" +msgstr "l'opérateur « defined » requiert un identificateur" + +#: cppexp.c:485 +#, c-format +msgid "(\"%s\" is an alternative token for \"%s\" in C++)" +msgstr "(« %s » est un élément lexical alternatif pour « %s » en C++)" + +#: cppexp.c:495 +msgid "this use of \"defined\" may not be portable" +msgstr "cette utilisation de « defined » peut ne pas être portable" + +#: cppexp.c:531 +msgid "floating constant in preprocessor expression" +msgstr "constante flottante dans une expresion pour le préprocesseur" + +#: cppexp.c:537 +msgid "imaginary number in preprocessor expression" +msgstr "constante complexe dans une expresion pour le préprocesseur" + +#: cppexp.c:582 +#, c-format +msgid "\"%s\" is not defined" +msgstr "« %s » n'est pas défini" + +#: cppexp.c:714 cppexp.c:743 +#, c-format +msgid "missing binary operator before token \"%s\"" +msgstr "opérateur binaire manquant avant l'élément lexical « %s »" + +#: cppexp.c:734 +#, c-format +msgid "token \"%s\" is not valid in preprocessor expressions" +msgstr "" +"l'élément lexical « %s » n'est pas valide dans les expressions pour le " +"préprocesseur" + +#: cppexp.c:753 +msgid "void expression between '(' and ')'" +msgstr "expression void entre parenthèses" + +#: cppexp.c:756 +msgid "#if with no expression" +msgstr "#if sans expression" + +#: cppexp.c:758 +#, c-format +msgid "operator '%s' has no right operand" +msgstr "l'opérateur « %s » n'a pas d'opérande droite" + +#: cppexp.c:784 +msgid " ':' without preceding '?'" +msgstr "« : » n'est pas précédé de « ? »" + +#: cppexp.c:811 +msgid "unbalanced stack in #if" +msgstr "pile non balancée dans #if" + +#: cppexp.c:830 +#, c-format +msgid "impossible operator '%u'" +msgstr "opérateur impossible « %u »" + +#: cppexp.c:922 +msgid "missing ')' in expression" +msgstr "« ) » manquante dans l'expresion" + +#: cppexp.c:943 +msgid "'?' without following ':'" +msgstr "« ? » n'est pas suivi de « : »" + +#: cppexp.c:953 +msgid "integer overflow in preprocessor expression" +msgstr "débordement d'entier dans l'expresion pour le préprocesseur" + +#: cppexp.c:958 +msgid "missing '(' in expression" +msgstr "« ( » manquante dans l'expresion" + +#: cppexp.c:990 +#, c-format +msgid "the left operand of \"%s\" changes sign when promoted" +msgstr "L'opérande gauche de « %s » change de signe lors de sa promotion" + +#: cppexp.c:995 +#, c-format +msgid "the right operand of \"%s\" changes sign when promoted" +msgstr "L'opérande droite de « %s » change de signe lors de sa promotion" + +#: cppexp.c:1352 +msgid "comma operator in operand of #if" +msgstr "opérateur virgule dans l'opérande de #if" + +#: cppexp.c:1483 +msgid "division by zero in #if" +msgstr "division par zéro dans #if" + +#: cppfiles.c:375 +msgid "NULL directory in find_file" +msgstr "répertoire NUL dans find_file" + +#: cppfiles.c:402 +msgid "one or more PCH files were found, but they were invalid" +msgstr "" +"un ou plusieurs fichiers PCH ont été repérés, mais ils étaient invalides" + +#: cppfiles.c:405 +msgid "use -Winvalid-pch for more information" +msgstr "utiliser -Winvalid-pch pour plus d'informations" + +# FIXME +#: cppfiles.c:463 +#, c-format +msgid "%s is a block device" +msgstr "%s est un périphérique de blocs" + +#: cppfiles.c:480 +#, c-format +msgid "%s is too large" +msgstr "%s est trop grand" + +#: cppfiles.c:515 +#, c-format +msgid "%s is shorter than expected" +msgstr "%s est plus petit que prévu" + +#: cppfiles.c:714 +#, c-format +msgid "no include path in which to search for %s" +msgstr "aucun chemin d'inclusion dans lequel on pourrait repérer %s" + +# FIXME +#: cppfiles.c:974 +msgid "Multiple include guards may be useful for:\n" +msgstr "De multiples balises pour les inclusions peuvent être utiles pour:\n" + +#: cppinit.c:389 +msgid "cppchar_t must be an unsigned type" +msgstr "cppchar_t doit être d'un type non signé" + +#: cppinit.c:393 +#, c-format +msgid "" +"preprocessor arithmetic has maximum precision of %lu bits; target requires %" +"lu bits" +msgstr "" +"l'arithmétique du préprocesseur a une précision maximale de %lu bits ; la " +"cible requière %lu bits" + +#: cppinit.c:400 +msgid "CPP arithmetic must be at least as precise as a target int" +msgstr "" +"l'arithmétique de CPP doit être au moins aussi précise que le type int de la " +"cible" + +#: cppinit.c:403 +msgid "target char is less than 8 bits wide" +msgstr "sur la cible, « char » fait moins de 8 bits" + +#: cppinit.c:407 +msgid "target wchar_t is narrower than target char" +msgstr "sur la cible, « wchar_t » est plus petit que « char »" + +#: cppinit.c:411 +msgid "target int is narrower than target char" +msgstr "sur la cible, « int » est plus petit que « char »" + +#: cppinit.c:416 +msgid "CPP half-integer narrower than CPP character" +msgstr "les demi-entiers de CPP sont plus petit que les caractères de CPP" + +#: cppinit.c:420 +#, c-format +msgid "" +"CPP on this host cannot handle wide character constants over %lu bits, but " +"the target requires %lu bits" +msgstr "" +"CPP sur cette machine ne peut gérer les constantes larges de caractères de " +"plus de %lu bits, mais la cible requière %lu bits" + +# I18N +#: cpplex.c:410 +msgid "null character(s) ignored" +msgstr "caractère(s) nul(s) ignoré(s)" + +#: cpplex.c:445 +msgid "'$' in identifier or number" +msgstr "« $ » dans un identificateur ou un nombre" + +# FIXME +#: cpplex.c:492 +#, c-format +msgid "attempt to use poisoned \"%s\"" +msgstr "tentative d'utilisation d'un « %s » corrompu" + +#: cpplex.c:500 +msgid "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro" +msgstr "" +"« __VA_ARGS__ » peut seulement appraître dans l'expansion des macros C99 à " +"nombre variable d'arguments" + +#: cpplex.c:596 +msgid "null character(s) preserved in literal" +msgstr "caractère(s) nul préservé(s) dans la chaîne" + +#: cpplex.c:916 +msgid "unterminated comment" +msgstr "commentaire non terminé" + +#: cpplex.c:927 +msgid "C++ style comments are not allowed in ISO C90" +msgstr "Les commentaires à la C++ ne sont pas permis en C89 ISO" + +#: cpplex.c:929 +msgid "(this will be reported only once per input file)" +msgstr "(ceci sera rapporté une seule fois seulement par fichier d'entrée)" + +#: cpplex.c:934 +msgid "multi-line comment" +msgstr "commentaire multi-lignes" + +#: cpplex.c:1198 +#, c-format +msgid "unspellable token %s" +msgstr "l'élément lexical %s ne peut être épelé" + +#: cpplib.c:218 +#, c-format +msgid "extra tokens at end of #%s directive" +msgstr "éléments lexicaux superflus à la fin de la directive #%s" + +#: cpplib.c:304 +#, c-format +msgid "#%s is a GCC extension" +msgstr "#%s est une extension GCC" + +#: cpplib.c:316 +msgid "suggest not using #elif in traditional C" +msgstr "il est suggéré de ne pas utiliser #elif en C traditionnel" + +#: cpplib.c:319 +#, c-format +msgid "traditional C ignores #%s with the # indented" +msgstr "le C traditionel ignore la directive #%s si le caractère # est indenté" + +#: cpplib.c:323 +#, c-format +msgid "suggest hiding #%s from traditional C with an indented #" +msgstr "il est suggéré de cacher #%s au C traditionel en indentant le « # »" + +#: cpplib.c:345 +msgid "embedding a directive within macro arguments is not portable" +msgstr "placer une directive dans les arguments d'une macro n'est pas portable" + +#: cpplib.c:365 +msgid "style of line directive is a GCC extension" +msgstr "la directive de style de ligne est extension GCC" + +#: cpplib.c:415 +#, c-format +msgid "invalid preprocessing directive #%s" +msgstr "directive de pré-traitement #%s invalide" + +#: cpplib.c:484 +msgid "\"defined\" cannot be used as a macro name" +msgstr "« defined » ne peut être utilisé comme nom de macro" + +#: cpplib.c:490 +#, c-format +msgid "\"%s\" cannot be used as a macro name as it is an operator in C++" +msgstr "" +"« %s » ne peut être utilisé comme nom de macro car c'est un opérateur en C++" + +#: cpplib.c:493 +#, c-format +msgid "no macro name given in #%s directive" +msgstr "aucun nom de macro donné dans la directive #%s" + +#: cpplib.c:496 +msgid "macro names must be identifiers" +msgstr "les noms de macro doivent être des identificateurs" + +#: cpplib.c:537 +#, c-format +msgid "undefining \"%s\"" +msgstr "indéfinition de « %s »" + +#: cpplib.c:609 +msgid "missing terminating > character" +msgstr "caractère > de terminaison manquant" + +#: cpplib.c:662 +#, c-format +msgid "#%s expects \"FILENAME\" or <FILENAME>" +msgstr "#%s attend \"NOM_DE_FICHIER\" ou <NOM_DE_FICHIER>" + +#: cpplib.c:685 +msgid "#include nested too deeply" +msgstr "#include imbriqué trop profondément" + +#: cpplib.c:723 +msgid "#include_next in primary source file" +msgstr "#include_next dans un fichier source primaire" + +#: cpplib.c:749 +#, c-format +msgid "invalid flag \"%s\" in line directive" +msgstr "fanion « %s » invalide dans la ligne de directive" + +#: cpplib.c:794 +#, c-format +msgid "\"%s\" after #line is not a positive integer" +msgstr "« %s » après #line n'est pas un nombre entier positif" + +#: cpplib.c:800 +msgid "line number out of range" +msgstr "numéro de ligne hors limite" + +#: cpplib.c:812 cpplib.c:885 +#, c-format +msgid "\"%s\" is not a valid filename" +msgstr "« %s » n'est pas un nom de fichier valide" + +#: cpplib.c:847 +#, c-format +msgid "\"%s\" after # is not a positive integer" +msgstr "« %s » après # n'est pas un nombre entier positif" + +#: cpplib.c:947 +msgid "invalid #ident directive" +msgstr "directive #ident invalide" + +# FIXME +#: cpplib.c:1027 +#, c-format +msgid "registering \"%s\" as both a pragma and a pragma namespace" +msgstr "" +"enregistrement de \"%s\" à la fois comme une pragma un espace de nom de " +"pragma" + +#: cpplib.c:1030 +#, c-format +msgid "#pragma %s %s is already registered" +msgstr "la #pragma %s %s est déjà enregistrée" + +#: cpplib.c:1033 +#, c-format +msgid "#pragma %s is already registered" +msgstr "la #pragma %s est déjà enregistrée" + +# FIXME +#: cpplib.c:1178 +msgid "#pragma once in main file" +msgstr "#pragma utilisé une seule fois dans le fichier principal" + +# FIXME +#: cpplib.c:1201 +msgid "invalid #pragma GCC poison directive" +msgstr "la directive corrompue #pragma GCC est invalide" + +# FIXME +#: cpplib.c:1210 +#, c-format +msgid "poisoning existing macro \"%s\"" +msgstr "corruption de la macro existente « %s »" + +#: cpplib.c:1231 +msgid "#pragma system_header ignored outside include file" +msgstr "#pragma system_header ignorée en dehors du fichier d'inclusion" + +#: cpplib.c:1255 +#, c-format +msgid "cannot find source file %s" +msgstr "impossible de trouver le fichier source %s" + +#: cpplib.c:1259 +#, c-format +msgid "current file is older than %s" +msgstr "le fichier courant est plus vieux que %s" + +#: cpplib.c:1373 +msgid "_Pragma takes a parenthesized string literal" +msgstr "_Pragma prend une chaîne entourée de parenthèrese" + +#: cpplib.c:1451 +msgid "#else without #if" +msgstr "#else sans #if" + +#: cpplib.c:1456 +msgid "#else after #else" +msgstr "#else après #else" + +#: cpplib.c:1484 +msgid "#elif without #if" +msgstr "#elif sans #if" + +#: cpplib.c:1489 +msgid "#elif after #else" +msgstr "#elif après #else" + +#: cpplib.c:1519 +msgid "#endif without #if" +msgstr "#endif sans #if" + +#: cpplib.c:1596 +msgid "missing '(' after predicate" +msgstr "« ( » manquante après le prédicat" + +#: cpplib.c:1611 +msgid "missing ')' to complete answer" +msgstr "« ) » manquante pour completer la réponse" + +#: cpplib.c:1631 +msgid "predicate's answer is empty" +msgstr "la réponse du prédicat est vide" + +#: cpplib.c:1658 +msgid "assertion without predicate" +msgstr "assertion sans prédicat" + +#: cpplib.c:1660 +msgid "predicate must be an identifier" +msgstr "le prédicat doit être un identificateur" + +# FIXME +#: cpplib.c:1744 +#, c-format +msgid "\"%s\" re-asserted" +msgstr "« %s » re-asserti" + +#: cppmacro.c:125 cppmacro.c:280 +#, c-format +msgid "invalid built-in macro \"%s\"" +msgstr "macro interne invalide « %s »" + +#: cppmacro.c:221 +msgid "could not determine date and time" +msgstr "ne peut déterminer la date et l'heure" + +#: cppmacro.c:393 +msgid "invalid string literal, ignoring final '\\'" +msgstr "chaîne invalide, « \\ » final ignoré" + +#: cppmacro.c:476 +#, c-format +msgid "pasting \"%s\" and \"%s\" does not give a valid preprocessing token" +msgstr "" +"le collage de « %s » et de « %s » ne donne pas d'élément lexical de pré-" +"traitement valide" + +#: cppmacro.c:514 +msgid "ISO C99 requires rest arguments to be used" +msgstr "ISO C99 requiert que tous les arguments soient utilisés" + +#: cppmacro.c:519 +#, c-format +msgid "macro \"%s\" requires %u arguments, but only %u given" +msgstr "macro « %s » requiert %u arguments, mais seulement %u ont été passés" + +#: cppmacro.c:524 +#, c-format +msgid "macro \"%s\" passed %u arguments, but takes just %u" +msgstr "la macro « %s » a reçu %u arguments, mais elle n'en prend que %u" + +#: cppmacro.c:635 +#, c-format +msgid "unterminated argument list invoking macro \"%s\"" +msgstr "liste d'arguments non terminée invoquant la macro « %s »" + +#: cppmacro.c:738 +#, c-format +msgid "function-like macro \"%s\" must be used with arguments in traditional C" +msgstr "" +"la macro « %s » ressemblant à une fonction doit utilisée avec des arguments " +"en C traditionnel" + +#: cppmacro.c:1241 +#, c-format +msgid "duplicate macro parameter \"%s\"" +msgstr "paramètre de macro « %s » en double" + +#: cppmacro.c:1286 +#, c-format +msgid "\"%s\" may not appear in macro parameter list" +msgstr "« %s » peut ne pas apparaître parmi les paramètres de macros" + +#: cppmacro.c:1294 +msgid "macro parameters must be comma-separated" +msgstr "les paramètres de macro doivent être séparés par des virgules" + +#: cppmacro.c:1311 +msgid "parameter name missing" +msgstr "nom de paramètre manquant" + +#: cppmacro.c:1326 +msgid "anonymous variadic macros were introduced in C99" +msgstr "" +"les macros anonymes à nombre variable d'arguments ont été introduites avec " +"le C99" + +#: cppmacro.c:1330 +msgid "ISO C does not permit named variadic macros" +msgstr "ISO C ne permet pas les macros nommées à nombre variable d'arguments" + +#: cppmacro.c:1339 +msgid "missing ')' in macro parameter list" +msgstr "« ) » manquante dans la liste des paramètres de macros" + +#: cppmacro.c:1402 +msgid "ISO C requires whitespace after the macro name" +msgstr "ISO C requiert un blanc après le nom de la macro" + +#: cppmacro.c:1430 +msgid "'#' is not followed by a macro parameter" +msgstr "« # » n'est pas suivi d'un paramètre de macro" + +# FIXME +#: cppmacro.c:1449 +msgid "'##' cannot appear at either end of a macro expansion" +msgstr "« ## » ne peut apparaître à chacune des fins de l'expansion de macros" + +#: cppmacro.c:1588 +#, c-format +msgid "macro argument \"%s\" would be stringified in traditional C" +msgstr "l'argument macro « %s » serait changé en chaine en C traditionnel" + +#: cppmacro.c:1611 +#, c-format +msgid "invalid hash type %d in cpp_macro_definition" +msgstr "type de hachage %d invalide dans cpp_macro_definition" + +#: cpppch.c:84 cpppch.c:332 cpppch.c:356 cpppch.c:365 cpppch.c:371 +msgid "while writing precompiled header" +msgstr "lors de l'écriture de l'en-tête pré-compilée" + +#: cpppch.c:469 +#, c-format +msgid "%s: not used because `%.*s' not defined" +msgstr "%s: n'est pas utilisé parce que « %.*s » n'est pas définie" + +#: cpppch.c:481 +#, c-format +msgid "%s: not used because `%.*s' defined as `%s' not `%.*s'" +msgstr "" +"%s: n'est pas utilisé parce que « %.*s » est défini en tant « %s » et non " +"pas « %.*s »" + +#: cpppch.c:522 +#, c-format +msgid "%s: not used because `%s' is defined" +msgstr "%s: non utilisé parce que « %s » est défini" + +#: cpppch.c:535 cpppch.c:724 +msgid "while reading precompiled header" +msgstr "lors de la lecture de l'en-tête pré-compilée" + +#: cppspec.c:106 +#, c-format +msgid "\"%s\" is not a valid option to the preprocessor" +msgstr "« %s » n'est pas une option valide pour le préprocesseur" + +#: cppspec.c:128 +msgid "too many input files" +msgstr "trop de fichiers d'entrée" + +#: cpptrad.c:744 +#, c-format +msgid "detected recursion whilst expanding macro \"%s\"" +msgstr "récursion détectée lors de l'expansion de la macro « %s »" + +#: cpptrad.c:911 +msgid "syntax error in macro parameter list" +msgstr "erreur de syntaxe dans la liste de paramètres macro" + +#: line-map.c:218 +#, c-format +msgid "In file included from %s:%u" +msgstr "Dans le fichier inclus à partir de %s:%u" + +#. Translators note: this message is used in conjunction +#. with "In file included from %s:%ld" and some other +#. tricks. We want something like this: +#. +#. | In file included from sys/select.h:123, +#. | from sys/types.h:234, +#. | from userfile.c:31: +#. | bits/select.h:45: <error message here> +#. +#. with all the "from"s lined up. +#. The trailing comma is at the beginning of this message, +#. and the trailing colon is not translated. +#: line-map.c:236 +#, c-format +msgid "" +",\n" +" from %s:%u" +msgstr "" +",\n" +" à partir de %s:%u" + diff --git a/libcpp/po/ja.po b/libcpp/po/ja.po new file mode 100644 index 00000000000..462c2360e8d --- /dev/null +++ b/libcpp/po/ja.po @@ -0,0 +1,803 @@ +# Japanese messages for gcc 3.0 +# Copyright (C) 2001 Free Software Foundation, Inc. +# Daisuke Yamashita <yamad@mb.infoweb.ne.jp>, 1999-2001 +# Masahito Yamaga <yamaga@ipc.chiba-u.ac.jp>, 1999. +# IIDA Yosiaki <iida@secom.ne.jp>, 1999. +# +msgid "" +msgstr "" +"Project-Id-Version: gcc 3.0\n" +"POT-Creation-Date: 2004-02-06 01:34+0000\n" +"PO-Revision-Date: 2001-12-05 22:47+0900\n" +"Last-Translator: Daisuke Yamashita <yamad@mb.infoweb.ne.jp>\n" +"Language-Team: Japanese <ja@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=EUC-JP\n" +"Content-Transfer-Encoding: 8bit\n" +"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" + +#: cppexp.c:1253 +msgid "traditional C rejects the unary plus operator" +msgstr "¸Å¤¤ C ¤Ç¤Ïñ¹à¥×¥é¥¹±é»»»Ò¤òµñÈݤ·¤Þ¤¹" + +#: cpperror.c:176 +#, c-format +msgid "%s: %s" +msgstr "%s: %s" + +#: cppcharset.c:653 +#, fuzzy, c-format +msgid "conversion from %s to %s not supported by iconv" +msgstr "NaN ¤«¤éÉä¹ç̵¤·À°¿ô¤Ø¤ÎÊÑ´¹¤Ç¤¹" + +#: cppcharset.c:656 +msgid "iconv_open" +msgstr "" + +#. FIXME: should be DL_SORRY +#: cppcharset.c:664 +#, c-format +msgid "no iconv implementation, cannot convert from %s to %s" +msgstr "" + +#: cppcharset.c:808 +#, fuzzy +msgid "universal character names are only valid in C++ and C99" +msgstr "¥æ¥Ë¥Ð¡¼¥µ¥ëʸ»ú̾ `\\U%08x' ¤Ï¼±Ê̻ҤÎÃæ¤Ç¤Ï͸ú¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" + +#: cppcharset.c:811 +#, fuzzy, c-format +msgid "the meaning of '\\%c' is different in traditional C" +msgstr "'\\%c' ¤Î°ÕÌ£¤Ï -traditional ¤ò¤Ä¤±¤¿¾ì¹ç¤È°Û¤Ê¤ê¤Þ¤¹" + +#: cppcharset.c:837 +#, fuzzy, c-format +msgid "incomplete universal character name %.*s" +msgstr "̵¸ú¤Ê ¥æ¥Ë¥Ð¡¼¥µ¥ëʸ»ú̾" + +#: cppcharset.c:849 +#, fuzzy, c-format +msgid "%.*s is not a valid universal character" +msgstr "ÉÔŬÀڤʥæ¥Ë¥Ð¡¼¥µ¥ë¥¥ã¥é¥¯¥¿Ì¾" + +#: cppcharset.c:859 +#, fuzzy, c-format +msgid "universal character %.*s is not valid in an identifier" +msgstr "¥æ¥Ë¥Ð¡¼¥µ¥ëʸ»ú̾ `\\U%08x' ¤Ï¼±Ê̻ҤÎÃæ¤Ç¤Ï͸ú¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" + +#: cppcharset.c:863 +#, fuzzy, c-format +msgid "universal character %.*s is not valid at the start of an identifier" +msgstr "¥æ¥Ë¥Ð¡¼¥µ¥ëʸ»ú̾ `\\U%08x' ¤Ï¼±Ê̻ҤÎÃæ¤Ç¤Ï͸ú¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" + +#: cppcharset.c:898 +msgid "converting UCN to source character set" +msgstr "" + +#: cppcharset.c:902 +msgid "converting UCN to execution character set" +msgstr "" + +#: cppcharset.c:967 +#, fuzzy +msgid "the meaning of '\\x' is different in traditional C" +msgstr "'\\a' ¤Î°ÕÌ£¤Ï -traditional ¤ò¤Ä¤±¤¿¾ì¹ç¤È°Û¤Ê¤ê¤Þ¤¹" + +#: cppcharset.c:984 f/lex.c:580 +msgid "\\x used with no following hex digits" +msgstr "\\x ¤Ë¡¢¤½¤ì¤Ë³¤¯¤Ï¤º¤Î 16 ¿Ê¿ô¤¬¤¢¤ê¤Þ¤»¤ó" + +#: cppcharset.c:991 +msgid "hex escape sequence out of range" +msgstr "16 ¿Ê¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤¬Èϰϳ°¤Ç¤¹" + +#: cppcharset.c:1030 +msgid "octal escape sequence out of range" +msgstr "8 ¿Ê¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤¬Èϰϳ°¤Ç¤¹" + +#: cppcharset.c:1098 +#, fuzzy +msgid "the meaning of '\\a' is different in traditional C" +msgstr "'\\a' ¤Î°ÕÌ£¤Ï -traditional ¤ò¤Ä¤±¤¿¾ì¹ç¤È°Û¤Ê¤ê¤Þ¤¹" + +#: cppcharset.c:1105 +#, c-format +msgid "non-ISO-standard escape sequence, '\\%c'" +msgstr "Èó ISO ɸ½à¤Î¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹, '\\%c'" + +#: cppcharset.c:1113 +#, c-format +msgid "unknown escape sequence '\\%c'" +msgstr "ÉÔÌÀ¤Ê¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹ '\\%c'" + +#: cppcharset.c:1116 +#, fuzzy, c-format +msgid "unknown escape sequence: '\\%03o'" +msgstr "ÉÔÌÀ¤Ê¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹ '\\%c'" + +#: cppcharset.c:1122 +#, fuzzy +msgid "converting escape sequence to execution character set" +msgstr "ʸ»ú¤ËÂФ¹¤ë¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤¬ÈϰϤò³°¤ì¤Æ¤¤¤Þ¤¹" + +#: cppcharset.c:1181 +msgid "converting to execution character set" +msgstr "" + +#: cppcharset.c:1244 cppcharset.c:1307 +#, fuzzy +msgid "character constant too long for its type" +msgstr "ʸ»úÄê¿ô¤¬Ä¹¤¹¤®¤Þ¤¹" + +#: cppcharset.c:1247 +msgid "multi-character character constant" +msgstr "Ê£¿ôʸ»ú¤«¤é¤Ê¤ëʸ»úÄê¿ô" + +#: cppcharset.c:1339 +msgid "empty character constant" +msgstr "¶õ¤Îʸ»úÄê¿ô" + +#: cppcharset.c:1378 +#, c-format +msgid "failure to convert %s to %s" +msgstr "" + +#: cpperror.c:110 diagnostic.def:5 +msgid "warning: " +msgstr "·Ù¹ð: " + +#: cpperror.c:112 +msgid "internal error: " +msgstr "ÆâÉô¥¨¥é¡¼: " + +#: cpperror.c:174 +#, fuzzy +msgid "stdout" +msgstr "¹½Â¤ÂÎ" + +#: cppexp.c:192 +#, fuzzy +msgid "too many decimal points in number" +msgstr "`asm' Ãæ¤ÎÂåÂØ¥¡¼¥ï¡¼¥É¤¬Â¿¤¹¤®¤Þ¤¹" + +#: cppexp.c:212 +#, fuzzy, c-format +msgid "invalid digit \"%c\" in octal constant" +msgstr "̵¸ú¤Ê¶çÆÉÅÀ `%c' ¤¬À©ÌóÆâ¤Ë¤¢¤ê¤Þ¤¹" + +#: cppexp.c:218 +#, fuzzy +msgid "use of C99 hexadecimal floating constant" +msgstr "16 ¿ÊÉâÆ°¾®¿ôÄê¿ô¤¬¤Ù¤¾è¤ò»ý¤Á¤Þ¤»¤ó" + +#: cppexp.c:227 +#, fuzzy +msgid "exponent has no digits" +msgstr "ÉâÆ°¾®¿ôÄê¿ô¤Î¤Ù¤¿ô¤¬¡¢¥¢¥é¥Ó¥¢¿ô»ú¤ò»ý¤Ã¤Æ¤¤¤Þ¤»¤ó" + +#: cppexp.c:234 +#, fuzzy +msgid "hexadecimal floating constants require an exponent" +msgstr "16 ¿ÊÉâÆ°¾®¿ôÄê¿ô¤¬¤Ù¤¾è¤ò»ý¤Á¤Þ¤»¤ó" + +#: cppexp.c:240 +#, fuzzy, c-format +msgid "invalid suffix \"%.*s\" on floating constant" +msgstr "ÀÜÈø¼ '%.*s' ¤ÏÀ°¿ôÄê¿ô¤Ë¤Ï̵¸ú¤Ç¤¹" + +#: cppexp.c:250 cppexp.c:275 +#, fuzzy, c-format +msgid "traditional C rejects the \"%.*s\" suffix" +msgstr "¸Å¤¤ C ¤Ç¤Ï 'f' ÀÜÈø¼¤¬µñÈݤµ¤ì¤Þ¤¹" + +#: cppexp.c:261 +#, fuzzy, c-format +msgid "invalid suffix \"%.*s\" on integer constant" +msgstr "ÀÜÈø¼ '%.*s' ¤ÏÀ°¿ôÄê¿ô¤Ë¤Ï̵¸ú¤Ç¤¹" + +#: cppexp.c:283 +#, fuzzy +msgid "use of C99 long long integer constant" +msgstr "ISO C89 ¤Ç¤Ï long long À°¿ôÄê¿ô¤ò¶Ø¤¸¤Þ¤¹" + +#: cppexp.c:290 +#, fuzzy +msgid "imaginary constants are a GCC extension" +msgstr "#if ¼°¤ÎÃæ¤Ç¤Ïʸ»úÎóÄê¿ô¤¬»È¤¨¤Þ¤»¤ó" + +#: cppexp.c:376 +#, fuzzy +msgid "integer constant is too large for its type" +msgstr "À°¿ôÄê¿ô¤¬Â礤¹¤®¤ë¤Î¤Ç unsigned ¤Ë¤Ê¤ê¤Þ¤·¤¿" + +#: cppexp.c:388 +msgid "integer constant is so large that it is unsigned" +msgstr "À°¿ôÄê¿ô¤¬Â礤¹¤®¤ë¤Î¤Ç unsigned ¤Ë¤Ê¤ê¤Þ¤·¤¿" + +#: cppexp.c:470 +msgid "missing ')' after \"defined\"" +msgstr "\"defined\" ¤Î¸å¤í¤Î ')' ¤¬·ç¤±¤Æ¤¤¤Þ¤¹" + +#: cppexp.c:477 +msgid "operator \"defined\" requires an identifier" +msgstr "\"defined\" ±é»»»Ò¤Ï¼±Ê̻ҤòÍ׵ᤷ¤Þ¤¹" + +#: cppexp.c:485 +#, c-format +msgid "(\"%s\" is an alternative token for \"%s\" in C++)" +msgstr "¡ÊC++ ¤Ç¤Ï \"%s\" ¤¬ \"%s\" ¤ÎÂåÂإȡ¼¥¯¥ó¤Ç¤¹¡Ë" + +#: cppexp.c:495 +msgid "this use of \"defined\" may not be portable" +msgstr "" + +#: cppexp.c:531 +#, fuzzy +msgid "floating constant in preprocessor expression" +msgstr "À°¿ô¤¬¥×¥ê¥×¥í¥»¥Ã¥µ¼°Æâ¤Ç¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤·¤Þ¤·¤¿" + +#: cppexp.c:537 +#, fuzzy +msgid "imaginary number in preprocessor expression" +msgstr "À°¿ô¤¬¥×¥ê¥×¥í¥»¥Ã¥µ¼°Æâ¤Ç¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤·¤Þ¤·¤¿" + +#: cppexp.c:582 +#, c-format +msgid "\"%s\" is not defined" +msgstr "\"%s\" ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" + +#: cppexp.c:714 cppexp.c:743 +#, c-format +msgid "missing binary operator before token \"%s\"" +msgstr "" + +#: cppexp.c:734 +#, fuzzy, c-format +msgid "token \"%s\" is not valid in preprocessor expressions" +msgstr "À°¿ô¤¬¥×¥ê¥×¥í¥»¥Ã¥µ¼°Æâ¤Ç¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤·¤Þ¤·¤¿" + +#: cppexp.c:753 +#, fuzzy +msgid "void expression between '(' and ')'" +msgstr "¼°Ê¸¤¬Ìµ¸ú¤Ç¤¹" + +#: cppexp.c:756 +#, fuzzy +msgid "#if with no expression" +msgstr " throw ¤µ¤ì¤¿¼°¤ÎÃæ" + +#: cppexp.c:758 +#, fuzzy, c-format +msgid "operator '%s' has no right operand" +msgstr "È¿Éü»Ò `%s' ¤ÏÈóÀ°¿ô·¿¤Ç¤¹" + +#: cppexp.c:784 +msgid " ':' without preceding '?'" +msgstr "" + +#: cppexp.c:811 +#, fuzzy +msgid "unbalanced stack in #if" +msgstr "Âбþ¤·¤Æ¤¤¤Ê¤¤ #endif" + +#: cppexp.c:830 +#, fuzzy, c-format +msgid "impossible operator '%u'" +msgstr "¤¢¤ê¤¨¤Ê¤¤±é»»»Ò '%s'" + +#: cppexp.c:922 +#, fuzzy +msgid "missing ')' in expression" +msgstr "Äê¿ô¼°¤¬·ç¤±¤Æ¤¤¤ë¤«Ìµ¸ú¤Ç¤¹" + +#: cppexp.c:943 +msgid "'?' without following ':'" +msgstr "" + +#: cppexp.c:953 +msgid "integer overflow in preprocessor expression" +msgstr "À°¿ô¤¬¥×¥ê¥×¥í¥»¥Ã¥µ¼°Æâ¤Ç¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤·¤Þ¤·¤¿" + +#: cppexp.c:958 +#, fuzzy +msgid "missing '(' in expression" +msgstr "Äê¿ô¼°¤¬·ç¤±¤Æ¤¤¤ë¤«Ìµ¸ú¤Ç¤¹" + +#: cppexp.c:990 +#, c-format +msgid "the left operand of \"%s\" changes sign when promoted" +msgstr "" + +#: cppexp.c:995 +#, c-format +msgid "the right operand of \"%s\" changes sign when promoted" +msgstr "" + +#: cppexp.c:1352 +msgid "comma operator in operand of #if" +msgstr "¥«¥ó¥Þ±é»»»Ò¤¬ #if ±é»»»Ò¤ÎÃæ¤Ë¤¢¤ê¤Þ¤¹" + +#: cppexp.c:1483 +msgid "division by zero in #if" +msgstr "#if ¤Ç¥¼¥í½ü»»¤¬È¯À¸¤·¤Þ¤·¤¿" + +#: cppfiles.c:375 +msgid "NULL directory in find_file" +msgstr "" + +#: cppfiles.c:402 +msgid "one or more PCH files were found, but they were invalid" +msgstr "" + +#: cppfiles.c:405 +msgid "use -Winvalid-pch for more information" +msgstr "" + +#: cppfiles.c:463 +#, c-format +msgid "%s is a block device" +msgstr "%s ¤Ï¥Ö¥í¥Ã¥¯¥Ç¥Ð¥¤¥¹¤Ç¤¹" + +#: cppfiles.c:480 +#, c-format +msgid "%s is too large" +msgstr "%s ¤ÏÂ礤¹¤®¤Þ¤¹" + +#: cppfiles.c:515 +#, c-format +msgid "%s is shorter than expected" +msgstr "%s ¤¬ËÜÍè¤è¤ê¤âû¤¤¤Ç¤¹" + +#: cppfiles.c:714 +#, fuzzy, c-format +msgid "no include path in which to search for %s" +msgstr "%s ¤ò¸«¤Ä¤±¤ë¤¿¤á¤Î¥¤¥ó¥¯¥ë¡¼¥É¥Ñ¥¹¤¬¤¢¤ê¤Þ¤»¤ó" + +#: cppfiles.c:974 +msgid "Multiple include guards may be useful for:\n" +msgstr "¿½Å include ¤«¤é¤ÎÊݸͱפȤʤë¤Ç¤·¤ç¤¦:\n" + +#: cppinit.c:389 +#, fuzzy +msgid "cppchar_t must be an unsigned type" +msgstr "½Ò¸ì¤Ï¼±Ê̻ҤǤʤ±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó" + +#: cppinit.c:393 +#, c-format +msgid "" +"preprocessor arithmetic has maximum precision of %lu bits; target requires %" +"lu bits" +msgstr "" + +#: cppinit.c:400 +msgid "CPP arithmetic must be at least as precise as a target int" +msgstr "" + +#: cppinit.c:403 +msgid "target char is less than 8 bits wide" +msgstr "" + +#: cppinit.c:407 +msgid "target wchar_t is narrower than target char" +msgstr "" + +#: cppinit.c:411 +msgid "target int is narrower than target char" +msgstr "" + +#: cppinit.c:416 +msgid "CPP half-integer narrower than CPP character" +msgstr "" + +#: cppinit.c:420 +#, c-format +msgid "" +"CPP on this host cannot handle wide character constants over %lu bits, but " +"the target requires %lu bits" +msgstr "" + +#: cpplex.c:410 +msgid "null character(s) ignored" +msgstr "null ʸ»ú¤Ï̵»ë¤µ¤ì¤Þ¤·¤¿" + +#: cpplex.c:445 +msgid "'$' in identifier or number" +msgstr "" + +#: cpplex.c:492 +#, c-format +msgid "attempt to use poisoned \"%s\"" +msgstr "±øÀ÷¤µ¤ì¤¿ '%s' »È¤ª¤¦¤È¤·¤Æ¤¤¤Þ¤¹" + +#: cpplex.c:500 +msgid "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro" +msgstr "__VA_ARGS__ ¤Ï C99 ²ÄÊÑ°ú¿ô¥Þ¥¯¥í³ÈÄ¥¤Ç¤Î¤ß½Ð¸½¤Ç¤¤Þ¤¹" + +#: cpplex.c:596 +msgid "null character(s) preserved in literal" +msgstr "¥ê¥Æ¥é¥ëÃæ¤Ç null ʸ»ú¤¬³ÎÊݤµ¤ì¤Þ¤·¤¿" + +#: cpplex.c:916 +msgid "unterminated comment" +msgstr "½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤¤¥³¥á¥ó¥È" + +#: cpplex.c:927 +#, fuzzy +msgid "C++ style comments are not allowed in ISO C90" +msgstr "C++ ¥¹¥¿¥¤¥ë¤Î¥³¥á¥ó¥È¤Ï ISO C89 ¤Ç¤Ïµö¤µ¤ì¤Þ¤»¤ó" + +#: cpplex.c:929 +msgid "(this will be reported only once per input file)" +msgstr "(¤³¤ì¤ÏÆþÎÏ¥Õ¥¡¥¤¥ë¤Ë¤Ä¤°ì²ó¤À¤±Êó¹ð¤µ¤ì¤Þ¤¹)" + +#: cpplex.c:934 +msgid "multi-line comment" +msgstr "Ê£¿ô¹Ô¤Î¥³¥á¥ó¥È" + +#: cpplex.c:1198 +#, fuzzy, c-format +msgid "unspellable token %s" +msgstr "ÄÖ¤ì¤Ê¤¤¥È¡¼¥¯¥ó %s ¤Ç¤¹" + +#: cpplib.c:218 +#, c-format +msgid "extra tokens at end of #%s directive" +msgstr ";ʬ¤Ê¥È¡¼¥¯¥ó¤¬ #%s ¥Ç¥£¥ì¥¯¥Æ¥£¥Ö¤Î½ª¤ê¤Ë¤¢¤ê¤Þ¤¹" + +#: cpplib.c:304 +#, c-format +msgid "#%s is a GCC extension" +msgstr "#%s ¤Ï GCC ¤Î³ÈÄ¥¤Ç¤¹" + +#: cpplib.c:316 +msgid "suggest not using #elif in traditional C" +msgstr "¸Å¤¤ C ¤Ç¤Ï #elif ¤ò»È¤ï¤Ê¤¤Êý¤¬¤¤¤¤¤Ç¤¹" + +#: cpplib.c:319 +#, c-format +msgid "traditional C ignores #%s with the # indented" +msgstr "¸Å¤¤ C ¤Ç¤Ï¡¢¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤¿ # ¤Î #%s ¤ò̵»ë¤·¤Þ¤¹" + +#: cpplib.c:323 +#, c-format +msgid "suggest hiding #%s from traditional C with an indented #" +msgstr "¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤¿ # ¤¬¤¢¤ë¸Å¤¤ C ¤«¤é¤Ï #%s ¤ò±£¤¹¤³¤È¤ò¤ª´«¤á¤·¤Þ¤¹" + +#: cpplib.c:345 +msgid "embedding a directive within macro arguments is not portable" +msgstr "" + +#: cpplib.c:365 +#, fuzzy +msgid "style of line directive is a GCC extension" +msgstr "#%s ¤Ï GCC ¤Î³ÈÄ¥¤Ç¤¹" + +#: cpplib.c:415 +#, c-format +msgid "invalid preprocessing directive #%s" +msgstr "̵¸ú¤Ê¥×¥ê¥×¥í¥»¥¹¥Ç¥£¥ì¥¯¥Æ¥£¥ô #%s" + +#: cpplib.c:484 +msgid "\"defined\" cannot be used as a macro name" +msgstr "\"defined\" ¤ò¥Þ¥¯¥í̾¤È¤·¤Æ¤Ï»È¤¨¤Þ¤»¤ó" + +#: cpplib.c:490 +#, c-format +msgid "\"%s\" cannot be used as a macro name as it is an operator in C++" +msgstr "\"%s\" ¤Ï C++ ¤Î±é»»»Ò¤Ç¤¢¤ê¡¢¥Þ¥¯¥í̾¤È¤·¤Æ»ÈÍѤ¹¤ë¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó" + +#: cpplib.c:493 +#, c-format +msgid "no macro name given in #%s directive" +msgstr "¥Þ¥¯¥í̾¤¬ #%s ¥Ç¥£¥ì¥¯¥Æ¥£¥ÖÃæ¤ËÍ¿¤¨¤é¤ì¤Æ¤¤¤Þ¤»¤ó" + +#: cpplib.c:496 +msgid "macro names must be identifiers" +msgstr "¥Þ¥¯¥í̾¤Ï¼±Ê̻ҤǤʤ¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó" + +#: cpplib.c:537 +#, c-format +msgid "undefining \"%s\"" +msgstr "\"%s\" ¤ò undef ¤·¤Þ¤¹" + +#: cpplib.c:609 +msgid "missing terminating > character" +msgstr "½ªÃ¼Ê¸»ú > ¤ò·ç¤¤¤Æ¤¤¤Þ¤¹" + +#: cpplib.c:662 +#, c-format +msgid "#%s expects \"FILENAME\" or <FILENAME>" +msgstr "#%s ¤Ï \"¥Õ¥¡¥¤¥ë̾\" ¤¢¤ë¤¤¤Ï <¥Õ¥¡¥¤¥ë̾> ¤òɬÍפȤ·¤Þ¤¹" + +#: cpplib.c:685 +msgid "#include nested too deeply" +msgstr "#include ¤Î¥Í¥¹¥È¤¬¿¼¤¹¤®¤Þ¤¹" + +#: cpplib.c:723 +msgid "#include_next in primary source file" +msgstr "#include_next ¤¬¼ç¤¿¤ë¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ë¤¢¤ê¤Þ¤¹" + +#: cpplib.c:749 +#, c-format +msgid "invalid flag \"%s\" in line directive" +msgstr "\"%s\" ¤Ï line ¥Ç¥£¥ì¥¯¥Æ¥£¥Ö¤Ç¤Ï̵¸ú¤Ê¥Õ¥é¥°¤Ç¤¹" + +#: cpplib.c:794 +#, c-format +msgid "\"%s\" after #line is not a positive integer" +msgstr "#line ¤Î¸å¤í¤Î \"%s\" ¤¬Àµ¤ÎÀ°¿ô¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" + +#: cpplib.c:800 +msgid "line number out of range" +msgstr "¹ÔÈֹ椬Èϰϳ°¤Ç¤¹" + +#: cpplib.c:812 cpplib.c:885 +#, c-format +msgid "\"%s\" is not a valid filename" +msgstr "\"%s\" ¤ÏÀµ¾ï¤Ê¥Õ¥¡¥¤¥ë̾¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" + +#: cpplib.c:847 +#, fuzzy, c-format +msgid "\"%s\" after # is not a positive integer" +msgstr "#line ¤Î¸å¤í¤Î \"%s\" ¤¬Àµ¤ÎÀ°¿ô¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" + +#: cpplib.c:947 +#, fuzzy +msgid "invalid #ident directive" +msgstr "̵¸ú¤Ê #ident" + +#: cpplib.c:1027 +#, c-format +msgid "registering \"%s\" as both a pragma and a pragma namespace" +msgstr "" + +#: cpplib.c:1030 +#, fuzzy, c-format +msgid "#pragma %s %s is already registered" +msgstr "¥¯¥é¥¹ `%s' ¤Ï´û¤Ë¸ºß¤·¤Þ¤¹" + +#: cpplib.c:1033 +#, c-format +msgid "#pragma %s is already registered" +msgstr "" + +#: cpplib.c:1178 +msgid "#pragma once in main file" +msgstr "#pragma once ¤¬¥á¥¤¥ó¥Õ¥¡¥¤¥ë¤Ë¤¢¤ê¤Þ¤¹" + +#: cpplib.c:1201 +msgid "invalid #pragma GCC poison directive" +msgstr "#pragma GCC ±øÀ÷¥Ç¥£¥ì¥¯¥Æ¥£¥ô¤¬Ìµ¸ú¤Ç¤¹" + +#: cpplib.c:1210 +#, c-format +msgid "poisoning existing macro \"%s\"" +msgstr "´û¸¤Î¥Þ¥¯¥í \"%s' ¤ò±øÀ÷¤·¤Þ¤¹" + +#: cpplib.c:1231 +msgid "#pragma system_header ignored outside include file" +msgstr "include ¥Õ¥¡¥¤¥ë³°¤Î #pragma system_header ¤Ï̵»ë¤µ¤ì¤Þ¤·¤¿" + +#: cpplib.c:1255 +#, fuzzy, c-format +msgid "cannot find source file %s" +msgstr "¥½¡¼¥¹ %s ¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó" + +#: cpplib.c:1259 +#, c-format +msgid "current file is older than %s" +msgstr "¸½ºß¤Î¥Õ¥¡¥¤¥ë¤Ï %s ¤è¤ê¸Å¤¤¤Ç¤¹" + +#: cpplib.c:1373 +msgid "_Pragma takes a parenthesized string literal" +msgstr "_Pramga ¤¬³ç¸Ì¤Ç°Ï¤Þ¤ì¤¿Ê¸»úÎó¥ê¥Æ¥é¥ë¤ò¼õ¤±¼è¤ê¤Þ¤·¤¿" + +#: cpplib.c:1451 +msgid "#else without #if" +msgstr "#else ¤Ë #if ¤¬¤¢¤ê¤Þ¤»¤ó" + +#: cpplib.c:1456 +msgid "#else after #else" +msgstr "#else ¤¬ #else ¤Î¸å¤í¤Ë¤¢¤ê¤Þ¤¹" + +#: cpplib.c:1484 +msgid "#elif without #if" +msgstr "#elif ¤Ë #if ¤¬¤¢¤ê¤Þ¤»¤ó" + +#: cpplib.c:1489 +msgid "#elif after #else" +msgstr "#elif ¤¬ #else ¤Î¸å¤í¤Ë¤¢¤ê¤Þ¤¹" + +#: cpplib.c:1519 +msgid "#endif without #if" +msgstr "#endif ¤Ë #if ¤¬¤¢¤ê¤Þ¤»¤ó" + +#: cpplib.c:1596 +msgid "missing '(' after predicate" +msgstr "½Ò¸ì¤Î¸å¤í¤Î '(' ¤ò·ç¤¤¤Æ¤¤¤Þ¤¹" + +#: cpplib.c:1611 +msgid "missing ')' to complete answer" +msgstr "²ò¤òÊä´°¤¹¤ë ')' ¤ò·ç¤¤¤Æ¤¤¤Þ¤¹" + +#: cpplib.c:1631 +msgid "predicate's answer is empty" +msgstr "½Ò¸ì¤Î²ò¤¬¶õ¤Ç¤¹" + +#: cpplib.c:1658 +msgid "assertion without predicate" +msgstr "½Ò¸ì¤Î¤Ê¤¤¥¢¥µ¡¼¥·¥ç¥ó¤Ç¤¹" + +#: cpplib.c:1660 +msgid "predicate must be an identifier" +msgstr "½Ò¸ì¤Ï¼±Ê̻ҤǤʤ±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó" + +#: cpplib.c:1744 +#, c-format +msgid "\"%s\" re-asserted" +msgstr "\"%s\" ¤¬ºÆ¥¢¥µ¡¼¥È¤µ¤ì¤Þ¤·¤¿" + +#: cppmacro.c:125 cppmacro.c:280 +#, fuzzy, c-format +msgid "invalid built-in macro \"%s\"" +msgstr "ÁȤ߹þ¤ß¥Þ¥¯¥í \"%s\" ¤Ï̵¸ú¤Ç¤¹" + +#: cppmacro.c:221 +#, fuzzy +msgid "could not determine date and time" +msgstr "°Í¸´Ø·¸¤ÎÄÉÀפΤ¿¤á¤Î¥¿¡¼¥²¥Ã¥È̾¤¬ÆÃÄê¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿" + +#: cppmacro.c:393 +msgid "invalid string literal, ignoring final '\\'" +msgstr "ʸ»úÎó¥ê¥Æ¥é¥ë¤¬Ìµ¸ú¤Ç¤¹¡¢ºÇ¸å¤Î '\\' ¤ò̵»ë¤·¤Þ¤¹" + +#: cppmacro.c:476 +#, c-format +msgid "pasting \"%s\" and \"%s\" does not give a valid preprocessing token" +msgstr "" +"\"%s\" ¤È \"%s\" ¤òŽÉÕ¤±¤Þ¤·¤¿¤¬Àµ¾ï¤Ê¥×¥ê¥×¥í¥»¥Ã¥µ¥È¡¼¥¯¥ó¤È¤Ê¤ê¤Þ¤»¤ó" + +#: cppmacro.c:514 +msgid "ISO C99 requires rest arguments to be used" +msgstr "ISO C99 ¤Ï»ÈÍѤµ¤ì¤ë¤Ù¤»Ä¤ê¤Î¤Î°ú¿ô¤òÍ׵ᤷ¤Þ¤¹" + +#: cppmacro.c:519 +#, c-format +msgid "macro \"%s\" requires %u arguments, but only %u given" +msgstr "¥Þ¥¯¥í \"%s\" ¤Ï°ú¿ô¤ò %u Í׵ᤷ¤Þ¤¹¤¬¡¢%u ¸Ä¤·¤«Í¿¤¨¤é¤ì¤Æ¤¤¤Þ¤»¤ó" + +#: cppmacro.c:524 +#, c-format +msgid "macro \"%s\" passed %u arguments, but takes just %u" +msgstr "¥Þ¥¯¥í \"%s\" ¤Ë°ú¿ô¤¬ %u ÅϤµ¤ì¤Þ¤·¤¿¤¬¡¢%u ¤·¤«¼õ¤±¼è¤ê¤Þ¤»¤ó" + +#: cppmacro.c:635 +#, c-format +msgid "unterminated argument list invoking macro \"%s\"" +msgstr "½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤¤°ú¿ô¥ê¥¹¥È¤¬¥Þ¥¯¥í \"%s\" ¤òµ¯Æ°¤·¤è¤¦¤È¤·¤Þ¤·¤¿" + +#: cppmacro.c:738 +#, c-format +msgid "function-like macro \"%s\" must be used with arguments in traditional C" +msgstr "¸Å¤¤ C ¤Ç¤Ï¡¢´Ø¿ôŪ¥Þ¥¯¥í \"%s\" ¤Ë°ú¿ô¤¬Í¿¤¨¤é¤ì¤Í¤Ð¤Ê¤ê¤Þ¤»¤ó" + +#: cppmacro.c:1241 +#, c-format +msgid "duplicate macro parameter \"%s\"" +msgstr "¥Þ¥¯¥í²¾°ú¿ô \"%s\" ¤¬½ÅÊ£¤·¤Æ¤¤¤Þ¤¹" + +#: cppmacro.c:1286 +#, c-format +msgid "\"%s\" may not appear in macro parameter list" +msgstr "\"%s\" ¤Ï¥Þ¥¯¥í²¾°ú¿ô¥ê¥¹¥È¤Ë¸½¤ì¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó" + +#: cppmacro.c:1294 +msgid "macro parameters must be comma-separated" +msgstr "¥Þ¥¯¥í²¾°ú¿ô¤Ï¥«¥ó¥Þ¶èÀڤꤵ¤ì¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó" + +#: cppmacro.c:1311 +msgid "parameter name missing" +msgstr "²¾°ú¿ô̾¤ò·ç¤¤¤Æ¤¤¤Þ¤¹" + +#: cppmacro.c:1326 +msgid "anonymous variadic macros were introduced in C99" +msgstr "̵̾²ÄÊÑ°ú¿ô¥Þ¥¯¥í¤Ï C99 ¤ÇºÎ¤êÆþ¤ì¤é¤ì¤Þ¤·¤¿" + +#: cppmacro.c:1330 +msgid "ISO C does not permit named variadic macros" +msgstr "ISO C ¤Ç¤Ï̾Á°¤Ä¤²ÄÊÑ°ú¿ô¥Þ¥¯¥í¤òµö¤·¤Þ¤»¤ó" + +#: cppmacro.c:1339 +msgid "missing ')' in macro parameter list" +msgstr "¥Þ¥¯¥í²¾°ú¿ô¥ê¥¹¥È¤Ç¡¢')' ¤ò·ç¤¤¤Æ¤¤¤Þ¤¹" + +#: cppmacro.c:1402 +msgid "ISO C requires whitespace after the macro name" +msgstr "ISO C ¤Ç¤Ï¥Þ¥¯¥í̾¤Î¸å¤í¤Ë¶õÇò¤òÍ׵ᤷ¤Þ¤¹" + +#: cppmacro.c:1430 +msgid "'#' is not followed by a macro parameter" +msgstr "'#' ¤Ë¥Þ¥¯¥í²¾°ú¿ô̾¤¬Â³¤¤¤Æ¤¤¤Þ¤»¤ó" + +#: cppmacro.c:1449 +msgid "'##' cannot appear at either end of a macro expansion" +msgstr "'##' ¤Ï¥Þ¥¯¥íŸ³«¤Îξü¤Ë¤Ï½Ð¸½¤Ç¤¤Þ¤»¤ó" + +#: cppmacro.c:1588 +#, fuzzy, c-format +msgid "macro argument \"%s\" would be stringified in traditional C" +msgstr "¥Þ¥¯¥í°ú¿ô \"%s\" ¤Ï -traditional ¤ò¤Ä¤±¤ë¤Èʸ»úÎ󲽤µ¤ì¤¿»ö¤Ç¤·¤ç¤¦" + +#: cppmacro.c:1611 +#, fuzzy, c-format +msgid "invalid hash type %d in cpp_macro_definition" +msgstr "dump_definition ¤Ë ̵¸ú¤Ê¥Ï¥Ã¥·¥å¥¿¥¤¥× %d" + +#: cpppch.c:84 cpppch.c:332 cpppch.c:356 cpppch.c:365 cpppch.c:371 +msgid "while writing precompiled header" +msgstr "" + +#: cpppch.c:469 +#, fuzzy, c-format +msgid "%s: not used because `%.*s' not defined" +msgstr "¥é¥Ù¥ë `%s' ¤¬»È¤ï¤ì¤Þ¤·¤¿¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó" + +#: cpppch.c:481 +#, c-format +msgid "%s: not used because `%.*s' defined as `%s' not `%.*s'" +msgstr "" + +#: cpppch.c:522 +#, fuzzy, c-format +msgid "%s: not used because `%s' is defined" +msgstr "`%s' ¤¬»È¤ï¤ì¤Þ¤·¤¿¤¬Ì¤ÄêµÁ¤Ç¤¹" + +#: cpppch.c:535 cpppch.c:724 +msgid "while reading precompiled header" +msgstr "" + +#: cppspec.c:106 +#, c-format +msgid "\"%s\" is not a valid option to the preprocessor" +msgstr "\"%s\" ¤Ï¥×¥ê¥×¥í¥»¥Ã¥µ¤ËÂФ¹¤ëÀµ¾ï¤Ê¥ª¥×¥·¥ç¥ó¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó" + +#: cppspec.c:128 +msgid "too many input files" +msgstr "ÆþÎÏ¥Õ¥¡¥¤¥ë¤¬Â¿¤¹¤®¤Þ¤¹" + +#: cpptrad.c:744 +#, fuzzy, c-format +msgid "detected recursion whilst expanding macro \"%s\"" +msgstr "½ªÃ¼¤µ¤ì¤Æ¤¤¤Ê¤¤°ú¿ô¥ê¥¹¥È¤¬¥Þ¥¯¥í \"%s\" ¤òµ¯Æ°¤·¤è¤¦¤È¤·¤Þ¤·¤¿" + +#: cpptrad.c:911 +#, fuzzy +msgid "syntax error in macro parameter list" +msgstr "\"%s\" ¤Ï¥Þ¥¯¥í²¾°ú¿ô¥ê¥¹¥È¤Ë¸½¤ì¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó" + +#: line-map.c:218 +#, c-format +msgid "In file included from %s:%u" +msgstr "%s:%u ¤«¤é include ¤µ¤ì¤¿¥Õ¥¡¥¤¥ëÃæ" + +#. Translators note: this message is used in conjunction +#. with "In file included from %s:%ld" and some other +#. tricks. We want something like this: +#. +#. | In file included from sys/select.h:123, +#. | from sys/types.h:234, +#. | from userfile.c:31: +#. | bits/select.h:45: <error message here> +#. +#. with all the "from"s lined up. +#. The trailing comma is at the beginning of this message, +#. and the trailing colon is not translated. +#: line-map.c:236 +#, c-format +msgid "" +",\n" +" from %s:%u" +msgstr "" +",\n" +" %s:%u ¤«¤é" + diff --git a/libcpp/po/nl.po b/libcpp/po/nl.po new file mode 100644 index 00000000000..2423f7ad06e --- /dev/null +++ b/libcpp/po/nl.po @@ -0,0 +1,834 @@ +# Dutch messages for gcc 3.x. +# Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc. +# Tim Van Holder <tim.van.holder@pandora.be>, 1999, 2000, 2002, 2003. +# +# Still a lot of fuzzies, since this started life as a +# .po file for gcc 2.95.2. +# +msgid "" +msgstr "" +"Project-Id-Version: gcc 3.3.2\n" +"POT-Creation-Date: 2004-02-06 01:34+0000\n" +"PO-Revision-Date: 2003-10-26 10:40+0100\n" +"Last-Translator: Tim Van Holder <tim.van.holder@pandora.be>\n" +"Language-Team: Dutch <vertaling@nl.linux.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" +"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: cppexp.c:1253 +msgid "traditional C rejects the unary plus operator" +msgstr "" + +#: cpperror.c:176 +#, c-format +msgid "%s: %s" +msgstr "" + +#: cppcharset.c:653 +#, fuzzy, c-format +msgid "conversion from %s to %s not supported by iconv" +msgstr "afrondingsmodus niet ondersteund voor VAX-floats" + +#: cppcharset.c:656 +msgid "iconv_open" +msgstr "" + +#. FIXME: should be DL_SORRY +#: cppcharset.c:664 +#, c-format +msgid "no iconv implementation, cannot convert from %s to %s" +msgstr "" + +#: cppcharset.c:808 +#, fuzzy +msgid "universal character names are only valid in C++ and C99" +msgstr "case-waarde buiten bereik" + +#: cppcharset.c:811 +#, fuzzy, c-format +msgid "the meaning of '\\%c' is different in traditional C" +msgstr "" +"de betekenis van `\\a' varieert naargelang -traditional al dan niet gebruikt " +"wordt" + +#: cppcharset.c:837 +#, c-format +msgid "incomplete universal character name %.*s" +msgstr "" + +#: cppcharset.c:849 +#, fuzzy, c-format +msgid "%.*s is not a valid universal character" +msgstr "`%s' is geen iterator" + +#: cppcharset.c:859 +#, c-format +msgid "universal character %.*s is not valid in an identifier" +msgstr "" + +#: cppcharset.c:863 +#, c-format +msgid "universal character %.*s is not valid at the start of an identifier" +msgstr "" + +#: cppcharset.c:898 +msgid "converting UCN to source character set" +msgstr "" + +#: cppcharset.c:902 +msgid "converting UCN to execution character set" +msgstr "" + +#: cppcharset.c:967 +#, fuzzy +msgid "the meaning of '\\x' is different in traditional C" +msgstr "" +"de betekenis van `\\x' varieert naargelang -traditional al dan niet gebruikt " +"wordt" + +#: cppcharset.c:984 f/lex.c:580 +msgid "\\x used with no following hex digits" +msgstr "\\x gebruikt zonder daaropvolgende hexadecimale cijfers" + +#: cppcharset.c:991 +msgid "hex escape sequence out of range" +msgstr "hexadecimale escape sequence buiten bereik" + +#: cppcharset.c:1030 +msgid "octal escape sequence out of range" +msgstr "octale escape sequence buiten bereik" + +#: cppcharset.c:1098 +#, fuzzy +msgid "the meaning of '\\a' is different in traditional C" +msgstr "" +"de betekenis van `\\a' varieert naargelang -traditional al dan niet gebruikt " +"wordt" + +#: cppcharset.c:1105 +#, fuzzy, c-format +msgid "non-ISO-standard escape sequence, '\\%c'" +msgstr "niet-ANSI-standaard escape sequence `\\%c'" + +#: cppcharset.c:1113 +#, fuzzy, c-format +msgid "unknown escape sequence '\\%c'" +msgstr "onbekende escape sequence `\\%c'" + +#: cppcharset.c:1116 +#, fuzzy, c-format +msgid "unknown escape sequence: '\\%03o'" +msgstr "onbekende escape sequence `\\%c'" + +#: cppcharset.c:1122 +#, fuzzy +msgid "converting escape sequence to execution character set" +msgstr "octale escape sequence buiten bereik" + +#: cppcharset.c:1181 +msgid "converting to execution character set" +msgstr "" + +#: cppcharset.c:1244 cppcharset.c:1307 +#, fuzzy +msgid "character constant too long for its type" +msgstr "karakterconstante te lang" + +#: cppcharset.c:1247 +msgid "multi-character character constant" +msgstr "karakterconstante met meer dan één karakter" + +#: cppcharset.c:1339 +msgid "empty character constant" +msgstr "lege karakterconstante" + +# 'regio' klinkt niet echt, maar 'streek' lijkt me nog slechter +#: cppcharset.c:1378 +#, fuzzy, c-format +msgid "failure to convert %s to %s" +msgstr "kon 0x%l.8x niet naar een regio omzetten" + +# Dit zou misschien beter 'warning' blijven +#: cpperror.c:110 diagnostic.def:5 +msgid "warning: " +msgstr "let op: " + +#: cpperror.c:112 +#, fuzzy +msgid "internal error: " +msgstr "interne fout" + +#: cpperror.c:174 +#, fuzzy +msgid "stdout" +msgstr "struct" + +#: cppexp.c:192 +#, fuzzy +msgid "too many decimal points in number" +msgstr "teveel `l'en in integerconstante" + +#: cppexp.c:212 +#, fuzzy, c-format +msgid "invalid digit \"%c\" in octal constant" +msgstr "twee `u's in integerconstante" + +#: cppexp.c:218 +#, fuzzy +msgid "use of C99 hexadecimal floating constant" +msgstr "hexadecimale floating-point constante heeft geen exponent" + +#: cppexp.c:227 +#, fuzzy +msgid "exponent has no digits" +msgstr "exponent van floating-point constante heeft geen cijfers" + +#: cppexp.c:234 +#, fuzzy +msgid "hexadecimal floating constants require an exponent" +msgstr "hexadecimale floating-point constante heeft geen exponent" + +#: cppexp.c:240 +#, fuzzy, c-format +msgid "invalid suffix \"%.*s\" on floating constant" +msgstr "misvormde floating-point constante" + +#: cppexp.c:250 cppexp.c:275 +#, c-format +msgid "traditional C rejects the \"%.*s\" suffix" +msgstr "" + +#: cppexp.c:261 +#, fuzzy, c-format +msgid "invalid suffix \"%.*s\" on integer constant" +msgstr "twee `u's in integerconstante" + +#: cppexp.c:283 +#, fuzzy +msgid "use of C99 long long integer constant" +msgstr "ANSI C verbiedt long long integerconstantes" + +#: cppexp.c:290 +msgid "imaginary constants are a GCC extension" +msgstr "" + +#: cppexp.c:376 +#, fuzzy +msgid "integer constant is too large for its type" +msgstr "integerconstante is zo groot dat hij unsigned is" + +#: cppexp.c:388 +msgid "integer constant is so large that it is unsigned" +msgstr "integerconstante is zo groot dat hij unsigned is" + +#: cppexp.c:470 +#, fuzzy +msgid "missing ')' after \"defined\"" +msgstr "witruimte ontbreekt na `#define %.*s'" + +#: cppexp.c:477 +#, fuzzy +msgid "operator \"defined\" requires an identifier" +msgstr "`defined' zonder een naam" + +#: cppexp.c:485 +#, c-format +msgid "(\"%s\" is an alternative token for \"%s\" in C++)" +msgstr "" + +#: cppexp.c:495 +msgid "this use of \"defined\" may not be portable" +msgstr "" + +#: cppexp.c:531 +#, fuzzy +msgid "floating constant in preprocessor expression" +msgstr "integer-overflow in preprocessor-expressie" + +#: cppexp.c:537 +#, fuzzy +msgid "imaginary number in preprocessor expression" +msgstr "integer-overflow in preprocessor-expressie" + +#: cppexp.c:582 +#, fuzzy, c-format +msgid "\"%s\" is not defined" +msgstr "`%.*s' is niet gedefinieerd" + +# 'whitespace' -> 'witruimte'? +#: cppexp.c:714 cppexp.c:743 +#, fuzzy, c-format +msgid "missing binary operator before token \"%s\"" +msgstr "ontbrekende witruimte na getal `%s'" + +#: cppexp.c:734 +#, fuzzy, c-format +msgid "token \"%s\" is not valid in preprocessor expressions" +msgstr "stringconstantes zijn niet toegestaan in #if-expressies" + +#: cppexp.c:753 +#, fuzzy +msgid "void expression between '(' and ')'" +msgstr "ongeldige expressie als operand" + +#: cppexp.c:756 +#, fuzzy +msgid "#if with no expression" +msgstr "modi in %s expressie komen niet overeen" + +#: cppexp.c:758 +#, fuzzy, c-format +msgid "operator '%s' has no right operand" +msgstr "iterator `%s' is van een niet-integraal type" + +#: cppexp.c:784 +msgid " ':' without preceding '?'" +msgstr "" + +#: cppexp.c:811 +#, fuzzy +msgid "unbalanced stack in #if" +msgstr "niet-gebalanceerde `#endif'" + +#: cppexp.c:830 +#, fuzzy, c-format +msgid "impossible operator '%u'" +msgstr "incompatibele operands voor %s" + +#: cppexp.c:922 +#, fuzzy +msgid "missing ')' in expression" +msgstr "ontbrekende index-expressie" + +#: cppexp.c:943 +msgid "'?' without following ':'" +msgstr "" + +#: cppexp.c:953 +msgid "integer overflow in preprocessor expression" +msgstr "integer-overflow in preprocessor-expressie" + +#: cppexp.c:958 +#, fuzzy +msgid "missing '(' in expression" +msgstr "ontbrekende index-expressie" + +#: cppexp.c:990 +#, c-format +msgid "the left operand of \"%s\" changes sign when promoted" +msgstr "" + +#: cppexp.c:995 +#, c-format +msgid "the right operand of \"%s\" changes sign when promoted" +msgstr "" + +#: cppexp.c:1352 +#, fuzzy +msgid "comma operator in operand of #if" +msgstr "comma-operator in operand van `#if'" + +#: cppexp.c:1483 +msgid "division by zero in #if" +msgstr "deling door nul in `#if'" + +#: cppfiles.c:375 +msgid "NULL directory in find_file" +msgstr "" + +#: cppfiles.c:402 +msgid "one or more PCH files were found, but they were invalid" +msgstr "" + +#: cppfiles.c:405 +msgid "use -Winvalid-pch for more information" +msgstr "" + +#: cppfiles.c:463 +#, c-format +msgid "%s is a block device" +msgstr "" + +#: cppfiles.c:480 +#, fuzzy, c-format +msgid "%s is too large" +msgstr "bestand `%s' is te groot" + +#: cppfiles.c:515 +#, c-format +msgid "%s is shorter than expected" +msgstr "" + +#: cppfiles.c:714 +#, fuzzy, c-format +msgid "no include path in which to search for %s" +msgstr "Geen include-pad waarin %s kan gevonden worden" + +#: cppfiles.c:974 +msgid "Multiple include guards may be useful for:\n" +msgstr "" + +#: cppinit.c:389 +#, fuzzy +msgid "cppchar_t must be an unsigned type" +msgstr "`defined' zonder een naam" + +#: cppinit.c:393 +#, c-format +msgid "" +"preprocessor arithmetic has maximum precision of %lu bits; target requires %" +"lu bits" +msgstr "" + +#: cppinit.c:400 +msgid "CPP arithmetic must be at least as precise as a target int" +msgstr "" + +#: cppinit.c:403 +msgid "target char is less than 8 bits wide" +msgstr "" + +#: cppinit.c:407 +msgid "target wchar_t is narrower than target char" +msgstr "" + +#: cppinit.c:411 +msgid "target int is narrower than target char" +msgstr "" + +#: cppinit.c:416 +msgid "CPP half-integer narrower than CPP character" +msgstr "" + +#: cppinit.c:420 +#, c-format +msgid "" +"CPP on this host cannot handle wide character constants over %lu bits, but " +"the target requires %lu bits" +msgstr "" + +#: cpplex.c:410 +#, fuzzy +msgid "null character(s) ignored" +msgstr "%s bij nulkarakter" + +# Wat is een correcte vertaling voor 'identifier'? Ik kies voor 'naam'. +#: cpplex.c:445 +#, fuzzy +msgid "'$' in identifier or number" +msgstr "`$' in naam" + +#: cpplex.c:492 +#, c-format +msgid "attempt to use poisoned \"%s\"" +msgstr "" + +#: cpplex.c:500 +msgid "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro" +msgstr "" + +#: cpplex.c:596 +msgid "null character(s) preserved in literal" +msgstr "" + +#: cpplex.c:916 +msgid "unterminated comment" +msgstr "niet-beëindigde commentaar" + +#: cpplex.c:927 +msgid "C++ style comments are not allowed in ISO C90" +msgstr "" + +#: cpplex.c:929 +msgid "(this will be reported only once per input file)" +msgstr "" + +#: cpplex.c:934 +#, fuzzy +msgid "multi-line comment" +msgstr "'//'-commentaar op meerdere lijnen" + +#: cpplex.c:1198 +#, fuzzy, c-format +msgid "unspellable token %s" +msgstr "kan bestand '%s' niet openen" + +# OK, OK... Dit hoort thuis in lang nl@be, niet nl +#: cpplib.c:218 +#, fuzzy, c-format +msgid "extra tokens at end of #%s directive" +msgstr "brol aan einde van `#line'-commando" + +#: cpplib.c:304 +#, c-format +msgid "#%s is a GCC extension" +msgstr "" + +#: cpplib.c:316 +msgid "suggest not using #elif in traditional C" +msgstr "" + +#: cpplib.c:319 +#, c-format +msgid "traditional C ignores #%s with the # indented" +msgstr "" + +#: cpplib.c:323 +#, c-format +msgid "suggest hiding #%s from traditional C with an indented #" +msgstr "" + +#: cpplib.c:345 +msgid "embedding a directive within macro arguments is not portable" +msgstr "" + +#: cpplib.c:365 +msgid "style of line directive is a GCC extension" +msgstr "" + +#: cpplib.c:415 +#, fuzzy, c-format +msgid "invalid preprocessing directive #%s" +msgstr "ongeldig preprocessing-commando" + +#: cpplib.c:484 +msgid "\"defined\" cannot be used as a macro name" +msgstr "" + +#: cpplib.c:490 +#, c-format +msgid "\"%s\" cannot be used as a macro name as it is an operator in C++" +msgstr "" + +#: cpplib.c:493 +#, c-format +msgid "no macro name given in #%s directive" +msgstr "" + +#: cpplib.c:496 +msgid "macro names must be identifiers" +msgstr "" + +# is ongedefinieerd beter? ik denk van nie +#: cpplib.c:537 +#, fuzzy, c-format +msgid "undefining \"%s\"" +msgstr "`%s' wordt geondefinieerd" + +#: cpplib.c:609 +#, fuzzy +msgid "missing terminating > character" +msgstr "niet-beëindigde string- of karakterconstante" + +#: cpplib.c:662 +#, fuzzy, c-format +msgid "#%s expects \"FILENAME\" or <FILENAME>" +msgstr "`#%s' verwacht \"BESTAND\" of <BESTAND>" + +#: cpplib.c:685 +msgid "#include nested too deeply" +msgstr "" + +#: cpplib.c:723 +msgid "#include_next in primary source file" +msgstr "" + +#: cpplib.c:749 +#, fuzzy, c-format +msgid "invalid flag \"%s\" in line directive" +msgstr "`#line'-commando in slecht formaat" + +#: cpplib.c:794 +#, fuzzy, c-format +msgid "\"%s\" after #line is not a positive integer" +msgstr "switch-waarde is geen integer" + +#: cpplib.c:800 +#, fuzzy +msgid "line number out of range" +msgstr "case-waarde buiten bereik" + +#: cpplib.c:812 cpplib.c:885 +#, fuzzy, c-format +msgid "\"%s\" is not a valid filename" +msgstr "-fPIC is niet geldig met -mcoff" + +#: cpplib.c:847 +#, fuzzy, c-format +msgid "\"%s\" after # is not a positive integer" +msgstr "switch-waarde is geen integer" + +#: cpplib.c:947 +#, fuzzy +msgid "invalid #ident directive" +msgstr "`#line'-commando in slecht formaat" + +#: cpplib.c:1027 +#, c-format +msgid "registering \"%s\" as both a pragma and a pragma namespace" +msgstr "" + +#: cpplib.c:1030 +#, c-format +msgid "#pragma %s %s is already registered" +msgstr "" + +#: cpplib.c:1033 +#, c-format +msgid "#pragma %s is already registered" +msgstr "" + +#: cpplib.c:1178 +#, fuzzy +msgid "#pragma once in main file" +msgstr "`#pragma once' is verouderd" + +#: cpplib.c:1201 +#, fuzzy +msgid "invalid #pragma GCC poison directive" +msgstr "ongeldig preprocessing-commando" + +#: cpplib.c:1210 +#, c-format +msgid "poisoning existing macro \"%s\"" +msgstr "" + +#: cpplib.c:1231 +msgid "#pragma system_header ignored outside include file" +msgstr "" + +#: cpplib.c:1255 +#, fuzzy, c-format +msgid "cannot find source file %s" +msgstr "[kan %s niet vinden]" + +#: cpplib.c:1259 +#, c-format +msgid "current file is older than %s" +msgstr "" + +#: cpplib.c:1373 +#, fuzzy +msgid "_Pragma takes a parenthesized string literal" +msgstr "Onbeëindigde stringconstante" + +#: cpplib.c:1451 +msgid "#else without #if" +msgstr "" + +#: cpplib.c:1456 +#, fuzzy +msgid "#else after #else" +msgstr "`#else' na `#else'" + +#: cpplib.c:1484 +msgid "#elif without #if" +msgstr "" + +#: cpplib.c:1489 +#, fuzzy +msgid "#elif after #else" +msgstr "`#elif' na `#else'" + +#: cpplib.c:1519 +msgid "#endif without #if" +msgstr "" + +#: cpplib.c:1596 +msgid "missing '(' after predicate" +msgstr "" + +#: cpplib.c:1611 +msgid "missing ')' to complete answer" +msgstr "" + +#: cpplib.c:1631 +msgid "predicate's answer is empty" +msgstr "" + +#: cpplib.c:1658 +msgid "assertion without predicate" +msgstr "" + +#: cpplib.c:1660 +#, fuzzy +msgid "predicate must be an identifier" +msgstr "`defined' zonder een naam" + +#: cpplib.c:1744 +#, c-format +msgid "\"%s\" re-asserted" +msgstr "" + +#: cppmacro.c:125 cppmacro.c:280 +#, fuzzy, c-format +msgid "invalid built-in macro \"%s\"" +msgstr "ongeldige macronaam" + +#: cppmacro.c:221 +msgid "could not determine date and time" +msgstr "" + +#: cppmacro.c:393 +msgid "invalid string literal, ignoring final '\\'" +msgstr "" + +#: cppmacro.c:476 +#, c-format +msgid "pasting \"%s\" and \"%s\" does not give a valid preprocessing token" +msgstr "" + +#: cppmacro.c:514 +#, fuzzy +msgid "ISO C99 requires rest arguments to be used" +msgstr "ANSI C heeft een benoemd argument nodig vóór `...'" + +#: cppmacro.c:519 +#, c-format +msgid "macro \"%s\" requires %u arguments, but only %u given" +msgstr "" + +#: cppmacro.c:524 +#, c-format +msgid "macro \"%s\" passed %u arguments, but takes just %u" +msgstr "" + +#: cppmacro.c:635 +#, fuzzy, c-format +msgid "unterminated argument list invoking macro \"%s\"" +msgstr "niet-beëindigde parameterlijst in `#define'" + +#: cppmacro.c:738 +#, c-format +msgid "function-like macro \"%s\" must be used with arguments in traditional C" +msgstr "" + +#: cppmacro.c:1241 +#, fuzzy, c-format +msgid "duplicate macro parameter \"%s\"" +msgstr "herhaald lid `%s'" + +#: cppmacro.c:1286 +#, fuzzy, c-format +msgid "\"%s\" may not appear in macro parameter list" +msgstr "ongeldig karakter in naam van macro-parameter" + +#: cppmacro.c:1294 +#, fuzzy +msgid "macro parameters must be comma-separated" +msgstr "parameter 2 moet een locatie zijn" + +#: cppmacro.c:1311 +#, fuzzy +msgid "parameter name missing" +msgstr "parameternaam weggelaten" + +#: cppmacro.c:1326 +msgid "anonymous variadic macros were introduced in C99" +msgstr "" + +#: cppmacro.c:1330 +#, fuzzy +msgid "ISO C does not permit named variadic macros" +msgstr "ANSI C staat het gebruik van `varargs.h' niet toe" + +#: cppmacro.c:1339 +#, fuzzy +msgid "missing ')' in macro parameter list" +msgstr "parameternaam ontbreekt uit parameterlijst" + +#: cppmacro.c:1402 +msgid "ISO C requires whitespace after the macro name" +msgstr "" + +#: cppmacro.c:1430 +#, fuzzy +msgid "'#' is not followed by a macro parameter" +msgstr "`#' operator wordt niet gevolgd door een naam van een macro-argument" + +#: cppmacro.c:1449 +msgid "'##' cannot appear at either end of a macro expansion" +msgstr "" + +#: cppmacro.c:1588 +#, fuzzy, c-format +msgid "macro argument \"%s\" would be stringified in traditional C" +msgstr "macro-argument `%.*s' zou met -traditional string gemaakt worden." + +#: cppmacro.c:1611 +#, c-format +msgid "invalid hash type %d in cpp_macro_definition" +msgstr "" + +#: cpppch.c:84 cpppch.c:332 cpppch.c:356 cpppch.c:365 cpppch.c:371 +msgid "while writing precompiled header" +msgstr "" + +#: cpppch.c:469 +#, fuzzy, c-format +msgid "%s: not used because `%.*s' not defined" +msgstr "label `%s' gebruikt maar niet gedefinieerd" + +#: cpppch.c:481 +#, c-format +msgid "%s: not used because `%.*s' defined as `%s' not `%.*s'" +msgstr "" + +#: cpppch.c:522 +#, c-format +msgid "%s: not used because `%s' is defined" +msgstr "" + +#: cpppch.c:535 cpppch.c:724 +msgid "while reading precompiled header" +msgstr "" + +#: cppspec.c:106 +#, c-format +msgid "\"%s\" is not a valid option to the preprocessor" +msgstr "" + +#: cppspec.c:128 +#, fuzzy +msgid "too many input files" +msgstr "Geen invoerbestanden" + +#: cpptrad.c:744 +#, fuzzy, c-format +msgid "detected recursion whilst expanding macro \"%s\"" +msgstr "niet-beëindigde parameterlijst in `#define'" + +#: cpptrad.c:911 +#, fuzzy +msgid "syntax error in macro parameter list" +msgstr "ongeldig karakter in naam van macro-parameter" + +#: line-map.c:218 +#, fuzzy, c-format +msgid "In file included from %s:%u" +msgstr "In bestand ingevoegd door " + +#. Translators note: this message is used in conjunction +#. with "In file included from %s:%ld" and some other +#. tricks. We want something like this: +#. +#. | In file included from sys/select.h:123, +#. | from sys/types.h:234, +#. | from userfile.c:31: +#. | bits/select.h:45: <error message here> +#. +#. with all the "from"s lined up. +#. The trailing comma is at the beginning of this message, +#. and the trailing colon is not translated. +#: line-map.c:236 +#, fuzzy, c-format +msgid "" +",\n" +" from %s:%u" +msgstr "" +",\n" +" door " + diff --git a/libcpp/po/sv.po b/libcpp/po/sv.po new file mode 100644 index 00000000000..3416d781a33 --- /dev/null +++ b/libcpp/po/sv.po @@ -0,0 +1,820 @@ +# Swedish translation for the GNU CC. +# Copyright (C) 2000 Free Software Foundation, Inc. +# Dennis Björklund <db@zigo.dhs.org>, 2000, 2001, 2002. +# +# Kom ihåg att i svenskan så använder vi "" för citat +# och inte '' som det är i originaluttrycken. +# +# Jag har gjort en liten ordlista över uttryck som kan finnas i +# översättningen +# +# http://www.zigo.dhs.org/~dennis/gcc/ +# +# Denna lista är inte komplett men är det någon som vill hjälpa till +# att översätta gcc och har åsikter om hur dessa uttryck skall skrivas +# så ta kontakt så kan vi uppdatera den. +# +# Det mesta av övdersättningen som finns nu kommer från tiden +# innan version 3.0 av gcc. Dessvärre så fungerade aldrig gcc +# med översättningar korrekt då, så den kom inte till användning. +# Jag har överfört de gamla strängarna till dagens version (3.2) +# så det finns en början, men det är mycket kvar. Men vill någon hjälpa +# till så vore det jättebra. Jag kommer översätta en bit då och då +# i mån av tid, men det är en stor fil med komplicerade uttryck så +# det tar en stund att bli klar. +# +msgid "" +msgstr "" +"Project-Id-Version: gcc 3.2\n" +"POT-Creation-Date: 2004-02-06 01:34+0000\n" +"PO-Revision-Date: 2002-08-26 12:58+0200\n" +"Last-Translator: Dennis Björklund <db@zigo.dhs.org>\n" +"Language-Team: Swedish <sv@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" +"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" + +#: cppexp.c:1253 +msgid "traditional C rejects the unary plus operator" +msgstr "traditionell C hanterar inte operatorn unärt plus" + +#: cpperror.c:176 +#, c-format +msgid "%s: %s" +msgstr "%s: %s" + +#: cppcharset.c:653 +#, fuzzy, c-format +msgid "conversion from %s to %s not supported by iconv" +msgstr "konveretering från NaN till unsigned int" + +#: cppcharset.c:656 +msgid "iconv_open" +msgstr "" + +#. FIXME: should be DL_SORRY +#: cppcharset.c:664 +#, c-format +msgid "no iconv implementation, cannot convert from %s to %s" +msgstr "" + +#: cppcharset.c:808 +msgid "universal character names are only valid in C++ and C99" +msgstr "" + +#: cppcharset.c:811 +#, fuzzy, c-format +msgid "the meaning of '\\%c' is different in traditional C" +msgstr "semantiken för \"\\%c\" varierar med -traditional" + +#: cppcharset.c:837 +#, c-format +msgid "incomplete universal character name %.*s" +msgstr "" + +#: cppcharset.c:849 +#, fuzzy, c-format +msgid "%.*s is not a valid universal character" +msgstr "\"%s\" är inte i början av deklarationen" + +#: cppcharset.c:859 +#, c-format +msgid "universal character %.*s is not valid in an identifier" +msgstr "" + +#: cppcharset.c:863 +#, c-format +msgid "universal character %.*s is not valid at the start of an identifier" +msgstr "" + +#: cppcharset.c:898 +#, fuzzy +msgid "converting UCN to source character set" +msgstr "kan inte konvertera till en pekartyp" + +#: cppcharset.c:902 +#, fuzzy +msgid "converting UCN to execution character set" +msgstr "kan inte konvertera till en pekartyp" + +#: cppcharset.c:967 +#, fuzzy +msgid "the meaning of '\\x' is different in traditional C" +msgstr "semantiken för \"\\x\" varierar med -traditional" + +#: cppcharset.c:984 f/lex.c:580 +msgid "\\x used with no following hex digits" +msgstr "" + +#: cppcharset.c:991 +msgid "hex escape sequence out of range" +msgstr "" + +#: cppcharset.c:1030 +msgid "octal escape sequence out of range" +msgstr "" + +#: cppcharset.c:1098 +#, fuzzy +msgid "the meaning of '\\a' is different in traditional C" +msgstr "semantiken för \"\\a\" varierar med -traditional" + +#: cppcharset.c:1105 +#, c-format +msgid "non-ISO-standard escape sequence, '\\%c'" +msgstr "" + +#: cppcharset.c:1113 +#, c-format +msgid "unknown escape sequence '\\%c'" +msgstr "okänd escape-sekvens \"\\%c\"" + +#: cppcharset.c:1116 +#, fuzzy, c-format +msgid "unknown escape sequence: '\\%03o'" +msgstr "okänd escape-sekvens \"\\%c\"" + +#: cppcharset.c:1122 +#, fuzzy +msgid "converting escape sequence to execution character set" +msgstr "escape-sekvens ryms ej i ett tecken" + +#: cppcharset.c:1181 +msgid "converting to execution character set" +msgstr "" + +#: cppcharset.c:1244 cppcharset.c:1307 +#, fuzzy +msgid "character constant too long for its type" +msgstr "teckenkonstant för lång" + +#: cppcharset.c:1247 +msgid "multi-character character constant" +msgstr "flerteckens teckenkonstant" + +#: cppcharset.c:1339 +msgid "empty character constant" +msgstr "tom teckenkonstant" + +#: cppcharset.c:1378 +#, fuzzy, c-format +msgid "failure to convert %s to %s" +msgstr "kunde inte öppna dump-fil \"%s\"" + +#: cpperror.c:110 diagnostic.def:5 +msgid "warning: " +msgstr "varning: " + +#: cpperror.c:112 +msgid "internal error: " +msgstr "internt fel: " + +#: cpperror.c:174 +#, fuzzy +msgid "stdout" +msgstr "struct" + +#: cppexp.c:192 +#, fuzzy +msgid "too many decimal points in number" +msgstr "för många decimalpunker i flyttalskonstant" + +#: cppexp.c:212 +#, fuzzy, c-format +msgid "invalid digit \"%c\" in octal constant" +msgstr "ogiltigt suffix på heltalskonstant" + +#: cppexp.c:218 +#, fuzzy +msgid "use of C99 hexadecimal floating constant" +msgstr "för många decimalpunker i flyttalskonstant" + +#: cppexp.c:227 +#, fuzzy +msgid "exponent has no digits" +msgstr "numerisk kostant utan siffror" + +#: cppexp.c:234 +msgid "hexadecimal floating constants require an exponent" +msgstr "" + +#: cppexp.c:240 +#, fuzzy, c-format +msgid "invalid suffix \"%.*s\" on floating constant" +msgstr "både suffix 'f' och 'l' på flyttalskonstant" + +#: cppexp.c:250 cppexp.c:275 +#, fuzzy, c-format +msgid "traditional C rejects the \"%.*s\" suffix" +msgstr "traditionell C stödjer inte suffixet 'f'" + +#: cppexp.c:261 +#, fuzzy, c-format +msgid "invalid suffix \"%.*s\" on integer constant" +msgstr "ogiltigt suffix på heltalskonstant" + +#: cppexp.c:283 +#, fuzzy +msgid "use of C99 long long integer constant" +msgstr "ISO C89 förbjuder long long integer konstanter" + +#: cppexp.c:290 +msgid "imaginary constants are a GCC extension" +msgstr "" + +#: cppexp.c:376 +#, fuzzy +msgid "integer constant is too large for its type" +msgstr "heltalskonstant är större än maximala värdet för sin typ" + +#: cppexp.c:388 +msgid "integer constant is so large that it is unsigned" +msgstr "" + +#: cppexp.c:470 +msgid "missing ')' after \"defined\"" +msgstr "saknar ')' efter \"defined\"" + +#: cppexp.c:477 +msgid "operator \"defined\" requires an identifier" +msgstr "" + +#: cppexp.c:485 +#, c-format +msgid "(\"%s\" is an alternative token for \"%s\" in C++)" +msgstr "" + +#: cppexp.c:495 +msgid "this use of \"defined\" may not be portable" +msgstr "" + +#: cppexp.c:531 +#, fuzzy +msgid "floating constant in preprocessor expression" +msgstr "flyttalsspill i uttryck" + +#: cppexp.c:537 +#, fuzzy +msgid "imaginary number in preprocessor expression" +msgstr "ogiltig användning av void-uttryck" + +#: cppexp.c:582 +#, c-format +msgid "\"%s\" is not defined" +msgstr "\"%s\" är inte definierad" + +#: cppexp.c:714 cppexp.c:743 +#, fuzzy, c-format +msgid "missing binary operator before token \"%s\"" +msgstr "saknar mellanrum efter nummer \"%.*s\"" + +#: cppexp.c:734 +#, fuzzy, c-format +msgid "token \"%s\" is not valid in preprocessor expressions" +msgstr "\"%s\" är inte ett giltigt filnamn" + +#: cppexp.c:753 +msgid "void expression between '(' and ')'" +msgstr "" + +#: cppexp.c:756 +#, fuzzy +msgid "#if with no expression" +msgstr "#%s utan argument" + +#: cppexp.c:758 +#, c-format +msgid "operator '%s' has no right operand" +msgstr "" + +#: cppexp.c:784 +#, fuzzy +msgid " ':' without preceding '?'" +msgstr "syntaxfel vid token \"%s\"" + +#: cppexp.c:811 +#, fuzzy +msgid "unbalanced stack in #if" +msgstr "obalanserad #endif" + +#: cppexp.c:830 +#, fuzzy, c-format +msgid "impossible operator '%u'" +msgstr "saknar mellanrum efter nummer \"%.*s\"" + +#: cppexp.c:922 +#, fuzzy +msgid "missing ')' in expression" +msgstr "heltalsspill i uttryck" + +#: cppexp.c:943 +msgid "'?' without following ':'" +msgstr "" + +#: cppexp.c:953 +msgid "integer overflow in preprocessor expression" +msgstr "" + +#: cppexp.c:958 +#, fuzzy +msgid "missing '(' in expression" +msgstr "heltalsspill i uttryck" + +#: cppexp.c:990 +#, c-format +msgid "the left operand of \"%s\" changes sign when promoted" +msgstr "" + +#: cppexp.c:995 +#, c-format +msgid "the right operand of \"%s\" changes sign when promoted" +msgstr "" + +#: cppexp.c:1352 +msgid "comma operator in operand of #if" +msgstr "" + +#: cppexp.c:1483 +msgid "division by zero in #if" +msgstr "" + +#: cppfiles.c:375 +msgid "NULL directory in find_file" +msgstr "" + +#: cppfiles.c:402 +msgid "one or more PCH files were found, but they were invalid" +msgstr "" + +#: cppfiles.c:405 +msgid "use -Winvalid-pch for more information" +msgstr "" + +#: cppfiles.c:463 +#, c-format +msgid "%s is a block device" +msgstr "%s är en blockenhet" + +#: cppfiles.c:480 +#, c-format +msgid "%s is too large" +msgstr "%s är för stor" + +#: cppfiles.c:515 +#, c-format +msgid "%s is shorter than expected" +msgstr "%s är kortare än förväntat" + +#: cppfiles.c:714 +#, c-format +msgid "no include path in which to search for %s" +msgstr "" + +#: cppfiles.c:974 +msgid "Multiple include guards may be useful for:\n" +msgstr "" + +#: cppinit.c:389 +#, fuzzy +msgid "cppchar_t must be an unsigned type" +msgstr "predikat måste vara en identifierare" + +#: cppinit.c:393 +#, c-format +msgid "" +"preprocessor arithmetic has maximum precision of %lu bits; target requires %" +"lu bits" +msgstr "" + +#: cppinit.c:400 +msgid "CPP arithmetic must be at least as precise as a target int" +msgstr "" + +#: cppinit.c:403 +msgid "target char is less than 8 bits wide" +msgstr "" + +#: cppinit.c:407 +msgid "target wchar_t is narrower than target char" +msgstr "" + +#: cppinit.c:411 +msgid "target int is narrower than target char" +msgstr "" + +#: cppinit.c:416 +msgid "CPP half-integer narrower than CPP character" +msgstr "" + +#: cppinit.c:420 +#, c-format +msgid "" +"CPP on this host cannot handle wide character constants over %lu bits, but " +"the target requires %lu bits" +msgstr "" + +#: cpplex.c:410 +msgid "null character(s) ignored" +msgstr "" + +#: cpplex.c:445 +msgid "'$' in identifier or number" +msgstr "" + +#: cpplex.c:492 +#, c-format +msgid "attempt to use poisoned \"%s\"" +msgstr "försök att använda förgiftad \"%s\"" + +#: cpplex.c:500 +msgid "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro" +msgstr "" + +#: cpplex.c:596 +msgid "null character(s) preserved in literal" +msgstr "" + +#: cpplex.c:916 +msgid "unterminated comment" +msgstr "ej avslutad kommentar" + +#: cpplex.c:927 +#, fuzzy +msgid "C++ style comments are not allowed in ISO C90" +msgstr "C++ kommentarer tillåts inte av ISO C89" + +#: cpplex.c:929 +msgid "(this will be reported only once per input file)" +msgstr "" + +#: cpplex.c:934 +msgid "multi-line comment" +msgstr "" + +#: cpplex.c:1198 +#, fuzzy, c-format +msgid "unspellable token %s" +msgstr "kan inte öppna fil \"%s\"" + +#: cpplib.c:218 +#, c-format +msgid "extra tokens at end of #%s directive" +msgstr "" + +#: cpplib.c:304 +#, c-format +msgid "#%s is a GCC extension" +msgstr "#%s är en GCC-utvidgning" + +#: cpplib.c:316 +msgid "suggest not using #elif in traditional C" +msgstr "" + +#: cpplib.c:319 +#, c-format +msgid "traditional C ignores #%s with the # indented" +msgstr "traditionell C ignorerar #%s dör tecknet # är indenterat" + +#: cpplib.c:323 +#, c-format +msgid "suggest hiding #%s from traditional C with an indented #" +msgstr "" + +#: cpplib.c:345 +msgid "embedding a directive within macro arguments is not portable" +msgstr "" + +#: cpplib.c:365 +#, fuzzy +msgid "style of line directive is a GCC extension" +msgstr "#%s är en GCC-utvidgning" + +#: cpplib.c:415 +#, c-format +msgid "invalid preprocessing directive #%s" +msgstr "" + +#: cpplib.c:484 +msgid "\"defined\" cannot be used as a macro name" +msgstr "" + +#: cpplib.c:490 +#, c-format +msgid "\"%s\" cannot be used as a macro name as it is an operator in C++" +msgstr "" + +#: cpplib.c:493 +#, c-format +msgid "no macro name given in #%s directive" +msgstr "" + +#: cpplib.c:496 +msgid "macro names must be identifiers" +msgstr "" + +#: cpplib.c:537 +#, c-format +msgid "undefining \"%s\"" +msgstr "" + +#: cpplib.c:609 +msgid "missing terminating > character" +msgstr "saknar avslutande tecken >" + +#: cpplib.c:662 +#, c-format +msgid "#%s expects \"FILENAME\" or <FILENAME>" +msgstr "" + +#: cpplib.c:685 +msgid "#include nested too deeply" +msgstr "#include nästlad för djupt" + +#: cpplib.c:723 +msgid "#include_next in primary source file" +msgstr "" + +#: cpplib.c:749 +#, c-format +msgid "invalid flag \"%s\" in line directive" +msgstr "ogiltigt flagga \"%s\" i line-direktiv" + +#: cpplib.c:794 +#, c-format +msgid "\"%s\" after #line is not a positive integer" +msgstr "\"%s\" efter #line är inte ett positivt heltal" + +#: cpplib.c:800 +msgid "line number out of range" +msgstr "radnummer utanför möjligt intervall" + +#: cpplib.c:812 cpplib.c:885 +#, c-format +msgid "\"%s\" is not a valid filename" +msgstr "\"%s\" är inte ett giltigt filnamn" + +#: cpplib.c:847 +#, fuzzy, c-format +msgid "\"%s\" after # is not a positive integer" +msgstr "\"%s\" efter #line är inte ett positivt heltal" + +#: cpplib.c:947 +#, fuzzy +msgid "invalid #ident directive" +msgstr "ogiltig #indent" + +#: cpplib.c:1027 +#, c-format +msgid "registering \"%s\" as both a pragma and a pragma namespace" +msgstr "" + +#: cpplib.c:1030 +#, fuzzy, c-format +msgid "#pragma %s %s is already registered" +msgstr "Klass \"%s\" finns redan" + +#: cpplib.c:1033 +#, c-format +msgid "#pragma %s is already registered" +msgstr "" + +#: cpplib.c:1178 +msgid "#pragma once in main file" +msgstr "#pragma once i huvudfil" + +#: cpplib.c:1201 +msgid "invalid #pragma GCC poison directive" +msgstr "ogiltigt GCC-direktiv #pragma poison" + +#: cpplib.c:1210 +#, c-format +msgid "poisoning existing macro \"%s\"" +msgstr "förgiftar existerande makro \"%s\"" + +#: cpplib.c:1231 +msgid "#pragma system_header ignored outside include file" +msgstr "" + +#: cpplib.c:1255 +#, fuzzy, c-format +msgid "cannot find source file %s" +msgstr "kan inte hitta källfil %s" + +#: cpplib.c:1259 +#, c-format +msgid "current file is older than %s" +msgstr "aktuell fil är äldre än %s" + +#: cpplib.c:1373 +msgid "_Pragma takes a parenthesized string literal" +msgstr "" + +#: cpplib.c:1451 +msgid "#else without #if" +msgstr "#else utan #if" + +#: cpplib.c:1456 +msgid "#else after #else" +msgstr "#else efter #else" + +#: cpplib.c:1484 +msgid "#elif without #if" +msgstr "#elif utan #if" + +#: cpplib.c:1489 +msgid "#elif after #else" +msgstr "#elif efter #else" + +#: cpplib.c:1519 +msgid "#endif without #if" +msgstr "#endif utan #if" + +#: cpplib.c:1596 +msgid "missing '(' after predicate" +msgstr "saknas '(' efter predikat" + +#: cpplib.c:1611 +msgid "missing ')' to complete answer" +msgstr "saknas ')' för att avsluta svaret" + +#: cpplib.c:1631 +msgid "predicate's answer is empty" +msgstr "predikatets svar är tomt" + +#: cpplib.c:1658 +msgid "assertion without predicate" +msgstr "" + +#: cpplib.c:1660 +msgid "predicate must be an identifier" +msgstr "predikat måste vara en identifierare" + +#: cpplib.c:1744 +#, c-format +msgid "\"%s\" re-asserted" +msgstr "" + +#: cppmacro.c:125 cppmacro.c:280 +#, fuzzy, c-format +msgid "invalid built-in macro \"%s\"" +msgstr "förgiftar existerande makro \"%s\"" + +#: cppmacro.c:221 +#, fuzzy +msgid "could not determine date and time" +msgstr "Kunde inte öppna datafil %s.\n" + +#: cppmacro.c:393 +msgid "invalid string literal, ignoring final '\\'" +msgstr "" + +#: cppmacro.c:476 +#, c-format +msgid "pasting \"%s\" and \"%s\" does not give a valid preprocessing token" +msgstr "" + +#: cppmacro.c:514 +msgid "ISO C99 requires rest arguments to be used" +msgstr "" + +#: cppmacro.c:519 +#, c-format +msgid "macro \"%s\" requires %u arguments, but only %u given" +msgstr "" + +#: cppmacro.c:524 +#, c-format +msgid "macro \"%s\" passed %u arguments, but takes just %u" +msgstr "" + +#: cppmacro.c:635 +#, c-format +msgid "unterminated argument list invoking macro \"%s\"" +msgstr "" + +#: cppmacro.c:738 +#, c-format +msgid "function-like macro \"%s\" must be used with arguments in traditional C" +msgstr "" + +#: cppmacro.c:1241 +#, c-format +msgid "duplicate macro parameter \"%s\"" +msgstr "" + +#: cppmacro.c:1286 +#, c-format +msgid "\"%s\" may not appear in macro parameter list" +msgstr "" + +#: cppmacro.c:1294 +msgid "macro parameters must be comma-separated" +msgstr "" + +#: cppmacro.c:1311 +msgid "parameter name missing" +msgstr "parameternamn saknas" + +#: cppmacro.c:1326 +msgid "anonymous variadic macros were introduced in C99" +msgstr "" + +#: cppmacro.c:1330 +msgid "ISO C does not permit named variadic macros" +msgstr "" + +#: cppmacro.c:1339 +msgid "missing ')' in macro parameter list" +msgstr "" + +#: cppmacro.c:1402 +msgid "ISO C requires whitespace after the macro name" +msgstr "" + +#: cppmacro.c:1430 +msgid "'#' is not followed by a macro parameter" +msgstr "" + +#: cppmacro.c:1449 +msgid "'##' cannot appear at either end of a macro expansion" +msgstr "" + +#: cppmacro.c:1588 +#, c-format +msgid "macro argument \"%s\" would be stringified in traditional C" +msgstr "" + +#: cppmacro.c:1611 +#, c-format +msgid "invalid hash type %d in cpp_macro_definition" +msgstr "" + +#: cpppch.c:84 cpppch.c:332 cpppch.c:356 cpppch.c:365 cpppch.c:371 +msgid "while writing precompiled header" +msgstr "" + +#: cpppch.c:469 +#, fuzzy, c-format +msgid "%s: not used because `%.*s' not defined" +msgstr "etikett \"%s\" använd men inte definierad" + +#: cpppch.c:481 +#, c-format +msgid "%s: not used because `%.*s' defined as `%s' not `%.*s'" +msgstr "" + +#: cpppch.c:522 +#, fuzzy, c-format +msgid "%s: not used because `%s' is defined" +msgstr "\"%s\" är använd men inte definierad" + +#: cpppch.c:535 cpppch.c:724 +msgid "while reading precompiled header" +msgstr "" + +#: cppspec.c:106 +#, c-format +msgid "\"%s\" is not a valid option to the preprocessor" +msgstr "" + +#: cppspec.c:128 +msgid "too many input files" +msgstr "för många indatafiler" + +#: cpptrad.c:744 +#, c-format +msgid "detected recursion whilst expanding macro \"%s\"" +msgstr "" + +#: cpptrad.c:911 +#, fuzzy +msgid "syntax error in macro parameter list" +msgstr "parameternamn saknas i parameterlista" + +#: line-map.c:218 +#, c-format +msgid "In file included from %s:%u" +msgstr "I fil inkluderad från %s:%u" + +#. Translators note: this message is used in conjunction +#. with "In file included from %s:%ld" and some other +#. tricks. We want something like this: +#. +#. | In file included from sys/select.h:123, +#. | from sys/types.h:234, +#. | from userfile.c:31: +#. | bits/select.h:45: <error message here> +#. +#. with all the "from"s lined up. +#. The trailing comma is at the beginning of this message, +#. and the trailing colon is not translated. +#: line-map.c:236 +#, c-format +msgid "" +",\n" +" from %s:%u" +msgstr "" +",\n" +" från %s:%u" + diff --git a/libcpp/po/tr.po b/libcpp/po/tr.po new file mode 100644 index 00000000000..d7f66bf3ac1 --- /dev/null +++ b/libcpp/po/tr.po @@ -0,0 +1,792 @@ +# Turkish translations for gcc messages. +# Copyright (C) 2003 Free Software Foundation, Inc. +# Nilgün Belma Bugüner <nilgun@superonline.com>, 2001, 2002, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: gcc 3.3.2\n" +"POT-Creation-Date: 2004-02-06 01:34+0000\n" +"PO-Revision-Date: 2003-10-25 11:35+0300\n" +"Last-Translator: Nilgün Belma Bugüner <nilgun@superonline.com>\n" +"Language-Team: Turkish <gnu-tr-u12a@lists.sourceforge.net>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" +"X-Generator: KBabel 1.0\n" + +#: cppexp.c:1253 +msgid "traditional C rejects the unary plus operator" +msgstr "geleneksel C tekil artı iÅŸlecini dışlar" + +#: cpperror.c:176 +#, c-format +msgid "%s: %s" +msgstr "%s: %s" + +#: cppcharset.c:653 +#, fuzzy, c-format +msgid "conversion from %s to %s not supported by iconv" +msgstr "NaN'dan unsigned int'e dönüşüm" + +#: cppcharset.c:656 +msgid "iconv_open" +msgstr "" + +#. FIXME: should be DL_SORRY +#: cppcharset.c:664 +#, c-format +msgid "no iconv implementation, cannot convert from %s to %s" +msgstr "" + +#: cppcharset.c:808 +#, fuzzy +msgid "universal character names are only valid in C++ and C99" +msgstr "evrensel karakter ismi '\\U%08x' tanıtıcı içinde geçerli deÄŸil" + +#: cppcharset.c:811 +#, c-format +msgid "the meaning of '\\%c' is different in traditional C" +msgstr "`\\%c'nin anlamı geleneksel C'de farklıdır" + +#: cppcharset.c:837 +#, fuzzy, c-format +msgid "incomplete universal character name %.*s" +msgstr "evrensel karakter ismi tamamlanmamış" + +#: cppcharset.c:849 +#, fuzzy, c-format +msgid "%.*s is not a valid universal character" +msgstr "`%T::%D' geçerli bir bildirici deÄŸil" + +#: cppcharset.c:859 +#, fuzzy, c-format +msgid "universal character %.*s is not valid in an identifier" +msgstr "evrensel karakter ismi '\\U%08x' tanıtıcı içinde geçerli deÄŸil" + +#: cppcharset.c:863 +#, fuzzy, c-format +msgid "universal character %.*s is not valid at the start of an identifier" +msgstr "evrensel karakter ismi '\\U%08x' tanıtıcı içinde geçerli deÄŸil" + +#: cppcharset.c:898 +#, fuzzy +msgid "converting UCN to source character set" +msgstr "NULL'dan gösterici olmayan türe dönüşüm" + +#: cppcharset.c:902 +#, fuzzy +msgid "converting UCN to execution character set" +msgstr "NULL'dan gösterici olmayan türe dönüşüm" + +#: cppcharset.c:967 +msgid "the meaning of '\\x' is different in traditional C" +msgstr "'\\x'in anlamı geleneksel C'de farklıdır" + +#: cppcharset.c:984 f/lex.c:580 +msgid "\\x used with no following hex digits" +msgstr "\\x izleyen onaltılık rakamlar olmaksızın kullanılmış" + +#: cppcharset.c:991 +msgid "hex escape sequence out of range" +msgstr "onaltılık önceleme dizgesi kapsamdışı" + +#: cppcharset.c:1030 +msgid "octal escape sequence out of range" +msgstr "sekizlik önceleme dizgesi kapsamdışı" + +#: cppcharset.c:1098 +msgid "the meaning of '\\a' is different in traditional C" +msgstr "`\\a'nın anlamı geleneksel C'de farklıdır" + +#: cppcharset.c:1105 +#, c-format +msgid "non-ISO-standard escape sequence, '\\%c'" +msgstr "ISO standardı olmayan önceleme dizgesi, '\\%c'" + +#: cppcharset.c:1113 +#, c-format +msgid "unknown escape sequence '\\%c'" +msgstr "bilinmeyen önceleme dizgesi '\\%c'" + +#: cppcharset.c:1116 +#, c-format +msgid "unknown escape sequence: '\\%03o'" +msgstr "bilinmeyen önceleme dizgesi: '\\%03o'" + +#: cppcharset.c:1122 +#, fuzzy +msgid "converting escape sequence to execution character set" +msgstr "önceleme dizgesi karakter için kapsam dışı" + +#: cppcharset.c:1181 +msgid "converting to execution character set" +msgstr "" + +#: cppcharset.c:1244 cppcharset.c:1307 +msgid "character constant too long for its type" +msgstr "karakter sabiti, türü için çok uzun" + +#: cppcharset.c:1247 +msgid "multi-character character constant" +msgstr "çoklu-karakter karakter sabiti" + +#: cppcharset.c:1339 +msgid "empty character constant" +msgstr "karakter sabit boÅŸ" + +#: cppcharset.c:1378 +#, fuzzy, c-format +msgid "failure to convert %s to %s" +msgstr "`%E' den `%T' ye dönüşüm yapılamaz" + +#: cpperror.c:110 diagnostic.def:5 +msgid "warning: " +msgstr "uyarı: " + +#: cpperror.c:112 +msgid "internal error: " +msgstr "iç hata: " + +#: cpperror.c:174 +msgid "stdout" +msgstr "stdÇ" + +#: cppexp.c:192 +msgid "too many decimal points in number" +msgstr "sayı içindeki ondalık nokta sayısı çok fazla" + +#: cppexp.c:212 +#, c-format +msgid "invalid digit \"%c\" in octal constant" +msgstr "sekizlik sabit içindeki \"%c\" geçersiz" + +#: cppexp.c:218 +msgid "use of C99 hexadecimal floating constant" +msgstr "C99 onaltılık gerçel sayı sabit kullanımı" + +#: cppexp.c:227 +msgid "exponent has no digits" +msgstr "üs rakam içermiyor" + +#: cppexp.c:234 +msgid "hexadecimal floating constants require an exponent" +msgstr "onaltılık gerçel sabitler bir üs gerektirir" + +#: cppexp.c:240 +#, c-format +msgid "invalid suffix \"%.*s\" on floating constant" +msgstr "gerçel sabitin \"%.*s\" soneki geçersiz" + +#: cppexp.c:250 cppexp.c:275 +#, c-format +msgid "traditional C rejects the \"%.*s\" suffix" +msgstr "geleneksel C \"%.*s\" sonekini kullanmaz" + +#: cppexp.c:261 +#, c-format +msgid "invalid suffix \"%.*s\" on integer constant" +msgstr "tamsayı sabitte sonek \"%.*s\" soneki geçersiz" + +#: cppexp.c:283 +msgid "use of C99 long long integer constant" +msgstr "ISO C99 long long tamsayı sabitleri yasaklar" + +#: cppexp.c:290 +msgid "imaginary constants are a GCC extension" +msgstr "sanal sabitler bir GCC geniÅŸletmesidir" + +#: cppexp.c:376 +msgid "integer constant is too large for its type" +msgstr "tamsayı sabit, türü için oldukça büyük" + +#: cppexp.c:388 +msgid "integer constant is so large that it is unsigned" +msgstr "tamsayı sabit unsigned olarak oldukça büyük" + +#: cppexp.c:470 +msgid "missing ')' after \"defined\"" +msgstr "\"defined\" dan sonra ')' eksik" + +#: cppexp.c:477 +msgid "operator \"defined\" requires an identifier" +msgstr "\"defined\" iÅŸleci bir tanımlayıcı gerektirir" + +#: cppexp.c:485 +#, c-format +msgid "(\"%s\" is an alternative token for \"%s\" in C++)" +msgstr "(C++'da \"%s\" \"%s\" için bir alternatif dizgeciktir)" + +#: cppexp.c:495 +msgid "this use of \"defined\" may not be portable" +msgstr "\"defined\" bu kullanımıyla uyarlanabilir olmayabilir" + +#: cppexp.c:531 +msgid "floating constant in preprocessor expression" +msgstr "öniÅŸlemci ifadesinde gerçel sayı taÅŸması" + +#: cppexp.c:537 +msgid "imaginary number in preprocessor expression" +msgstr "öniÅŸlemci ifadesinde sanal sayı" + +#: cppexp.c:582 +#, c-format +msgid "\"%s\" is not defined" +msgstr "\"%s\" tanımlı deÄŸil" + +#: cppexp.c:714 cppexp.c:743 +#, c-format +msgid "missing binary operator before token \"%s\"" +msgstr "\"%s\" dizgeciÄŸinden önceki iki terimli iÅŸleç eksik" + +#: cppexp.c:734 +#, c-format +msgid "token \"%s\" is not valid in preprocessor expressions" +msgstr "\"%s\" dizgeciÄŸi öniÅŸlemci ifadelerinde geçersizdir" + +#: cppexp.c:753 +msgid "void expression between '(' and ')'" +msgstr "'(' ve ')' arasında void ifade" + +#: cppexp.c:756 +msgid "#if with no expression" +msgstr "#if ifadesiz" + +#: cppexp.c:758 +#, c-format +msgid "operator '%s' has no right operand" +msgstr "`%s' iÅŸlecinin saÄŸ tarafı yok" + +#: cppexp.c:784 +msgid " ':' without preceding '?'" +msgstr "':' den önce '?' yok" + +#: cppexp.c:811 +msgid "unbalanced stack in #if" +msgstr "#if ifadesinde karşılıksız yığın" + +#: cppexp.c:830 +#, c-format +msgid "impossible operator '%u'" +msgstr "iÅŸleç '%u' imkansız" + +#: cppexp.c:922 +msgid "missing ')' in expression" +msgstr "ifadede ')' eksik" + +#: cppexp.c:943 +msgid "'?' without following ':'" +msgstr "'?' dan sonra ':' yok" + +#: cppexp.c:953 +msgid "integer overflow in preprocessor expression" +msgstr "öniÅŸlemci ifadesinde tamsayı taÅŸması" + +#: cppexp.c:958 +msgid "missing '(' in expression" +msgstr "ifadede '(' eksik" + +#: cppexp.c:990 +#, c-format +msgid "the left operand of \"%s\" changes sign when promoted" +msgstr "\"%s\"in soldaki terimi yükseltgenirken iÅŸaret deÄŸiÅŸtiriyor" + +#: cppexp.c:995 +#, c-format +msgid "the right operand of \"%s\" changes sign when promoted" +msgstr "\"%s\"in saÄŸdaki terimi yükseltgenirken iÅŸaret deÄŸiÅŸtiriyor" + +#: cppexp.c:1352 +msgid "comma operator in operand of #if" +msgstr "#if'in teriminde virgül" + +#: cppexp.c:1483 +msgid "division by zero in #if" +msgstr "#if içinde sıfırla bölme" + +#: cppfiles.c:375 +msgid "NULL directory in find_file" +msgstr "" + +#: cppfiles.c:402 +msgid "one or more PCH files were found, but they were invalid" +msgstr "" + +#: cppfiles.c:405 +msgid "use -Winvalid-pch for more information" +msgstr "" + +#: cppfiles.c:463 +#, c-format +msgid "%s is a block device" +msgstr "%s bir blok aygıtıdır" + +#: cppfiles.c:480 +#, c-format +msgid "%s is too large" +msgstr "%s çok büyük" + +#: cppfiles.c:515 +#, c-format +msgid "%s is shorter than expected" +msgstr "%s beklenenden daha kısa" + +#: cppfiles.c:714 +#, fuzzy, c-format +msgid "no include path in which to search for %s" +msgstr "%s arama yolunda include dosyaları yok" + +#: cppfiles.c:974 +msgid "Multiple include guards may be useful for:\n" +msgstr "Çoklu include önlemleri aÅŸağıdakiler için kullanışlı olabilir:\n" + +#: cppinit.c:389 +msgid "cppchar_t must be an unsigned type" +msgstr "cppchar_t bir usigned tür olmalı" + +#: cppinit.c:393 +#, c-format +msgid "" +"preprocessor arithmetic has maximum precision of %lu bits; target requires %" +"lu bits" +msgstr "" +"öniÅŸlemci aritmetiÄŸi %lu bitlik maksimum geniÅŸliÄŸe sahip; hedef için %lu bit " +"gerekiyor" + +#: cppinit.c:400 +msgid "CPP arithmetic must be at least as precise as a target int" +msgstr "CPP aritmetiÄŸi en azından bir hedef int kadar geniÅŸlikte olmalı " + +#: cppinit.c:403 +msgid "target char is less than 8 bits wide" +msgstr "hedef char 8bitlik geniÅŸlikten küçük" + +#: cppinit.c:407 +msgid "target wchar_t is narrower than target char" +msgstr "hedef wchar_t hedef char'dan daha dar" + +#: cppinit.c:411 +msgid "target int is narrower than target char" +msgstr "hedef int hedef char'dan daha dar" + +#: cppinit.c:416 +msgid "CPP half-integer narrower than CPP character" +msgstr "CPP half-integer'ı CPP character'dan daha dar" + +#: cppinit.c:420 +#, c-format +msgid "" +"CPP on this host cannot handle wide character constants over %lu bits, but " +"the target requires %lu bits" +msgstr "" +"Bu konaktaki CPP %lu bitten büyük karakter sabitleriyle çalışamaz, hedef ise " +"%lu bit gerektiriyor" + +#: cpplex.c:410 +msgid "null character(s) ignored" +msgstr "null karakter(ler) yoksayıldı" + +#: cpplex.c:445 +#, fuzzy +msgid "'$' in identifier or number" +msgstr "belirteç ya da sayı içinde '$' karakter(ler)i" + +#: cpplex.c:492 +#, c-format +msgid "attempt to use poisoned \"%s\"" +msgstr "zehirli \"%s\" kullanılmaya çalışılıyor" + +#: cpplex.c:500 +msgid "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro" +msgstr "" +"__VA_ARGS__ sadece argümanlarının sayısı deÄŸiÅŸebilen bir C99 makrosunun " +"geniÅŸleme alanında görünebilir" + +#: cpplex.c:596 +msgid "null character(s) preserved in literal" +msgstr "null karakter(ler) sabit içinde saklanmış" + +#: cpplex.c:916 +msgid "unterminated comment" +msgstr "sonlandırılmamış açıklama" + +#: cpplex.c:927 +msgid "C++ style comments are not allowed in ISO C90" +msgstr "C++ tarzı açıklamalara ISO C90'da izin verilmez" + +#: cpplex.c:929 +msgid "(this will be reported only once per input file)" +msgstr "(her girdi dosyasında sadece bir kere raporlanacaktır)" + +#: cpplex.c:934 +msgid "multi-line comment" +msgstr "çok satırlı açıklama" + +#: cpplex.c:1198 +#, c-format +msgid "unspellable token %s" +msgstr "dizgecik %s okunabilir deÄŸil" + +#: cpplib.c:218 +#, c-format +msgid "extra tokens at end of #%s directive" +msgstr "#%s yönergesinin sonunda fazladan dizgecikler" + +#: cpplib.c:304 +#, c-format +msgid "#%s is a GCC extension" +msgstr "#%s bir GCC uzantısıdır" + +#: cpplib.c:316 +msgid "suggest not using #elif in traditional C" +msgstr "geleneksel C'de #elif kullanılmıyor varsayılır" + +#: cpplib.c:319 +#, c-format +msgid "traditional C ignores #%s with the # indented" +msgstr "geleneksel C'de girintili # ile #%s yoksayılır" + +#: cpplib.c:323 +#, c-format +msgid "suggest hiding #%s from traditional C with an indented #" +msgstr "" +"geleneksel C'den #%s in saklanması için bir girintili # kullanılmış " +"farzedilir" + +#: cpplib.c:345 +msgid "embedding a directive within macro arguments is not portable" +msgstr "bir yönergenin makro argümanlarla gömülmesi uyarlanabilir deÄŸil" + +#: cpplib.c:365 +msgid "style of line directive is a GCC extension" +msgstr "satır yönergesinin tarzı bir GCC özelliÄŸidir" + +#: cpplib.c:415 +#, c-format +msgid "invalid preprocessing directive #%s" +msgstr "öniÅŸlem yönergesi #%s geçersiz" + +#: cpplib.c:484 +msgid "\"defined\" cannot be used as a macro name" +msgstr "\"defined\" makro ismi olarak kullanılamaz" + +#: cpplib.c:490 +#, c-format +msgid "\"%s\" cannot be used as a macro name as it is an operator in C++" +msgstr "\"%s\" C++'da bir iÅŸleç olduÄŸundan makro ismi olarak kullanılamaz" + +#: cpplib.c:493 +#, c-format +msgid "no macro name given in #%s directive" +msgstr "#%s yönergesinde makro ismi verilmemiÅŸ" + +#: cpplib.c:496 +msgid "macro names must be identifiers" +msgstr "makro isimleri tanımlayıcılar olmalı" + +#: cpplib.c:537 +#, c-format +msgid "undefining \"%s\"" +msgstr "tanımsız yapılan \"%s\"" + +#: cpplib.c:609 +msgid "missing terminating > character" +msgstr "sonlandıran > karakteri eksik" + +#: cpplib.c:662 +#, c-format +msgid "#%s expects \"FILENAME\" or <FILENAME>" +msgstr "#%s \"DOSYA\" ya da <DOSYA> gerektirir" + +#: cpplib.c:685 +msgid "#include nested too deeply" +msgstr "#include iç içeliÄŸi çok derin" + +#: cpplib.c:723 +msgid "#include_next in primary source file" +msgstr "birncil kaynak dosyasında #include_next" + +#: cpplib.c:749 +#, c-format +msgid "invalid flag \"%s\" in line directive" +msgstr "satır yönergesinde geçersiz \"%s\" seçeneÄŸi" + +#: cpplib.c:794 +#, c-format +msgid "\"%s\" after #line is not a positive integer" +msgstr "#line'dan sonraki \"%s\" bir pozitif tamsayı deÄŸil" + +#: cpplib.c:800 +msgid "line number out of range" +msgstr "satır numarası kapsam dışı" + +#: cpplib.c:812 cpplib.c:885 +#, c-format +msgid "\"%s\" is not a valid filename" +msgstr "\"%s\" geçerli bir dosya ismi deÄŸil" + +#: cpplib.c:847 +#, c-format +msgid "\"%s\" after # is not a positive integer" +msgstr "#'dan sonraki \"%s\" bir pozitif tamsayı deÄŸil" + +#: cpplib.c:947 +msgid "invalid #ident directive" +msgstr "geçersiz #ident yönergesi" + +#: cpplib.c:1027 +#, c-format +msgid "registering \"%s\" as both a pragma and a pragma namespace" +msgstr "\"%s\" hem pragma hem de pragma isim alanı olarak kaydediliyor" + +#: cpplib.c:1030 +#, c-format +msgid "#pragma %s %s is already registered" +msgstr "#pragma %s %s zaten kayıtlı" + +#: cpplib.c:1033 +#, c-format +msgid "#pragma %s is already registered" +msgstr "#pragma %s zaten kayıtlı" + +#: cpplib.c:1178 +msgid "#pragma once in main file" +msgstr "main dosyasında '#pragma once'" + +#: cpplib.c:1201 +msgid "invalid #pragma GCC poison directive" +msgstr "geçersiz #pragma GCC poison yönergesi" + +#: cpplib.c:1210 +#, c-format +msgid "poisoning existing macro \"%s\"" +msgstr "zehirlenen mevcut makro \"%s\"" + +#: cpplib.c:1231 +msgid "#pragma system_header ignored outside include file" +msgstr "baÅŸlık dosyasının dışındaki '#pragma system_header' yoksayıldı" + +#: cpplib.c:1255 +#, fuzzy, c-format +msgid "cannot find source file %s" +msgstr "kaynak %s bulunamıyor" + +#: cpplib.c:1259 +#, c-format +msgid "current file is older than %s" +msgstr "mevcut dosya %s den daha eski" + +#: cpplib.c:1373 +msgid "_Pragma takes a parenthesized string literal" +msgstr "_Pragma bir parantezli dizge sabiti alır" + +#: cpplib.c:1451 +msgid "#else without #if" +msgstr "#if siz #else" + +#: cpplib.c:1456 +msgid "#else after #else" +msgstr "#else den sonra #else" + +#: cpplib.c:1484 +msgid "#elif without #if" +msgstr "#if siz #elif " + +#: cpplib.c:1489 +msgid "#elif after #else" +msgstr "#else den sonra #elif" + +#: cpplib.c:1519 +msgid "#endif without #if" +msgstr "#if siz #endif" + +#: cpplib.c:1596 +msgid "missing '(' after predicate" +msgstr "dayanaktan sonra '(' eksik" + +#: cpplib.c:1611 +msgid "missing ')' to complete answer" +msgstr "yanıtı tamamlayacak ')' eksik" + +#: cpplib.c:1631 +msgid "predicate's answer is empty" +msgstr "dayanakların cevabı boÅŸ" + +#: cpplib.c:1658 +msgid "assertion without predicate" +msgstr "dayanaksız olumlama" + +#: cpplib.c:1660 +msgid "predicate must be an identifier" +msgstr "dayanak bir tanımlayıcı olmalı" + +#: cpplib.c:1744 +#, c-format +msgid "\"%s\" re-asserted" +msgstr "\"%s\" tekrar olumlanmış" + +#: cppmacro.c:125 cppmacro.c:280 +#, c-format +msgid "invalid built-in macro \"%s\"" +msgstr "geçersiz yerleÅŸik makro \"%s\"" + +#: cppmacro.c:221 +msgid "could not determine date and time" +msgstr "tarih ve saat saptanamadı" + +#: cppmacro.c:393 +msgid "invalid string literal, ignoring final '\\'" +msgstr "geçersiz dizge sabit, son '\\' yoksayılıyor" + +#: cppmacro.c:476 +#, c-format +msgid "pasting \"%s\" and \"%s\" does not give a valid preprocessing token" +msgstr "\"%s\" ve \"%s\" geçiÅŸi geçerli bir öniÅŸlem dizgeciÄŸi vermez" + +#: cppmacro.c:514 +msgid "ISO C99 requires rest arguments to be used" +msgstr "ISO C kalan argümanların kullanılmış olmasını gerektirir" + +#: cppmacro.c:519 +#, c-format +msgid "macro \"%s\" requires %u arguments, but only %u given" +msgstr "makro \"%s\" %u argüman gerektiriyor ama sadece %u argüman verilmiÅŸ" + +#: cppmacro.c:524 +#, c-format +msgid "macro \"%s\" passed %u arguments, but takes just %u" +msgstr "makro \"%s\" için %u argüman verilmiÅŸ ama tam %u argüman alıyor" + +#: cppmacro.c:635 +#, c-format +msgid "unterminated argument list invoking macro \"%s\"" +msgstr "sonlandırılmamış argüman listesi çağıran makro \"%s\"" + +#: cppmacro.c:738 +#, c-format +msgid "function-like macro \"%s\" must be used with arguments in traditional C" +msgstr "" +"iÅŸlev benzeri makro \"%s\" geleneksel C'de argümanlarla kullanılmalıdır" + +#: cppmacro.c:1241 +#, c-format +msgid "duplicate macro parameter \"%s\"" +msgstr "yinelenmiÅŸ makro parametresi \"%s\"" + +#: cppmacro.c:1286 +#, c-format +msgid "\"%s\" may not appear in macro parameter list" +msgstr "\"%s\" makro parametre listesinde görünmeyebilir" + +#: cppmacro.c:1294 +msgid "macro parameters must be comma-separated" +msgstr "makro parametreleri virgüllerle ayrılmış olmalı" + +#: cppmacro.c:1311 +msgid "parameter name missing" +msgstr "parametre ismi eksik" + +#: cppmacro.c:1326 +msgid "anonymous variadic macros were introduced in C99" +msgstr "argümanlarının sayısı deÄŸiÅŸebilen anonim makrolar C99 da tanıtıldı" + +#: cppmacro.c:1330 +msgid "ISO C does not permit named variadic macros" +msgstr "ISO C argümanlarının sayısı deÄŸiÅŸebilen isimli makrolara izin vermez" + +#: cppmacro.c:1339 +msgid "missing ')' in macro parameter list" +msgstr "makro parametre listesinde ')' eksik" + +#: cppmacro.c:1402 +msgid "ISO C requires whitespace after the macro name" +msgstr "ISO C makro isminden sonra boÅŸluk gerektirir" + +#: cppmacro.c:1430 +msgid "'#' is not followed by a macro parameter" +msgstr "'#' iÅŸaretinden sonra bir makro parametresi yok" + +#: cppmacro.c:1449 +msgid "'##' cannot appear at either end of a macro expansion" +msgstr "'##' bir makronun her iki ucunda da görünemez" + +#: cppmacro.c:1588 +#, c-format +msgid "macro argument \"%s\" would be stringified in traditional C" +msgstr "makro argümanı \"%s\" geleneksel C'de dizgelenmiÅŸ olmalıydı" + +#: cppmacro.c:1611 +#, c-format +msgid "invalid hash type %d in cpp_macro_definition" +msgstr "cpp_macro_definition içindeki isimli yapı türü %d geçersiz" + +#: cpppch.c:84 cpppch.c:332 cpppch.c:356 cpppch.c:365 cpppch.c:371 +msgid "while writing precompiled header" +msgstr "" + +#: cpppch.c:469 +#, fuzzy, c-format +msgid "%s: not used because `%.*s' not defined" +msgstr "`%s' etiketi tanımsız kullanılmış" + +#: cpppch.c:481 +#, c-format +msgid "%s: not used because `%.*s' defined as `%s' not `%.*s'" +msgstr "" + +#: cpppch.c:522 +#, fuzzy, c-format +msgid "%s: not used because `%s' is defined" +msgstr "`%s' tanımlanmadan kullanılmış" + +#: cpppch.c:535 cpppch.c:724 +msgid "while reading precompiled header" +msgstr "" + +#: cppspec.c:106 +#, c-format +msgid "\"%s\" is not a valid option to the preprocessor" +msgstr "\"%s\" öniÅŸlemci için geçerli bir seçenek deÄŸil" + +#: cppspec.c:128 +msgid "too many input files" +msgstr "girdi dosyası sayısı çok fazla" + +#: cpptrad.c:744 +#, c-format +msgid "detected recursion whilst expanding macro \"%s\"" +msgstr "makro \"%s\" geniÅŸletilirken iç içelik saptandı" + +#: cpptrad.c:911 +#, fuzzy +msgid "syntax error in macro parameter list" +msgstr "parametre isim listesinde sözdizimi hatası" + +#: line-map.c:218 +#, c-format +msgid "In file included from %s:%u" +msgstr "" +"Sırayla bir altındaki dosyada içerilerek:\n" +"\t\t%s:%u" + +#. Translators note: this message is used in conjunction +#. with "In file included from %s:%ld" and some other +#. tricks. We want something like this: +#. +#. | In file included from sys/select.h:123, +#. | from sys/types.h:234, +#. | from userfile.c:31: +#. | bits/select.h:45: <error message here> +#. +#. with all the "from"s lined up. +#. The trailing comma is at the beginning of this message, +#. and the trailing colon is not translated. +#: line-map.c:236 +#, c-format +msgid "" +",\n" +" from %s:%u" +msgstr "" +",\n" +"\t\t%s:%u" + diff --git a/libcpp/symtab.c b/libcpp/symtab.c new file mode 100644 index 00000000000..39cecedf72f --- /dev/null +++ b/libcpp/symtab.c @@ -0,0 +1,310 @@ +/* Hash tables. + Copyright (C) 2000, 2001, 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + In other words, you are welcome to use, share and improve this program. + You are forbidden to forbid anyone else to use, share and improve + what you give them. Help stamp out software-hoarding! */ + +#include "config.h" +#include "system.h" +#include "symtab.h" + +/* The code below is a specialization of Vladimir Makarov's expandable + hash tables (see libiberty/hashtab.c). The abstraction penalty was + too high to continue using the generic form. This code knows + intrinsically how to calculate a hash value, and how to compare an + existing entry with a potential new one. Also, the ability to + delete members from the table has been removed. */ + +static unsigned int calc_hash (const unsigned char *, size_t); +static void ht_expand (hash_table *); +static double approx_sqrt (double); + +/* Calculate the hash of the string STR of length LEN. */ + +static unsigned int +calc_hash (const unsigned char *str, size_t len) +{ + size_t n = len; + unsigned int r = 0; +#define HASHSTEP(r, c) ((r) * 67 + ((c) - 113)); + + while (n--) + r = HASHSTEP (r, *str++); + + return r + len; +#undef HASHSTEP +} + +/* Initialize an identifier hashtable. */ + +hash_table * +ht_create (unsigned int order) +{ + unsigned int nslots = 1 << order; + hash_table *table; + + table = xcalloc (1, sizeof (hash_table)); + + /* Strings need no alignment. */ + _obstack_begin (&table->stack, 0, 0, + (void *(*) (long)) xmalloc, + (void (*) (void *)) free); + + obstack_alignment_mask (&table->stack) = 0; + + table->entries = xcalloc (nslots, sizeof (hashnode)); + table->nslots = nslots; + return table; +} + +/* Frees all memory associated with a hash table. */ + +void +ht_destroy (hash_table *table) +{ + obstack_free (&table->stack, NULL); + free (table->entries); + free (table); +} + +/* Returns the hash entry for the a STR of length LEN. If that string + already exists in the table, returns the existing entry, and, if + INSERT is CPP_ALLOCED, frees the last obstack object. If the + identifier hasn't been seen before, and INSERT is CPP_NO_INSERT, + returns NULL. Otherwise insert and returns a new entry. A new + string is alloced if INSERT is CPP_ALLOC, otherwise INSERT is + CPP_ALLOCED and the item is assumed to be at the top of the + obstack. */ +hashnode +ht_lookup (hash_table *table, const unsigned char *str, size_t len, + enum ht_lookup_option insert) +{ + unsigned int hash = calc_hash (str, len); + unsigned int hash2; + unsigned int index; + size_t sizemask; + hashnode node; + + sizemask = table->nslots - 1; + index = hash & sizemask; + table->searches++; + + node = table->entries[index]; + + if (node != NULL) + { + if (node->hash_value == hash + && HT_LEN (node) == (unsigned int) len + && !memcmp (HT_STR (node), str, len)) + { + if (insert == HT_ALLOCED) + /* The string we search for was placed at the end of the + obstack. Release it. */ + obstack_free (&table->stack, (void *) str); + return node; + } + + /* hash2 must be odd, so we're guaranteed to visit every possible + location in the table during rehashing. */ + hash2 = ((hash * 17) & sizemask) | 1; + + for (;;) + { + table->collisions++; + index = (index + hash2) & sizemask; + node = table->entries[index]; + if (node == NULL) + break; + + if (node->hash_value == hash + && HT_LEN (node) == (unsigned int) len + && !memcmp (HT_STR (node), str, len)) + { + if (insert == HT_ALLOCED) + /* The string we search for was placed at the end of the + obstack. Release it. */ + obstack_free (&table->stack, (void *) str); + return node; + } + } + } + + if (insert == HT_NO_INSERT) + return NULL; + + node = (*table->alloc_node) (table); + table->entries[index] = node; + + HT_LEN (node) = (unsigned int) len; + node->hash_value = hash; + if (insert == HT_ALLOC) + HT_STR (node) = obstack_copy0 (&table->stack, str, len); + else + HT_STR (node) = str; + + if (++table->nelements * 4 >= table->nslots * 3) + /* Must expand the string table. */ + ht_expand (table); + + return node; +} + +/* Double the size of a hash table, re-hashing existing entries. */ + +static void +ht_expand (hash_table *table) +{ + hashnode *nentries, *p, *limit; + unsigned int size, sizemask; + + size = table->nslots * 2; + nentries = xcalloc (size, sizeof (hashnode)); + sizemask = size - 1; + + p = table->entries; + limit = p + table->nslots; + do + if (*p) + { + unsigned int index, hash, hash2; + + hash = (*p)->hash_value; + index = hash & sizemask; + + if (nentries[index]) + { + hash2 = ((hash * 17) & sizemask) | 1; + do + { + index = (index + hash2) & sizemask; + } + while (nentries[index]); + } + nentries[index] = *p; + } + while (++p < limit); + + free (table->entries); + table->entries = nentries; + table->nslots = size; +} + +/* For all nodes in TABLE, callback CB with parameters TABLE->PFILE, + the node, and V. */ +void +ht_forall (hash_table *table, ht_cb cb, const void *v) +{ + hashnode *p, *limit; + + p = table->entries; + limit = p + table->nslots; + do + if (*p) + { + if ((*cb) (table->pfile, *p, v) == 0) + break; + } + while (++p < limit); +} + +/* Dump allocation statistics to stderr. */ + +void +ht_dump_statistics (hash_table *table) +{ + size_t nelts, nids, overhead, headers; + size_t total_bytes, longest, sum_of_squares; + double exp_len, exp_len2, exp2_len; + hashnode *p, *limit; + +#define SCALE(x) ((unsigned long) ((x) < 1024*10 \ + ? (x) \ + : ((x) < 1024*1024*10 \ + ? (x) / 1024 \ + : (x) / (1024*1024)))) +#define LABEL(x) ((x) < 1024*10 ? ' ' : ((x) < 1024*1024*10 ? 'k' : 'M')) + + total_bytes = longest = sum_of_squares = nids = 0; + p = table->entries; + limit = p + table->nslots; + do + if (*p) + { + size_t n = HT_LEN (*p); + + total_bytes += n; + sum_of_squares += n * n; + if (n > longest) + longest = n; + nids++; + } + while (++p < limit); + + nelts = table->nelements; + overhead = obstack_memory_used (&table->stack) - total_bytes; + headers = table->nslots * sizeof (hashnode); + + fprintf (stderr, "\nString pool\nentries\t\t%lu\n", + (unsigned long) nelts); + fprintf (stderr, "identifiers\t%lu (%.2f%%)\n", + (unsigned long) nids, nids * 100.0 / nelts); + fprintf (stderr, "slots\t\t%lu\n", + (unsigned long) table->nslots); + fprintf (stderr, "bytes\t\t%lu%c (%lu%c overhead)\n", + SCALE (total_bytes), LABEL (total_bytes), + SCALE (overhead), LABEL (overhead)); + fprintf (stderr, "table size\t%lu%c\n", + SCALE (headers), LABEL (headers)); + + exp_len = (double)total_bytes / (double)nelts; + exp2_len = exp_len * exp_len; + exp_len2 = (double) sum_of_squares / (double) nelts; + + fprintf (stderr, "coll/search\t%.4f\n", + (double) table->collisions / (double) table->searches); + fprintf (stderr, "ins/search\t%.4f\n", + (double) nelts / (double) table->searches); + fprintf (stderr, "avg. entry\t%.2f bytes (+/- %.2f)\n", + exp_len, approx_sqrt (exp_len2 - exp2_len)); + fprintf (stderr, "longest entry\t%lu\n", + (unsigned long) longest); +#undef SCALE +#undef LABEL +} + +/* Return the approximate positive square root of a number N. This is for + statistical reports, not code generation. */ +static double +approx_sqrt (double x) +{ + double s, d; + + if (x < 0) + abort (); + if (x == 0) + return 0; + + s = x; + do + { + d = (s * s - x) / (2 * s); + s -= d; + } + while (d > .0001); + return s; +} diff --git a/libcpp/system.h b/libcpp/system.h new file mode 100644 index 00000000000..c43259575a8 --- /dev/null +++ b/libcpp/system.h @@ -0,0 +1,363 @@ +/* Get common system includes and various definitions and declarations based + on autoconf macros. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Free Software Foundation, Inc. + +This file is part of libcpp (aka cpplib). + +GCC 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. + +GCC 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 GCC; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ + + +#ifndef LIBCPP_SYSTEM_H +#define LIBCPP_SYSTEM_H + +/* We must include stdarg.h before stdio.h. */ +#include <stdarg.h> + +#ifdef HAVE_STDDEF_H +# include <stddef.h> +#endif + +#include <stdio.h> + +/* Define a generic NULL if one hasn't already been defined. */ +#ifndef NULL +#define NULL 0 +#endif + +/* The compiler is not a multi-threaded application and therefore we + do not have to use the locking functions. In fact, using the locking + functions can cause the compiler to be significantly slower under + I/O bound conditions (such as -g -O0 on very large source files). + + HAVE_DECL_PUTC_UNLOCKED actually indicates whether or not the stdio + code is multi-thread safe by default. If it is set to 0, then do + not worry about using the _unlocked functions. + + fputs_unlocked, fwrite_unlocked, and fprintf_unlocked are + extensions and need to be prototyped by hand (since we do not + define _GNU_SOURCE). */ + +#if defined HAVE_DECL_PUTC_UNLOCKED && HAVE_DECL_PUTC_UNLOCKED + +# ifdef HAVE_PUTC_UNLOCKED +# undef putc +# define putc(C, Stream) putc_unlocked (C, Stream) +# endif +# ifdef HAVE_FPUTC_UNLOCKED +# undef fputc +# define fputc(C, Stream) fputc_unlocked (C, Stream) +# endif + +# ifdef HAVE_FPUTS_UNLOCKED +# undef fputs +# define fputs(String, Stream) fputs_unlocked (String, Stream) +# if defined (HAVE_DECL_FPUTS_UNLOCKED) && !HAVE_DECL_FPUTS_UNLOCKED +extern int fputs_unlocked (const char *, FILE *); +# endif +# endif +# ifdef HAVE_FWRITE_UNLOCKED +# undef fwrite +# define fwrite(Ptr, Size, N, Stream) fwrite_unlocked (Ptr, Size, N, Stream) +# if defined (HAVE_DECL_FWRITE_UNLOCKED) && !HAVE_DECL_FWRITE_UNLOCKED +extern int fwrite_unlocked (const void *, size_t, size_t, FILE *); +# endif +# endif +# ifdef HAVE_FPRINTF_UNLOCKED +# undef fprintf +/* We can't use a function-like macro here because we don't know if + we have varargs macros. */ +# define fprintf fprintf_unlocked +# if defined (HAVE_DECL_FPRINTF_UNLOCKED) && !HAVE_DECL_FPRINTF_UNLOCKED +extern int fprintf_unlocked (FILE *, const char *, ...); +# endif +# endif + +#endif + +/* ??? Glibc's fwrite/fread_unlocked macros cause + "warning: signed and unsigned type in conditional expression". */ +#undef fread_unlocked +#undef fwrite_unlocked + +#include <sys/types.h> +#include <errno.h> + +#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO +extern int errno; +#endif + +/* Some of glibc's string inlines cause warnings. Plus we'd rather + rely on (and therefore test) GCC's string builtins. */ +#define __NO_STRING_INLINES + +#ifdef STRING_WITH_STRINGS +# include <string.h> +# include <strings.h> +#else +# ifdef HAVE_STRING_H +# include <string.h> +# else +# ifdef HAVE_STRINGS_H +# include <strings.h> +# endif +# endif +#endif + +#ifdef HAVE_STDLIB_H +# include <stdlib.h> +#endif + +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif + +#if HAVE_LIMITS_H +# include <limits.h> +#endif + +/* Infrastructure for defining missing _MAX and _MIN macros. Note that + macros defined with these cannot be used in #if. */ + +/* The extra casts work around common compiler bugs. */ +#define INTTYPE_SIGNED(t) (! ((t) 0 < (t) -1)) +/* The outer cast is needed to work around a bug in Cray C 5.0.3.0. + It is necessary at least when t == time_t. */ +#define INTTYPE_MINIMUM(t) ((t) (INTTYPE_SIGNED (t) \ + ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0)) +#define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t))) + +/* Use that infrastructure to provide a few constants. */ +#ifndef UCHAR_MAX +# define UCHAR_MAX INTTYPE_MAXIMUM (unsigned char) +#endif + +#ifdef TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# ifdef HAVE_TIME_H +# include <time.h> +# endif +# endif +#endif + +#ifdef HAVE_FCNTL_H +# include <fcntl.h> +#else +# ifdef HAVE_SYS_FILE_H +# include <sys/file.h> +# endif +#endif + +#ifdef HAVE_LOCALE_H +# include <locale.h> +#endif + +#ifdef HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif + +#ifndef HAVE_SETLOCALE +# define setlocale(category, locale) (locale) +#endif + +#ifdef ENABLE_NLS +#include <libintl.h> +#else +/* Stubs. */ +# undef dgettext +# define dgettext(msgid) (msgid) +#endif + +#ifndef _ +# define _(msgid) dgettext (PACKAGE, msgid) +#endif + +#ifndef N_ +# define N_(msgid) msgid +#endif + +/* Some systems define these in, e.g., param.h. We undefine these names + here to avoid the warnings. We prefer to use our definitions since we + know they are correct. */ + +#undef MIN +#undef MAX +#define MIN(X,Y) ((X) < (Y) ? (X) : (Y)) +#define MAX(X,Y) ((X) > (Y) ? (X) : (Y)) + +/* The HAVE_DECL_* macros are three-state, undefined, 0 or 1. If they + are defined to 0 then we must provide the relevant declaration + here. These checks will be in the undefined state while configure + is running so be careful to test "defined (HAVE_DECL_*)". */ + +#if defined (HAVE_DECL_ABORT) && !HAVE_DECL_ABORT +extern void abort (void); +#endif + +#if HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif + +/* Test if something is a normal file. */ +#ifndef S_ISREG +#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +#endif + +/* Test if something is a directory. */ +#ifndef S_ISDIR +#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +#endif + +/* Test if something is a character special file. */ +#ifndef S_ISCHR +#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) +#endif + +/* Test if something is a block special file. */ +#ifndef S_ISBLK +#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) +#endif + +/* Test if something is a socket. */ +#ifndef S_ISSOCK +# ifdef S_IFSOCK +# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) +# else +# define S_ISSOCK(m) 0 +# endif +#endif + +/* Test if something is a FIFO. */ +#ifndef S_ISFIFO +# ifdef S_IFIFO +# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) +# else +# define S_ISFIFO(m) 0 +# endif +#endif + +/* Approximate O_NOCTTY and O_BINARY. */ +#ifndef O_NOCTTY +#define O_NOCTTY 0 +#endif +#ifndef O_BINARY +# define O_BINARY 0 +#endif + +/* Filename handling macros. */ +#include "filenames.h" + +/* Get libiberty declarations. */ +#include "libiberty.h" +#include "safe-ctype.h" + +/* 1 if we have C99 designated initializers. */ +#if !defined(HAVE_DESIGNATED_INITIALIZERS) +#define HAVE_DESIGNATED_INITIALIZERS \ + ((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L)) +#endif + +/* 1 if we have _Bool. */ +#ifndef HAVE__BOOL +# define HAVE__BOOL \ + ((GCC_VERSION >= 3000) || (__STDC_VERSION__ >= 199901L)) +#endif + + +/* Be conservative and only use enum bitfields with GCC. + FIXME: provide a complete autoconf test for buggy enum bitfields. */ + +#if (GCC_VERSION > 2000) +#define ENUM_BITFIELD(TYPE) __extension__ enum TYPE +#else +#define ENUM_BITFIELD(TYPE) unsigned int +#endif + +/* We only use bool bitfields with gcc3. Some supposedly C99 + compilers don't handle them correctly. */ +#if (GCC_VERSION >= 3000) +#define BOOL_BITFIELD _Bool +#else +#define BOOL_BITFIELD unsigned int +#endif + +#ifndef offsetof +#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *) 0)->MEMBER) +#endif + +/* __builtin_expect(A, B) evaluates to A, but notifies the compiler that + the most likely value of A is B. This feature was added at some point + between 2.95 and 3.0. Let's use 3.0 as the lower bound for now. */ +#if (GCC_VERSION < 3000) +#define __builtin_expect(a, b) (a) +#endif + +/* Provide some sort of boolean type. We use stdbool.h if it's + available. This must be after all inclusion of system headers, + as some of them will mess us up. */ +#undef bool +#undef true +#undef false +#undef TRUE +#undef FALSE + +#ifdef HAVE_STDBOOL_H +# include <stdbool.h> +#else +# if !HAVE__BOOL +typedef char _Bool; +# endif +# define bool _Bool +# define true 1 +# define false 0 +#endif + +#if (GCC_VERSION >= 3000) +#undef calloc +#undef strdup +#undef malloc +#undef realloc + #pragma GCC poison calloc strdup + #pragma GCC poison malloc realloc + +/* Libiberty macros that are no longer used in GCC. */ +#undef ANSI_PROTOTYPES +#undef PTR_CONST +#undef LONG_DOUBLE +#undef VPARAMS +#undef VA_OPEN +#undef VA_FIXEDARG +#undef VA_CLOSE +#undef VA_START + #pragma GCC poison ANSI_PROTOTYPES PTR_CONST LONG_DOUBLE VPARAMS VA_OPEN \ + VA_FIXEDARG VA_CLOSE VA_START + +/* Note: not all uses of the `index' token (e.g. variable names and + structure members) have been eliminated. */ +#undef bcopy +#undef bzero +#undef bcmp +#undef rindex + #pragma GCC poison bcopy bzero bcmp rindex + +#endif /* GCC >= 3.0 */ + +#endif /* ! LIBCPP_SYSTEM_H */ diff --git a/libcpp/traditional.c b/libcpp/traditional.c new file mode 100644 index 00000000000..f4ce9f66e47 --- /dev/null +++ b/libcpp/traditional.c @@ -0,0 +1,1110 @@ +/* CPP Library - traditional lexical analysis and macro expansion. + Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Contributed by Neil Booth, May 2002 + +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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "config.h" +#include "system.h" +#include "cpplib.h" +#include "internal.h" + +/* The replacement text of a function-like macro is stored as a + contiguous sequence of aligned blocks, each representing the text + between subsequent parameters. + + Each block comprises the text between its surrounding parameters, + the length of that text, and the one-based index of the following + parameter. The final block in the replacement text is easily + recognizable as it has an argument index of zero. */ + +struct block +{ + unsigned int text_len; + unsigned short arg_index; + uchar text[1]; +}; + +#define BLOCK_HEADER_LEN offsetof (struct block, text) +#define BLOCK_LEN(TEXT_LEN) CPP_ALIGN (BLOCK_HEADER_LEN + (TEXT_LEN)) + +/* Structure holding information about a function-like macro + invocation. */ +struct fun_macro +{ + /* Memory buffer holding the trad_arg array. */ + _cpp_buff *buff; + + /* An array of size the number of macro parameters + 1, containing + the offsets of the start of each macro argument in the output + buffer. The argument continues until the character before the + start of the next one. */ + size_t *args; + + /* The hashnode of the macro. */ + cpp_hashnode *node; + + /* The offset of the macro name in the output buffer. */ + size_t offset; + + /* The line the macro name appeared on. */ + unsigned int line; + + /* Zero-based index of argument being currently lexed. */ + unsigned int argc; +}; + +/* Lexing state. It is mostly used to prevent macro expansion. */ +enum ls {ls_none = 0, /* Normal state. */ + ls_fun_open, /* When looking for '('. */ + ls_fun_close, /* When looking for ')'. */ + ls_defined, /* After defined. */ + ls_defined_close, /* Looking for ')' of defined(). */ + ls_hash, /* After # in preprocessor conditional. */ + ls_predicate, /* After the predicate, maybe paren? */ + ls_answer}; /* In answer to predicate. */ + +/* Lexing TODO: Maybe handle space in escaped newlines. Stop cpplex.c + from recognizing comments and directives during its lexing pass. */ + +static const uchar *skip_whitespace (cpp_reader *, const uchar *, int); +static cpp_hashnode *lex_identifier (cpp_reader *, const uchar *); +static const uchar *copy_comment (cpp_reader *, const uchar *, int); +static void check_output_buffer (cpp_reader *, size_t); +static void push_replacement_text (cpp_reader *, cpp_hashnode *); +static bool scan_parameters (cpp_reader *, cpp_macro *); +static bool recursive_macro (cpp_reader *, cpp_hashnode *); +static void save_replacement_text (cpp_reader *, cpp_macro *, unsigned int); +static void maybe_start_funlike (cpp_reader *, cpp_hashnode *, const uchar *, + struct fun_macro *); +static void save_argument (struct fun_macro *, size_t); +static void replace_args_and_push (cpp_reader *, struct fun_macro *); +static size_t canonicalize_text (uchar *, const uchar *, size_t, uchar *); + +/* Ensures we have N bytes' space in the output buffer, and + reallocates it if not. */ +static void +check_output_buffer (cpp_reader *pfile, size_t n) +{ + /* We might need two bytes to terminate an unterminated comment, and + one more to terminate the line with a NUL. */ + n += 2 + 1; + + if (n > (size_t) (pfile->out.limit - pfile->out.cur)) + { + size_t size = pfile->out.cur - pfile->out.base; + size_t new_size = (size + n) * 3 / 2; + + pfile->out.base = xrealloc (pfile->out.base, new_size); + pfile->out.limit = pfile->out.base + new_size; + pfile->out.cur = pfile->out.base + size; + } +} + +/* Skip a C-style block comment in a macro as a result of -CC. + Buffer->cur points to the initial asterisk of the comment. */ +static void +skip_macro_block_comment (cpp_reader *pfile) +{ + const uchar *cur = pfile->buffer->cur; + + cur++; + if (*cur == '/') + cur++; + + /* People like decorating comments with '*', so check for '/' + instead for efficiency. */ + while(! (*cur++ == '/' && cur[-2] == '*') ) + ; + + pfile->buffer->cur = cur; +} + +/* CUR points to the asterisk introducing a comment in the current + context. IN_DEFINE is true if we are in the replacement text of a + macro. + + The asterisk and following comment is copied to the buffer pointed + to by pfile->out.cur, which must be of sufficient size. + Unterminated comments are diagnosed, and correctly terminated in + the output. pfile->out.cur is updated depending upon IN_DEFINE, + -C, -CC and pfile->state.in_directive. + + Returns a pointer to the first character after the comment in the + input buffer. */ +static const uchar * +copy_comment (cpp_reader *pfile, const uchar *cur, int in_define) +{ + bool unterminated, copy = false; + source_location src_loc = pfile->line_table->highest_line; + cpp_buffer *buffer = pfile->buffer; + + buffer->cur = cur; + if (pfile->context->prev) + unterminated = false, skip_macro_block_comment (pfile); + else + unterminated = _cpp_skip_block_comment (pfile); + + if (unterminated) + cpp_error_with_line (pfile, CPP_DL_ERROR, src_loc, 0, + "unterminated comment"); + + /* Comments in directives become spaces so that tokens are properly + separated when the ISO preprocessor re-lexes the line. The + exception is #define. */ + if (pfile->state.in_directive) + { + if (in_define) + { + if (CPP_OPTION (pfile, discard_comments_in_macro_exp)) + pfile->out.cur--; + else + copy = true; + } + else + pfile->out.cur[-1] = ' '; + } + else if (CPP_OPTION (pfile, discard_comments)) + pfile->out.cur--; + else + copy = true; + + if (copy) + { + size_t len = (size_t) (buffer->cur - cur); + memcpy (pfile->out.cur, cur, len); + pfile->out.cur += len; + if (unterminated) + { + *pfile->out.cur++ = '*'; + *pfile->out.cur++ = '/'; + } + } + + return buffer->cur; +} + +/* CUR points to any character in the input buffer. Skips over all + contiguous horizontal white space and NULs, including comments if + SKIP_COMMENTS, until reaching the first non-horizontal-whitespace + character or the end of the current context. Escaped newlines are + removed. + + The whitespace is copied verbatim to the output buffer, except that + comments are handled as described in copy_comment(). + pfile->out.cur is updated. + + Returns a pointer to the first character after the whitespace in + the input buffer. */ +static const uchar * +skip_whitespace (cpp_reader *pfile, const uchar *cur, int skip_comments) +{ + uchar *out = pfile->out.cur; + + for (;;) + { + unsigned int c = *cur++; + *out++ = c; + + if (is_nvspace (c)) + continue; + + if (c == '/' && *cur == '*' && skip_comments) + { + pfile->out.cur = out; + cur = copy_comment (pfile, cur, false /* in_define */); + out = pfile->out.cur; + continue; + } + + out--; + break; + } + + pfile->out.cur = out; + return cur - 1; +} + +/* Lexes and outputs an identifier starting at CUR, which is assumed + to point to a valid first character of an identifier. Returns + the hashnode, and updates out.cur. */ +static cpp_hashnode * +lex_identifier (cpp_reader *pfile, const uchar *cur) +{ + size_t len; + uchar *out = pfile->out.cur; + cpp_hashnode *result; + + do + *out++ = *cur++; + while (is_numchar (*cur)); + + CUR (pfile->context) = cur; + len = out - pfile->out.cur; + result = (cpp_hashnode *) ht_lookup (pfile->hash_table, pfile->out.cur, + len, HT_ALLOC); + pfile->out.cur = out; + return result; +} + +/* Overlays the true file buffer temporarily with text of length LEN + starting at START. The true buffer is restored upon calling + restore_buff(). */ +void +_cpp_overlay_buffer (cpp_reader *pfile, const uchar *start, size_t len) +{ + cpp_buffer *buffer = pfile->buffer; + + pfile->overlaid_buffer = buffer; + pfile->saved_cur = buffer->cur; + pfile->saved_rlimit = buffer->rlimit; + pfile->saved_line_base = buffer->next_line; + buffer->need_line = false; + + buffer->cur = start; + buffer->line_base = start; + buffer->rlimit = start + len; +} + +/* Restores a buffer overlaid by _cpp_overlay_buffer(). */ +void +_cpp_remove_overlay (cpp_reader *pfile) +{ + cpp_buffer *buffer = pfile->overlaid_buffer; + + buffer->cur = pfile->saved_cur; + buffer->rlimit = pfile->saved_rlimit; + buffer->line_base = pfile->saved_line_base; + buffer->need_line = true; + + pfile->overlaid_buffer = NULL; +} + +/* Reads a logical line into the output buffer. Returns TRUE if there + is more text left in the buffer. */ +bool +_cpp_read_logical_line_trad (cpp_reader *pfile) +{ + do + { + if (pfile->buffer->need_line && !_cpp_get_fresh_line (pfile)) + return false; + } + while (!_cpp_scan_out_logical_line (pfile, NULL) || pfile->state.skipping); + + return pfile->buffer != NULL; +} + +/* Set up state for finding the opening '(' of a function-like + macro. */ +static void +maybe_start_funlike (cpp_reader *pfile, cpp_hashnode *node, const uchar *start, struct fun_macro *macro) +{ + unsigned int n = node->value.macro->paramc + 1; + + if (macro->buff) + _cpp_release_buff (pfile, macro->buff); + macro->buff = _cpp_get_buff (pfile, n * sizeof (size_t)); + macro->args = (size_t *) BUFF_FRONT (macro->buff); + macro->node = node; + macro->offset = start - pfile->out.base; + macro->argc = 0; +} + +/* Save the OFFSET of the start of the next argument to MACRO. */ +static void +save_argument (struct fun_macro *macro, size_t offset) +{ + macro->argc++; + if (macro->argc <= macro->node->value.macro->paramc) + macro->args[macro->argc] = offset; +} + +/* Copies the next logical line in the current buffer (starting at + buffer->cur) to the output buffer. The output is guaranteed to + terminate with a NUL character. buffer->cur is updated. + + If MACRO is non-NULL, then we are scanning the replacement list of + MACRO, and we call save_replacement_text() every time we meet an + argument. */ +bool +_cpp_scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro) +{ + bool result = true; + cpp_context *context; + const uchar *cur; + uchar *out; + struct fun_macro fmacro; + unsigned int c, paren_depth = 0, quote; + enum ls lex_state = ls_none; + bool header_ok; + const uchar *start_of_input_line; + + fmacro.buff = NULL; + + quote = 0; + header_ok = pfile->state.angled_headers; + CUR (pfile->context) = pfile->buffer->cur; + RLIMIT (pfile->context) = pfile->buffer->rlimit; + pfile->out.cur = pfile->out.base; + pfile->out.first_line = pfile->line_table->highest_line; + /* start_of_input_line is needed to make sure that directives really, + really start at the first character of the line. */ + start_of_input_line = pfile->buffer->cur; + new_context: + context = pfile->context; + cur = CUR (context); + check_output_buffer (pfile, RLIMIT (context) - cur); + out = pfile->out.cur; + + for (;;) + { + if (!context->prev + && cur >= pfile->buffer->notes[pfile->buffer->cur_note].pos) + { + pfile->buffer->cur = cur; + _cpp_process_line_notes (pfile, false); + } + c = *cur++; + *out++ = c; + + /* Whitespace should "continue" out of the switch, + non-whitespace should "break" out of it. */ + switch (c) + { + case ' ': + case '\t': + case '\f': + case '\v': + case '\0': + continue; + + case '\n': + /* If this is a macro's expansion, pop it. */ + if (context->prev) + { + pfile->out.cur = out - 1; + _cpp_pop_context (pfile); + goto new_context; + } + + /* Omit the newline from the output buffer. */ + pfile->out.cur = out - 1; + pfile->buffer->cur = cur; + pfile->buffer->need_line = true; + CPP_INCREMENT_LINE (pfile, 0); + + if ((lex_state == ls_fun_open || lex_state == ls_fun_close) + && !pfile->state.in_directive + && _cpp_get_fresh_line (pfile)) + { + /* Newlines in arguments become a space, but we don't + clear any in-progress quote. */ + if (lex_state == ls_fun_close) + out[-1] = ' '; + cur = pfile->buffer->cur; + continue; + } + goto done; + + case '<': + if (header_ok) + quote = '>'; + break; + case '>': + if (c == quote) + quote = 0; + break; + + case '"': + case '\'': + if (c == quote) + quote = 0; + else if (!quote) + quote = c; + break; + + case '\\': + /* Skip escaped quotes here, it's easier than above. */ + if (*cur == '\\' || *cur == '"' || *cur == '\'') + *out++ = *cur++; + break; + + case '/': + /* Traditional CPP does not recognize comments within + literals. */ + if (!quote && *cur == '*') + { + pfile->out.cur = out; + cur = copy_comment (pfile, cur, macro != 0); + out = pfile->out.cur; + continue; + } + break; + + case '_': + case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': + case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': + case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': + case 's': case 't': case 'u': case 'v': case 'w': case 'x': + case 'y': case 'z': + case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': + case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': + case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': + case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': + case 'Y': case 'Z': + if (!pfile->state.skipping && (quote == 0 || macro)) + { + cpp_hashnode *node; + uchar *out_start = out - 1; + + pfile->out.cur = out_start; + node = lex_identifier (pfile, cur - 1); + out = pfile->out.cur; + cur = CUR (context); + + if (node->type == NT_MACRO + /* Should we expand for ls_answer? */ + && (lex_state == ls_none || lex_state == ls_fun_open) + && !pfile->state.prevent_expansion) + { + /* Macros invalidate MI optimization. */ + pfile->mi_valid = false; + if (! (node->flags & NODE_BUILTIN) + && node->value.macro->fun_like) + { + maybe_start_funlike (pfile, node, out_start, &fmacro); + lex_state = ls_fun_open; + fmacro.line = pfile->line_table->highest_line; + continue; + } + else if (!recursive_macro (pfile, node)) + { + /* Remove the object-like macro's name from the + output, and push its replacement text. */ + pfile->out.cur = out_start; + push_replacement_text (pfile, node); + lex_state = ls_none; + goto new_context; + } + } + else if (macro && (node->flags & NODE_MACRO_ARG) != 0) + { + /* Found a parameter in the replacement text of a + #define. Remove its name from the output. */ + pfile->out.cur = out_start; + save_replacement_text (pfile, macro, node->value.arg_index); + out = pfile->out.base; + } + else if (lex_state == ls_hash) + { + lex_state = ls_predicate; + continue; + } + else if (pfile->state.in_expression + && node == pfile->spec_nodes.n_defined) + { + lex_state = ls_defined; + continue; + } + } + break; + + case '(': + if (quote == 0) + { + paren_depth++; + if (lex_state == ls_fun_open) + { + if (recursive_macro (pfile, fmacro.node)) + lex_state = ls_none; + else + { + lex_state = ls_fun_close; + paren_depth = 1; + out = pfile->out.base + fmacro.offset; + fmacro.args[0] = fmacro.offset; + } + } + else if (lex_state == ls_predicate) + lex_state = ls_answer; + else if (lex_state == ls_defined) + lex_state = ls_defined_close; + } + break; + + case ',': + if (quote == 0 && lex_state == ls_fun_close && paren_depth == 1) + save_argument (&fmacro, out - pfile->out.base); + break; + + case ')': + if (quote == 0) + { + paren_depth--; + if (lex_state == ls_fun_close && paren_depth == 0) + { + cpp_macro *m = fmacro.node->value.macro; + + m->used = 1; + lex_state = ls_none; + save_argument (&fmacro, out - pfile->out.base); + + /* A single zero-length argument is no argument. */ + if (fmacro.argc == 1 + && m->paramc == 0 + && out == pfile->out.base + fmacro.offset + 1) + fmacro.argc = 0; + + if (_cpp_arguments_ok (pfile, m, fmacro.node, fmacro.argc)) + { + /* Remove the macro's invocation from the + output, and push its replacement text. */ + pfile->out.cur = (pfile->out.base + + fmacro.offset); + CUR (context) = cur; + replace_args_and_push (pfile, &fmacro); + goto new_context; + } + } + else if (lex_state == ls_answer || lex_state == ls_defined_close) + lex_state = ls_none; + } + break; + + case '#': + if (cur - 1 == start_of_input_line + /* A '#' from a macro doesn't start a directive. */ + && !pfile->context->prev + && !pfile->state.in_directive) + { + /* A directive. With the way _cpp_handle_directive + currently works, we only want to call it if either we + know the directive is OK, or we want it to fail and + be removed from the output. If we want it to be + passed through (the assembler case) then we must not + call _cpp_handle_directive. */ + pfile->out.cur = out; + cur = skip_whitespace (pfile, cur, true /* skip_comments */); + out = pfile->out.cur; + + if (*cur == '\n') + { + /* Null directive. Ignore it and don't invalidate + the MI optimization. */ + pfile->buffer->need_line = true; + CPP_INCREMENT_LINE (pfile, 0); + result = false; + goto done; + } + else + { + bool do_it = false; + + if (is_numstart (*cur) + && CPP_OPTION (pfile, lang) != CLK_ASM) + do_it = true; + else if (is_idstart (*cur)) + /* Check whether we know this directive, but don't + advance. */ + do_it = lex_identifier (pfile, cur)->is_directive; + + if (do_it || CPP_OPTION (pfile, lang) != CLK_ASM) + { + /* This is a kludge. We want to have the ISO + preprocessor lex the next token. */ + pfile->buffer->cur = cur; + _cpp_handle_directive (pfile, false /* indented */); + result = false; + goto done; + } + } + } + + if (pfile->state.in_expression) + { + lex_state = ls_hash; + continue; + } + break; + + default: + break; + } + + /* Non-whitespace disables MI optimization and stops treating + '<' as a quote in #include. */ + header_ok = false; + if (!pfile->state.in_directive) + pfile->mi_valid = false; + + if (lex_state == ls_none) + continue; + + /* Some of these transitions of state are syntax errors. The + ISO preprocessor will issue errors later. */ + if (lex_state == ls_fun_open) + /* Missing '('. */ + lex_state = ls_none; + else if (lex_state == ls_hash + || lex_state == ls_predicate + || lex_state == ls_defined) + lex_state = ls_none; + + /* ls_answer and ls_defined_close keep going until ')'. */ + } + + done: + if (fmacro.buff) + _cpp_release_buff (pfile, fmacro.buff); + + if (lex_state == ls_fun_close) + cpp_error_with_line (pfile, CPP_DL_ERROR, fmacro.line, 0, + "unterminated argument list invoking macro \"%s\"", + NODE_NAME (fmacro.node)); + return result; +} + +/* Push a context holding the replacement text of the macro NODE on + the context stack. NODE is either object-like, or a function-like + macro with no arguments. */ +static void +push_replacement_text (cpp_reader *pfile, cpp_hashnode *node) +{ + size_t len; + const uchar *text; + uchar *buf; + + if (node->flags & NODE_BUILTIN) + { + text = _cpp_builtin_macro_text (pfile, node); + len = ustrlen (text); + buf = _cpp_unaligned_alloc (pfile, len + 1); + memcpy (buf, text, len); + buf[len]='\n'; + text = buf; + } + else + { + cpp_macro *macro = node->value.macro; + macro->used = 1; + text = macro->exp.text; + len = macro->count; + } + + _cpp_push_text_context (pfile, node, text, len); +} + +/* Returns TRUE if traditional macro recursion is detected. */ +static bool +recursive_macro (cpp_reader *pfile, cpp_hashnode *node) +{ + bool recursing = !!(node->flags & NODE_DISABLED); + + /* Object-like macros that are already expanding are necessarily + recursive. + + However, it is possible to have traditional function-like macros + that are not infinitely recursive but recurse to any given depth. + Further, it is easy to construct examples that get ever longer + until the point they stop recursing. So there is no easy way to + detect true recursion; instead we assume any expansion more than + 20 deep since the first invocation of this macro must be + recursing. */ + if (recursing && node->value.macro->fun_like) + { + size_t depth = 0; + cpp_context *context = pfile->context; + + do + { + depth++; + if (context->macro == node && depth > 20) + break; + context = context->prev; + } + while (context); + recursing = context != NULL; + } + + if (recursing) + cpp_error (pfile, CPP_DL_ERROR, + "detected recursion whilst expanding macro \"%s\"", + NODE_NAME (node)); + + return recursing; +} + +/* Return the length of the replacement text of a function-like or + object-like non-builtin macro. */ +size_t +_cpp_replacement_text_len (const cpp_macro *macro) +{ + size_t len; + + if (macro->fun_like && (macro->paramc != 0)) + { + const uchar *exp; + + len = 0; + for (exp = macro->exp.text;;) + { + struct block *b = (struct block *) exp; + + len += b->text_len; + if (b->arg_index == 0) + break; + len += NODE_LEN (macro->params[b->arg_index - 1]); + exp += BLOCK_LEN (b->text_len); + } + } + else + len = macro->count; + + return len; +} + +/* Copy the replacement text of MACRO to DEST, which must be of + sufficient size. It is not NUL-terminated. The next character is + returned. */ +uchar * +_cpp_copy_replacement_text (const cpp_macro *macro, uchar *dest) +{ + if (macro->fun_like && (macro->paramc != 0)) + { + const uchar *exp; + + for (exp = macro->exp.text;;) + { + struct block *b = (struct block *) exp; + cpp_hashnode *param; + + memcpy (dest, b->text, b->text_len); + dest += b->text_len; + if (b->arg_index == 0) + break; + param = macro->params[b->arg_index - 1]; + memcpy (dest, NODE_NAME (param), NODE_LEN (param)); + dest += NODE_LEN (param); + exp += BLOCK_LEN (b->text_len); + } + } + else + { + memcpy (dest, macro->exp.text, macro->count); + dest += macro->count; + } + + return dest; +} + +/* Push a context holding the replacement text of the macro NODE on + the context stack. NODE is either object-like, or a function-like + macro with no arguments. */ +static void +replace_args_and_push (cpp_reader *pfile, struct fun_macro *fmacro) +{ + cpp_macro *macro = fmacro->node->value.macro; + + if (macro->paramc == 0) + push_replacement_text (pfile, fmacro->node); + else + { + const uchar *exp; + uchar *p; + _cpp_buff *buff; + size_t len = 0; + + /* Calculate the length of the argument-replaced text. */ + for (exp = macro->exp.text;;) + { + struct block *b = (struct block *) exp; + + len += b->text_len; + if (b->arg_index == 0) + break; + len += (fmacro->args[b->arg_index] + - fmacro->args[b->arg_index - 1] - 1); + exp += BLOCK_LEN (b->text_len); + } + + /* Allocate room for the expansion plus \n. */ + buff = _cpp_get_buff (pfile, len + 1); + + /* Copy the expansion and replace arguments. */ + p = BUFF_FRONT (buff); + for (exp = macro->exp.text;;) + { + struct block *b = (struct block *) exp; + size_t arglen; + + memcpy (p, b->text, b->text_len); + p += b->text_len; + if (b->arg_index == 0) + break; + arglen = (fmacro->args[b->arg_index] + - fmacro->args[b->arg_index - 1] - 1); + memcpy (p, pfile->out.base + fmacro->args[b->arg_index - 1], + arglen); + p += arglen; + exp += BLOCK_LEN (b->text_len); + } + + /* \n-terminate. */ + *p = '\n'; + _cpp_push_text_context (pfile, fmacro->node, BUFF_FRONT (buff), len); + + /* So we free buffer allocation when macro is left. */ + pfile->context->buff = buff; + } +} + +/* Read and record the parameters, if any, of a function-like macro + definition. Destroys pfile->out.cur. + + Returns true on success, false on failure (syntax error or a + duplicate parameter). On success, CUR (pfile->context) is just + past the closing parenthesis. */ +static bool +scan_parameters (cpp_reader *pfile, cpp_macro *macro) +{ + const uchar *cur = CUR (pfile->context) + 1; + bool ok; + + for (;;) + { + cur = skip_whitespace (pfile, cur, true /* skip_comments */); + + if (is_idstart (*cur)) + { + ok = false; + if (_cpp_save_parameter (pfile, macro, lex_identifier (pfile, cur))) + break; + cur = skip_whitespace (pfile, CUR (pfile->context), + true /* skip_comments */); + if (*cur == ',') + { + cur++; + continue; + } + ok = (*cur == ')'); + break; + } + + ok = (*cur == ')' && macro->paramc == 0); + break; + } + + if (!ok) + cpp_error (pfile, CPP_DL_ERROR, "syntax error in macro parameter list"); + + CUR (pfile->context) = cur + (*cur == ')'); + + return ok; +} + +/* Save the text from pfile->out.base to pfile->out.cur as + the replacement text for the current macro, followed by argument + ARG_INDEX, with zero indicating the end of the replacement + text. */ +static void +save_replacement_text (cpp_reader *pfile, cpp_macro *macro, + unsigned int arg_index) +{ + size_t len = pfile->out.cur - pfile->out.base; + uchar *exp; + + if (macro->paramc == 0) + { + /* Object-like and function-like macros without parameters + simply store their \n-terminated replacement text. */ + exp = _cpp_unaligned_alloc (pfile, len + 1); + memcpy (exp, pfile->out.base, len); + exp[len] = '\n'; + macro->exp.text = exp; + macro->count = len; + } + else + { + /* Store the text's length (unsigned int), the argument index + (unsigned short, base 1) and then the text. */ + size_t blen = BLOCK_LEN (len); + struct block *block; + + if (macro->count + blen > BUFF_ROOM (pfile->a_buff)) + _cpp_extend_buff (pfile, &pfile->a_buff, macro->count + blen); + + exp = BUFF_FRONT (pfile->a_buff); + block = (struct block *) (exp + macro->count); + macro->exp.text = exp; + + /* Write out the block information. */ + block->text_len = len; + block->arg_index = arg_index; + memcpy (block->text, pfile->out.base, len); + + /* Lex the rest into the start of the output buffer. */ + pfile->out.cur = pfile->out.base; + + macro->count += blen; + + /* If we've finished, commit the memory. */ + if (arg_index == 0) + BUFF_FRONT (pfile->a_buff) += macro->count; + } +} + +/* Analyze and save the replacement text of a macro. Returns true on + success. */ +bool +_cpp_create_trad_definition (cpp_reader *pfile, cpp_macro *macro) +{ + const uchar *cur; + uchar *limit; + cpp_context *context = pfile->context; + + /* The context has not been set up for command line defines, and CUR + has not been updated for the macro name for in-file defines. */ + pfile->out.cur = pfile->out.base; + CUR (context) = pfile->buffer->cur; + RLIMIT (context) = pfile->buffer->rlimit; + check_output_buffer (pfile, RLIMIT (context) - CUR (context)); + + /* Is this a function-like macro? */ + if (* CUR (context) == '(') + { + bool ok = scan_parameters (pfile, macro); + + /* Remember the params so we can clear NODE_MACRO_ARG flags. */ + macro->params = (cpp_hashnode **) BUFF_FRONT (pfile->a_buff); + + /* Setting macro to NULL indicates an error occurred, and + prevents unnecessary work in _cpp_scan_out_logical_line. */ + if (!ok) + macro = NULL; + else + { + BUFF_FRONT (pfile->a_buff) = (uchar *) ¯o->params[macro->paramc]; + macro->fun_like = 1; + } + } + + /* Skip leading whitespace in the replacement text. */ + pfile->buffer->cur + = skip_whitespace (pfile, CUR (context), + CPP_OPTION (pfile, discard_comments_in_macro_exp)); + + pfile->state.prevent_expansion++; + _cpp_scan_out_logical_line (pfile, macro); + pfile->state.prevent_expansion--; + + if (!macro) + return false; + + /* Skip trailing white space. */ + cur = pfile->out.base; + limit = pfile->out.cur; + while (limit > cur && is_space (limit[-1])) + limit--; + pfile->out.cur = limit; + save_replacement_text (pfile, macro, 0); + + return true; +} + +/* Copy SRC of length LEN to DEST, but convert all contiguous + whitespace to a single space, provided it is not in quotes. The + quote currently in effect is pointed to by PQUOTE, and is updated + by the function. Returns the number of bytes copied. */ +static size_t +canonicalize_text (uchar *dest, const uchar *src, size_t len, uchar *pquote) +{ + uchar *orig_dest = dest; + uchar quote = *pquote; + + while (len) + { + if (is_space (*src) && !quote) + { + do + src++, len--; + while (len && is_space (*src)); + *dest++ = ' '; + } + else + { + if (*src == '\'' || *src == '"') + { + if (!quote) + quote = *src; + else if (quote == *src) + quote = 0; + } + *dest++ = *src++, len--; + } + } + + *pquote = quote; + return dest - orig_dest; +} + +/* Returns true if MACRO1 and MACRO2 have expansions different other + than in the form of their whitespace. */ +bool +_cpp_expansions_different_trad (const cpp_macro *macro1, + const cpp_macro *macro2) +{ + uchar *p1 = xmalloc (macro1->count + macro2->count); + uchar *p2 = p1 + macro1->count; + uchar quote1 = 0, quote2 = 0; + bool mismatch; + size_t len1, len2; + + if (macro1->paramc > 0) + { + const uchar *exp1 = macro1->exp.text, *exp2 = macro2->exp.text; + + mismatch = true; + for (;;) + { + struct block *b1 = (struct block *) exp1; + struct block *b2 = (struct block *) exp2; + + if (b1->arg_index != b2->arg_index) + break; + + len1 = canonicalize_text (p1, b1->text, b1->text_len, "e1); + len2 = canonicalize_text (p2, b2->text, b2->text_len, "e2); + if (len1 != len2 || memcmp (p1, p2, len1)) + break; + if (b1->arg_index == 0) + { + mismatch = false; + break; + } + exp1 += BLOCK_LEN (b1->text_len); + exp2 += BLOCK_LEN (b2->text_len); + } + } + else + { + len1 = canonicalize_text (p1, macro1->exp.text, macro1->count, "e1); + len2 = canonicalize_text (p2, macro2->exp.text, macro2->count, "e2); + mismatch = (len1 != len2 || memcmp (p1, p2, len1)); + } + + free (p1); + return mismatch; +} diff --git a/libcpp/ucnid.h b/libcpp/ucnid.h new file mode 100644 index 00000000000..04c9513c537 --- /dev/null +++ b/libcpp/ucnid.h @@ -0,0 +1,336 @@ +/* Table of UCNs which are valid in identifiers. + Copyright (C) 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Automatically generated from cppucnid.tab, do not edit */ + +/* This file reproduces the table in ISO/IEC 9899:1999 (C99) Annex + D, which is itself a reproduction from ISO/IEC TR 10176:1998, and + the similar table from ISO/IEC 14882:1988 (C++98) Annex E, which is + a reproduction of ISO/IEC PDTR 10176. Unfortunately these tables + are not identical. */ + +#ifndef LIBCPP_UCNID_H +#define LIBCPP_UCNID_H + +#define C99 1 +#define CXX 2 +#define DIG 4 + +struct ucnrange +{ + unsigned short lo, hi; + unsigned short flags; +}; + +static const struct ucnrange ucnranges[] = { + { 0x00aa, 0x00aa, C99 }, /* Latin */ + { 0x00b5, 0x00b5, C99 }, /* Special characters */ + { 0x00b7, 0x00b7, C99 }, + { 0x00ba, 0x00ba, C99 }, /* Latin */ + { 0x00c0, 0x00d6, CXX|C99 }, + { 0x00d8, 0x00f6, CXX|C99 }, + { 0x00f8, 0x01f5, CXX|C99 }, + { 0x01fa, 0x0217, CXX|C99 }, + { 0x0250, 0x02a8, CXX|C99 }, + { 0x02b0, 0x02b8, C99 }, /* Special characters */ + { 0x02bb, 0x02bb, C99 }, + { 0x02bd, 0x02c1, C99 }, + { 0x02d0, 0x02d1, C99 }, + { 0x02e0, 0x02e4, C99 }, + { 0x037a, 0x037a, C99 }, + { 0x0384, 0x0384, CXX }, /* Greek */ + { 0x0386, 0x0386, C99 }, + { 0x0388, 0x038a, CXX|C99 }, + { 0x038c, 0x038c, CXX|C99 }, + { 0x038e, 0x03a1, CXX|C99 }, + { 0x03a3, 0x03ce, CXX|C99 }, + { 0x03d0, 0x03d6, CXX|C99 }, + { 0x03da, 0x03da, CXX|C99 }, + { 0x03dc, 0x03dc, CXX|C99 }, + { 0x03de, 0x03de, CXX|C99 }, + { 0x03e0, 0x03e0, CXX|C99 }, + { 0x03e2, 0x03f3, CXX|C99 }, + { 0x0401, 0x040c, CXX|C99 }, /* Cyrillic */ + { 0x040d, 0x040d, CXX }, + { 0x040e, 0x040e, C99 }, + { 0x040f, 0x044f, CXX|C99 }, + { 0x0451, 0x045c, CXX|C99 }, + { 0x045e, 0x0481, CXX|C99 }, + { 0x0490, 0x04c4, CXX|C99 }, + { 0x04c7, 0x04c8, CXX|C99 }, + { 0x04cb, 0x04cc, CXX|C99 }, + { 0x04d0, 0x04eb, CXX|C99 }, + { 0x04ee, 0x04f5, CXX|C99 }, + { 0x04f8, 0x04f9, CXX|C99 }, + { 0x0531, 0x0556, CXX|C99 }, /* Armenian */ + { 0x0559, 0x0559, C99 }, /* Special characters */ + { 0x0561, 0x0587, CXX|C99 }, /* Armenian */ + { 0x05b0, 0x05b9, C99 }, /* Hebrew */ + { 0x05bb, 0x05bd, C99 }, + { 0x05bf, 0x05bf, C99 }, + { 0x05c1, 0x05c2, C99 }, + { 0x05d0, 0x05ea, CXX|C99 }, + { 0x05f0, 0x05f2, CXX|C99 }, + { 0x05f3, 0x05f4, CXX }, + { 0x0621, 0x063a, CXX|C99 }, /* Arabic */ + { 0x0640, 0x0652, CXX|C99 }, + { 0x0660, 0x0669, C99|DIG }, /* Digits */ + { 0x0670, 0x06b7, CXX|C99 }, /* Arabic */ + { 0x06ba, 0x06be, CXX|C99 }, + { 0x06c0, 0x06ce, CXX|C99 }, + { 0x06d0, 0x06dc, C99 }, + { 0x06e5, 0x06e7, CXX|C99 }, + { 0x06e8, 0x06e8, C99 }, + { 0x06ea, 0x06ed, C99 }, + { 0x06f0, 0x06f9, C99|DIG }, /* Digits */ + { 0x0901, 0x0903, C99 }, /* Devanagari */ + { 0x0905, 0x0939, CXX|C99 }, + { 0x093d, 0x093d, C99 }, /* Special characters */ + { 0x093e, 0x094d, C99 }, /* Devanagari */ + { 0x0950, 0x0952, C99 }, + { 0x0958, 0x0962, CXX|C99 }, + { 0x0963, 0x0963, C99 }, + { 0x0966, 0x096f, C99|DIG }, /* Digits */ + { 0x0981, 0x0983, C99 }, /* Bengali */ + { 0x0985, 0x098c, CXX|C99 }, + { 0x098f, 0x0990, CXX|C99 }, + { 0x0993, 0x09a8, CXX|C99 }, + { 0x09aa, 0x09b0, CXX|C99 }, + { 0x09b2, 0x09b2, CXX|C99 }, + { 0x09b6, 0x09b9, CXX|C99 }, + { 0x09be, 0x09c4, C99 }, + { 0x09c7, 0x09c8, C99 }, + { 0x09cb, 0x09cd, C99 }, + { 0x09dc, 0x09dd, CXX|C99 }, + { 0x09df, 0x09e1, CXX|C99 }, + { 0x09e2, 0x09e3, C99 }, + { 0x09e6, 0x09ef, C99|DIG }, /* Digits */ + { 0x09f0, 0x09f1, CXX|C99 }, /* Bengali */ + { 0x0a02, 0x0a02, C99 }, /* Gurmukhi */ + { 0x0a05, 0x0a0a, CXX|C99 }, + { 0x0a0f, 0x0a10, CXX|C99 }, + { 0x0a13, 0x0a28, CXX|C99 }, + { 0x0a2a, 0x0a30, CXX|C99 }, + { 0x0a32, 0x0a33, CXX|C99 }, + { 0x0a35, 0x0a36, CXX|C99 }, + { 0x0a38, 0x0a39, CXX|C99 }, + { 0x0a3e, 0x0a42, C99 }, + { 0x0a47, 0x0a48, C99 }, + { 0x0a4b, 0x0a4d, C99 }, + { 0x0a59, 0x0a5c, CXX|C99 }, + { 0x0a5e, 0x0a5e, CXX|C99 }, + { 0x0a66, 0x0a6f, C99|DIG }, /* Digits */ + { 0x0a74, 0x0a74, C99 }, /* Gurmukhi */ + { 0x0a81, 0x0a83, C99 }, /* Gujarati */ + { 0x0a85, 0x0a8b, CXX|C99 }, + { 0x0a8d, 0x0a8d, CXX|C99 }, + { 0x0a8f, 0x0a91, CXX|C99 }, + { 0x0a93, 0x0aa8, CXX|C99 }, + { 0x0aaa, 0x0ab0, CXX|C99 }, + { 0x0ab2, 0x0ab3, CXX|C99 }, + { 0x0ab5, 0x0ab9, CXX|C99 }, + { 0x0abd, 0x0ac5, C99 }, + { 0x0ac7, 0x0ac9, C99 }, + { 0x0acb, 0x0acd, C99 }, + { 0x0ad0, 0x0ad0, C99 }, + { 0x0ae0, 0x0ae0, CXX|C99 }, + { 0x0ae6, 0x0aef, C99|DIG }, /* Digits */ + { 0x0b01, 0x0b03, C99 }, /* Oriya */ + { 0x0b05, 0x0b0c, CXX|C99 }, + { 0x0b0f, 0x0b10, CXX|C99 }, + { 0x0b13, 0x0b28, CXX|C99 }, + { 0x0b2a, 0x0b30, CXX|C99 }, + { 0x0b32, 0x0b33, CXX|C99 }, + { 0x0b36, 0x0b39, CXX|C99 }, + { 0x0b3d, 0x0b3d, C99 }, /* Special characters */ + { 0x0b3e, 0x0b43, C99 }, /* Oriya */ + { 0x0b47, 0x0b48, C99 }, + { 0x0b4b, 0x0b4d, C99 }, + { 0x0b5c, 0x0b5d, CXX|C99 }, + { 0x0b5f, 0x0b61, CXX|C99 }, + { 0x0b66, 0x0b6f, C99|DIG }, /* Digits */ + { 0x0b82, 0x0b83, C99 }, /* Tamil */ + { 0x0b85, 0x0b8a, CXX|C99 }, + { 0x0b8e, 0x0b90, CXX|C99 }, + { 0x0b92, 0x0b95, CXX|C99 }, + { 0x0b99, 0x0b9a, CXX|C99 }, + { 0x0b9c, 0x0b9c, CXX|C99 }, + { 0x0b9e, 0x0b9f, CXX|C99 }, + { 0x0ba3, 0x0ba4, CXX|C99 }, + { 0x0ba8, 0x0baa, CXX|C99 }, + { 0x0bae, 0x0bb5, CXX|C99 }, + { 0x0bb7, 0x0bb9, CXX|C99 }, + { 0x0bbe, 0x0bc2, C99 }, + { 0x0bc6, 0x0bc8, C99 }, + { 0x0bca, 0x0bcd, C99 }, + { 0x0be7, 0x0bef, C99|DIG }, /* Digits */ + { 0x0c01, 0x0c03, C99 }, /* Telugu */ + { 0x0c05, 0x0c0c, CXX|C99 }, + { 0x0c0e, 0x0c10, CXX|C99 }, + { 0x0c12, 0x0c28, CXX|C99 }, + { 0x0c2a, 0x0c33, CXX|C99 }, + { 0x0c35, 0x0c39, CXX|C99 }, + { 0x0c3e, 0x0c44, C99 }, + { 0x0c46, 0x0c48, C99 }, + { 0x0c4a, 0x0c4d, C99 }, + { 0x0c60, 0x0c61, CXX|C99 }, + { 0x0c66, 0x0c6f, C99|DIG }, /* Digits */ + { 0x0c82, 0x0c83, C99 }, /* Kannada */ + { 0x0c85, 0x0c8c, CXX|C99 }, + { 0x0c8e, 0x0c90, CXX|C99 }, + { 0x0c92, 0x0ca8, CXX|C99 }, + { 0x0caa, 0x0cb3, CXX|C99 }, + { 0x0cb5, 0x0cb9, CXX|C99 }, + { 0x0cbe, 0x0cc4, C99 }, + { 0x0cc6, 0x0cc8, C99 }, + { 0x0cca, 0x0ccd, C99 }, + { 0x0cde, 0x0cde, C99 }, + { 0x0ce0, 0x0ce1, CXX|C99 }, + { 0x0ce6, 0x0cef, C99|DIG }, /* Digits */ + { 0x0d02, 0x0d03, C99 }, /* Malayalam */ + { 0x0d05, 0x0d0c, CXX|C99 }, + { 0x0d0e, 0x0d10, CXX|C99 }, + { 0x0d12, 0x0d28, CXX|C99 }, + { 0x0d2a, 0x0d39, CXX|C99 }, + { 0x0d3e, 0x0d43, C99 }, + { 0x0d46, 0x0d48, C99 }, + { 0x0d4a, 0x0d4d, C99 }, + { 0x0d60, 0x0d61, CXX|C99 }, + { 0x0d66, 0x0d6f, C99|DIG }, /* Digits */ + { 0x0e01, 0x0e30, CXX|C99 }, /* Thai */ + { 0x0e31, 0x0e31, C99 }, + { 0x0e32, 0x0e33, CXX|C99 }, + { 0x0e34, 0x0e3a, C99 }, + { 0x0e40, 0x0e46, CXX|C99 }, + { 0x0e47, 0x0e49, C99 }, + { 0x0e50, 0x0e59, CXX|C99|DIG }, /* Digits */ + { 0x0e5a, 0x0e5b, CXX|C99 }, /* Thai */ + { 0x0e81, 0x0e82, CXX|C99 }, /* Lao */ + { 0x0e84, 0x0e84, CXX|C99 }, + { 0x0e87, 0x0e88, CXX|C99 }, + { 0x0e8a, 0x0e8a, CXX|C99 }, + { 0x0e8d, 0x0e8d, CXX|C99 }, + { 0x0e94, 0x0e97, CXX|C99 }, + { 0x0e99, 0x0e9f, CXX|C99 }, + { 0x0ea1, 0x0ea3, CXX|C99 }, + { 0x0ea5, 0x0ea5, CXX|C99 }, + { 0x0ea7, 0x0ea7, CXX|C99 }, + { 0x0eaa, 0x0eab, CXX|C99 }, + { 0x0ead, 0x0eae, CXX|C99 }, + { 0x0eaf, 0x0eaf, CXX }, + { 0x0eb0, 0x0eb0, CXX|C99 }, + { 0x0eb1, 0x0eb1, C99 }, + { 0x0eb2, 0x0eb3, CXX|C99 }, + { 0x0eb4, 0x0eb9, C99 }, + { 0x0ebb, 0x0ebc, C99 }, + { 0x0ebd, 0x0ebd, CXX|C99 }, + { 0x0ec0, 0x0ec4, CXX|C99 }, + { 0x0ec6, 0x0ec6, CXX|C99 }, + { 0x0ec8, 0x0ecd, C99 }, + { 0x0ed0, 0x0ed9, C99|DIG }, /* Digits */ + { 0x0edc, 0x0edd, C99 }, /* Lao */ + { 0x0f00, 0x0f00, C99 }, /* Tibetan */ + { 0x0f18, 0x0f19, C99 }, + { 0x0f20, 0x0f33, C99|DIG }, /* Digits */ + { 0x0f35, 0x0f35, C99 }, /* Tibetan */ + { 0x0f37, 0x0f37, C99 }, + { 0x0f39, 0x0f39, C99 }, + { 0x0f3e, 0x0f47, C99 }, + { 0x0f49, 0x0f69, C99 }, + { 0x0f71, 0x0f84, C99 }, + { 0x0f86, 0x0f8b, C99 }, + { 0x0f90, 0x0f95, C99 }, + { 0x0f97, 0x0f97, C99 }, + { 0x0f99, 0x0fad, C99 }, + { 0x0fb1, 0x0fb7, C99 }, + { 0x0fb9, 0x0fb9, C99 }, + { 0x10a0, 0x10c5, CXX|C99 }, /* Georgian */ + { 0x10d0, 0x10f6, CXX|C99 }, + { 0x1100, 0x1159, CXX }, /* Hangul */ + { 0x1161, 0x11a2, CXX }, + { 0x11a8, 0x11f9, CXX }, + { 0x1e00, 0x1e9a, CXX|C99 }, /* Latin */ + { 0x1e9b, 0x1e9b, C99 }, + { 0x1ea0, 0x1ef9, CXX|C99 }, + { 0x1f00, 0x1f15, CXX|C99 }, /* Greek */ + { 0x1f18, 0x1f1d, CXX|C99 }, + { 0x1f20, 0x1f45, CXX|C99 }, + { 0x1f48, 0x1f4d, CXX|C99 }, + { 0x1f50, 0x1f57, CXX|C99 }, + { 0x1f59, 0x1f59, CXX|C99 }, + { 0x1f5b, 0x1f5b, CXX|C99 }, + { 0x1f5d, 0x1f5d, CXX|C99 }, + { 0x1f5f, 0x1f7d, CXX|C99 }, + { 0x1f80, 0x1fb4, CXX|C99 }, + { 0x1fb6, 0x1fbc, CXX|C99 }, + { 0x1fbe, 0x1fbe, C99 }, /* Special characters */ + { 0x1fc2, 0x1fc4, CXX|C99 }, /* Greek */ + { 0x1fc6, 0x1fcc, CXX|C99 }, + { 0x1fd0, 0x1fd3, CXX|C99 }, + { 0x1fd6, 0x1fdb, CXX|C99 }, + { 0x1fe0, 0x1fec, CXX|C99 }, + { 0x1ff2, 0x1ff4, CXX|C99 }, + { 0x1ff6, 0x1ffc, CXX|C99 }, + { 0x203f, 0x2040, C99 }, /* Special characters */ + { 0x207f, 0x207f, C99 }, /* Latin */ + { 0x2102, 0x2102, C99 }, /* Special characters */ + { 0x2107, 0x2107, C99 }, + { 0x210a, 0x2113, C99 }, + { 0x2115, 0x2115, C99 }, + { 0x2118, 0x211d, C99 }, + { 0x2124, 0x2124, C99 }, + { 0x2126, 0x2126, C99 }, + { 0x2128, 0x2128, C99 }, + { 0x212a, 0x2131, C99 }, + { 0x2133, 0x2138, C99 }, + { 0x2160, 0x2182, C99 }, + { 0x3005, 0x3007, C99 }, + { 0x3021, 0x3029, C99 }, + { 0x3041, 0x3093, CXX|C99 }, /* Hiragana */ + { 0x3094, 0x3094, CXX }, + { 0x309b, 0x309c, CXX|C99 }, + { 0x309d, 0x309e, CXX }, + { 0x30a1, 0x30f6, CXX|C99 }, /* Katakana */ + { 0x30f7, 0x30fa, CXX }, + { 0x30fb, 0x30fc, CXX|C99 }, + { 0x30fd, 0x30fe, CXX }, + { 0x3105, 0x312c, CXX|C99 }, /* Bopomofo */ + { 0x4e00, 0x9fa5, CXX|C99 }, /* CJK Unified Ideographs */ + { 0xac00, 0xd7a3, C99 }, /* Hangul */ + { 0xf900, 0xfa2d, CXX }, /* CJK Unified Ideographs */ + { 0xfb1f, 0xfb36, CXX }, + { 0xfb38, 0xfb3c, CXX }, + { 0xfb3e, 0xfb3e, CXX }, + { 0xfb40, 0xfb44, CXX }, + { 0xfb46, 0xfbb1, CXX }, + { 0xfbd3, 0xfd3f, CXX }, + { 0xfd50, 0xfd8f, CXX }, + { 0xfd92, 0xfdc7, CXX }, + { 0xfdf0, 0xfdfb, CXX }, + { 0xfe70, 0xfe72, CXX }, + { 0xfe74, 0xfe74, CXX }, + { 0xfe76, 0xfefc, CXX }, + { 0xff21, 0xff3a, CXX }, + { 0xff41, 0xff5a, CXX }, + { 0xff66, 0xffbe, CXX }, + { 0xffc2, 0xffc7, CXX }, + { 0xffca, 0xffcf, CXX }, + { 0xffd2, 0xffd7, CXX }, + { 0xffda, 0xffdc, CXX }, +}; + +#endif /* LIBCPP_UCNID_H */ diff --git a/libcpp/ucnid.pl b/libcpp/ucnid.pl new file mode 100644 index 00000000000..eb8bbcac627 --- /dev/null +++ b/libcpp/ucnid.pl @@ -0,0 +1,130 @@ +#! /usr/bin/perl -w +use strict; + +# Convert cppucnid.tab to cppucnid.h. We use two arrays of length +# 65536 to represent the table, since this is nice and simple. The +# first array holds the tags indicating which ranges are valid in +# which contexts. The second array holds the language name associated +# with each element. + +our(@tags, @names); +@tags = ("") x 65536; +@names = ("") x 65536; + + +# Array mapping tag numbers to standard #defines +our @stds; + +# Current standard and language +our($curstd, $curlang); + +# First block of the file is a template to be saved for later. +our @template; + +while (<>) { + chomp; + last if $_ eq '%%'; + push @template, $_; +}; + +# Second block of the file is the UCN tables. +# The format looks like this: +# +# [std] +# +# ; language +# xxxx-xxxx xxxx xxxx-xxxx .... +# +# with comment lines starting with #. + +while (<>) { + chomp; + /^#/ and next; + /^\s*$/ and next; + /^\[(.+)\]$/ and do { + $curstd = $1; + next; + }; + /^; (.+)$/ and do { + $curlang = $1; + next; + }; + + process_range(split); +} + +# Print out the template, inserting as requested. +$\ = "\n"; +for (@template) { + print("/* Automatically generated from cppucnid.tab, do not edit */"), + next if $_ eq "[dne]"; + print_table(), next if $_ eq "[table]"; + print; +} + +sub print_table { + my($lo, $hi); + my $prevname = ""; + + for ($lo = 0; $lo <= $#tags; $lo = $hi) { + $hi = $lo; + $hi++ while $hi <= $#tags + && $tags[$hi] eq $tags[$lo] + && $names[$hi] eq $names[$lo]; + + # Range from $lo to $hi-1. + # Don't make entries for ranges that are not valid idchars. + next if ($tags[$lo] eq ""); + my $tag = $tags[$lo]; + $tag = " ".$tag if $tag =~ /^C99/; + + if ($names[$lo] eq $prevname) { + printf(" { 0x%04x, 0x%04x, %-11s },\n", + $lo, $hi-1, $tag); + } else { + printf(" { 0x%04x, 0x%04x, %-11s }, /* %s */\n", + $lo, $hi-1, $tag, $names[$lo]); + } + $prevname = $names[$lo]; + } +} + +# The line is a list of four-digit hexadecimal numbers or +# pairs of such numbers. Each is a valid identifier character +# from the given language, under the given standard. +sub process_range { + for my $range (@_) { + if ($range =~ /^[0-9a-f]{4}$/) { + my $i = hex($range); + if ($tags[$i] eq "") { + $tags[$i] = $curstd; + } else { + $tags[$i] = $curstd . "|" . $tags[$i]; + } + if ($names[$i] ne "" && $names[$i] ne $curlang) { + warn sprintf ("language overlap: %s/%s at %x (tag %d)", + $names[$i], $curlang, $i, $tags[$i]); + next; + } + $names[$i] = $curlang; + } elsif ($range =~ /^ ([0-9a-f]{4}) - ([0-9a-f]{4}) $/x) { + my ($start, $end) = (hex($1), hex($2)); + my $i; + for ($i = $start; $i <= $end; $i++) { + if ($tags[$i] eq "") { + $tags[$i] = $curstd; + } else { + $tags[$i] = $curstd . "|" . $tags[$i]; + } + if ($names[$i] ne "" && $names[$i] ne $curlang) { + warn sprintf ("language overlap: %s/%s at %x (tag %d)", + $names[$i], $curlang, $i, $tags[$i]); + next; + } + $names[$i] = $curlang; + } + } else { + warn "malformed range expression $range"; + } + } +} diff --git a/libcpp/ucnid.tab b/libcpp/ucnid.tab new file mode 100644 index 00000000000..7cb16e1e5a4 --- /dev/null +++ b/libcpp/ucnid.tab @@ -0,0 +1,239 @@ +/* Table of UCNs which are valid in identifiers. + Copyright (C) 2003 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +[dne] + +/* This file reproduces the table in ISO/IEC 9899:1999 (C99) Annex + D, which is itself a reproduction from ISO/IEC TR 10176:1998, and + the similar table from ISO/IEC 14882:1988 (C++98) Annex E, which is + a reproduction of ISO/IEC PDTR 10176. Unfortunately these tables + are not identical. */ + +#ifndef LIBCPP_UCNID_H +#define LIBCPP_UCNID_H + +#define C99 1 +#define CXX 2 +#define DIG 4 + +struct ucnrange +{ + unsigned short lo, hi; + unsigned short flags; +}; + +static const struct ucnrange ucnranges[] = { +[table] +}; + +#endif /* LIBCPP_UCNID_H */ +%% + +[C99] + +; Latin +00aa 00ba 00c0-00d6 00d8-00f6 00f8-01f5 01fa-0217 0250-02a8 1e00-1e9b +1ea0-1ef9 207f + +; Greek +0386 0388-038a 038c 038e-03a1 03a3-03ce 03d0-03d6 03da 03dc 03de 03e0 +03e2-03f3 1f00-1f15 1f18-1f1d 1f20-1f45 1f48-1f4d 1f50-1f57 1f59 1f5b +1f5d 1f5f-1f7d 1f80-1fb4 1fb6-1fbc 1fc2-1fc4 1fc6-1fcc 1fd0-1fd3 +1fd6-1fdb 1fe0-1fec 1ff2-1ff4 1ff6-1ffc + +; Cyrillic +0401-040c 040e-044f 0451-045c 045e-0481 0490-04c4 04c7-04c8 04cb-04cc +04d0-04eb 04ee-04f5 04f8-04f9 + +; Armenian +0531-0556 0561-0587 + +; Hebrew +05b0-05b9 05bb-05bd 05bf 05c1-05c2 05d0-05ea 05f0-05f2 + +; Arabic +0621-063a 0640-0652 0670-06b7 06ba-06be 06c0-06ce 06d0-06dc 06e5-06e8 +06ea-06ed + +; Devanagari +0901-0903 0905-0939 093e-094d 0950-0952 0958-0963 + +; Bengali +0981-0983 0985-098c 098f-0990 0993-09a8 09aa-09b0 09b2 09b6-09b9 +09be-09c4 09c7-09c8 09cb-09cd 09dc-09dd 09df-09e3 09f0-09f1 + +; Gurmukhi +0a02 0a05-0a0a 0a0f-0a10 0a13-0a28 0a2a-0a30 0a32-0a33 0a35-0a36 +0a38-0a39 0a3e-0a42 0a47-0a48 0a4b-0a4d 0a59-0a5c 0a5e 0a74 + +; Gujarati +0a81-0a83 0a85-0a8b 0a8d 0a8f-0a91 0a93-0aa8 0aaa-0ab0 0ab2-0ab3 +0ab5-0ab9 0abd-0ac5 0ac7-0ac9 0acb-0acd 0ad0 0ae0 + +; Oriya +0b01-0b03 0b05-0b0c 0b0f-0b10 0b13-0b28 0b2a-0b30 0b32-0b33 0b36-0b39 +0b3e-0b43 0b47-0b48 0b4b-0b4d 0b5c-0b5d 0b5f-0b61 + +; Tamil +0b82-0b83 0b85-0b8a 0b8e-0b90 0b92-0b95 0b99-0b9a 0b9c 0b9e-0b9f +0ba3-0ba4 0ba8-0baa 0bae-0bb5 0bb7-0bb9 0bbe-0bc2 0bc6-0bc8 0bca-0bcd + +; Telugu +0c01-0c03 0c05-0c0c 0c0e-0c10 0c12-0c28 0c2a-0c33 0c35-0c39 0c3e-0c44 +0c46-0c48 0c4a-0c4d 0c60-0c61 + +; Kannada +0c82-0c83 0c85-0c8c 0c8e-0c90 0c92-0ca8 0caa-0cb3 0cb5-0cb9 0cbe-0cc4 +0cc6-0cc8 0cca-0ccd 0cde 0ce0-0ce1 + +; Malayalam +0d02-0d03 0d05-0d0c 0d0e-0d10 0d12-0d28 0d2a-0d39 0d3e-0d43 0d46-0d48 +0d4a-0d4d 0d60-0d61 + +# CORRECTION: exclude 0e50-0e59 from the Thai range as it also appears +# in the Digits range below. +; Thai +0e01-0e3a 0e40-0e49 0e5a-0e5b + +; Lao +0e81-0e82 0e84 0e87-0e88 0e8a 0e8d 0e94-0e97 0e99-0e9f 0ea1-0ea3 0ea5 +0ea7 0eaa-0eab 0ead-0eae 0eb0-0eb9 0ebb-0ebd 0ec0-0ec4 0ec6 0ec8-0ecd +0edc-0edd + +; Tibetan +0f00 0f18-0f19 0f35 0f37 0f39 0f3e-0f47 0f49-0f69 0f71-0f84 0f86-0f8b +0f90-0f95 0f97 0f99-0fad 0fb1-0fb7 0fb9 + +; Georgian +10a0-10c5 10d0-10f6 + +; Hiragana +3041-3093 309b-309c + +; Katakana +30a1-30f6 30fb-30fc + +; Bopomofo +3105-312c + +; CJK Unified Ideographs +4e00-9fa5 + +; Hangul +ac00-d7a3 + +; Special characters +00b5 00b7 02b0-02b8 02bb 02bd-02c1 02d0-02d1 02e0-02e4 037a 0559 093d +0b3d 1fbe 203f-2040 2102 2107 210a-2113 2115 2118-211d 2124 2126 2128 +212a-2131 2133-2138 2160-2182 3005-3007 3021-3029 + +[C99|DIG] +; Digits +0660-0669 06f0-06f9 0966-096f 09e6-09ef 0a66-0a6f 0ae6-0aef 0b66-0b6f +0be7-0bef 0c66-0c6f 0ce6-0cef 0d66-0d6f 0e50-0e59 0ed0-0ed9 0f20-0f33 + +[CXX] + +; Latin +00c0-00d6 00d8-00f6 00f8-01f5 01fa-0217 0250-02a8 1e00-1e9a 1ea0-1ef9 + +; Greek +0384 0388-038a 038c 038e-03a1 03a3-03ce 03d0-03d6 03da 03dc 03de 03e0 +03e2-03f3 1f00-1f15 1f18-1f1d 1f20-1f45 1f48-1f4d 1f50-1f57 1f59 1f5b +1f5d 1f5f-1f7d 1f80-1fb4 1fb6-1fbc 1fc2-1fc4 1fc6-1fcc 1fd0-1fd3 +1fd6-1fdb 1fe0-1fec 1ff2-1ff4 1ff6-1ffc + +; Cyrillic +0401-040d 040f-044f 0451-045c 045e-0481 0490-04c4 04c7-04c8 04cb-04cc +04d0-04eb 04ee-04f5 04f8-04f9 + +; Armenian +0531-0556 0561-0587 + +; Hebrew +05d0-05ea 05f0-05f4 + +; Arabic +0621-063a 0640-0652 0670-06b7 06ba-06be 06c0-06ce 06e5-06e7 + +; Devanagari +0905-0939 0958-0962 + +; Bengali +0985-098c 098f-0990 0993-09a8 09aa-09b0 09b2 09b6-09b9 09dc-09dd +09df-09e1 09f0-09f1 + +; Gurmukhi +0a05-0a0a 0a0f-0a10 0a13-0a28 0a2a-0a30 0a32-0a33 0a35-0a36 0a38-0a39 +0a59-0a5c 0a5e + +; Gujarati +0a85-0a8b 0a8d 0a8f-0a91 0a93-0aa8 0aaa-0ab0 0ab2-0ab3 0ab5-0ab9 0ae0 + +; Oriya +0b05-0b0c 0b0f-0b10 0b13-0b28 0b2a-0b30 0b32-0b33 0b36-0b39 0b5c-0b5d +0b5f-0b61 + +; Tamil +0b85-0b8a 0b8e-0b90 0b92-0b95 0b99-0b9a 0b9c 0b9e-0b9f 0ba3-0ba4 +0ba8-0baa 0bae-0bb5 0bb7-0bb9 + +; Telugu +0c05-0c0c 0c0e-0c10 0c12-0c28 0c2a-0c33 0c35-0c39 0c60-0c61 + +; Kannada +0c85-0c8c 0c8e-0c90 0c92-0ca8 0caa-0cb3 0cb5-0cb9 0ce0-0ce1 + +; Malayalam +0d05-0d0c 0d0e-0d10 0d12-0d28 0d2a-0d39 0d60-0d61 + +# CORRECTION: Exclude 0e50-0e59 from the Thai range and make a fake +# Digits range for it, to match C99. cppcharset.c knows that C++ +# doesn't distinguish digits from other UCNs valid in identifiers. +; Thai +0e01-0e30 0e32-0e33 0e40-0e46 0e4f-0e49 0e5a-0e5b + +; Digits +0e50-0e59 + +# CORRECTION: Change 0e0d to 0e8d (typo in standard; see C++ DR 131) +; Lao +0e81-0e82 0e84 0e87-0e88 0e8a 0e8d 0e94-0e97 0e99-0e9f 0ea1-0ea3 0ea5 +0ea7 0eaa-0eab 0ead-0eb0 0eb2 0eb3 0ebd 0ec0-0ec4 0ec6 + +; Georgian +10a0-10c5 10d0-10f6 + +; Hiragana +3041-3094 309b-309e + +; Katakana +30a1-30fe + +# CORRECTION: language spelled "Bopmofo" in C++98. +; Bopomofo +3105-312c + +; Hangul +1100-1159 1161-11a2 11a8-11f9 + +; CJK Unified Ideographs +f900-fa2d fb1f-fb36 fb38-fb3c fb3e fb40-fb41 fb42-fb44 fb46-fbb1 +fbd3-fd3f fd50-fd8f fd92-fdc7 fdf0-fdfb fe70-fe72 fe74 fe76-fefc +ff21-ff3a ff41-ff5a ff66-ffbe ffc2-ffc7 ffca-ffcf ffd2-ffd7 +ffda-ffdc 4e00-9fa5 + |