From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/go/go-system.h | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 gcc/go/go-system.h (limited to 'gcc/go/go-system.h') diff --git a/gcc/go/go-system.h b/gcc/go/go-system.h new file mode 100644 index 000000000..e56952dfe --- /dev/null +++ b/gcc/go/go-system.h @@ -0,0 +1,153 @@ +// go-system.h -- Go frontend inclusion of gcc header files -*- C++ -*- +// Copyright (C) 2009, 2010 Free Software Foundation, Inc. + +// This file is part of GCC. + +// 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 3, 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 COPYING3. If not see +// . + +#ifndef GO_SYSTEM_H +#define GO_SYSTEM_H + +#include "config.h" + +// These must be included before the #poison declarations in system.h. + +#include +#include +#include +#include +#include +#include + +#if defined(HAVE_UNORDERED_MAP) + +# include +# include + +# define Unordered_map(KEYTYPE, VALTYPE) \ + std::unordered_map + +# define Unordered_map_hash(KEYTYPE, VALTYPE, HASHFN, EQFN) \ + std::unordered_map + +# define Unordered_set(KEYTYPE) \ + std::unordered_set + +# define Unordered_set_hash(KEYTYPE, HASHFN, EQFN) \ + std::unordered_set + +#elif defined(HAVE_TR1_UNORDERED_MAP) + +# include +# include + +# define Unordered_map(KEYTYPE, VALTYPE) \ + std::tr1::unordered_map + +# define Unordered_map_hash(KEYTYPE, VALTYPE, HASHFN, EQFN) \ + std::tr1::unordered_map + +# define Unordered_set(KEYTYPE) \ + std::tr1::unordered_set + +# define Unordered_set_hash(KEYTYPE, HASHFN, EQFN) \ + std::tr1::unordered_set + +#elif defined(HAVE_EXT_HASH_MAP) + +# include +# include + +# define Unordered_map(KEYTYPE, VALTYPE) \ + __gnu_cxx::hash_map + +# define Unordered_map_hash(KEYTYPE, VALTYPE, HASHFN, EQFN) \ + __gnu_cxx::hash_map + +# define Unordered_set(KEYTYPE) \ + __gnu_cxx::hash_set + +# define Unordered_set_hash(KEYTYPE, HASHFN, EQFN) \ + __gnu_cxx::hash_set + +// Provide hash functions for strings and pointers. + +namespace __gnu_cxx +{ + +template<> +struct hash +{ + size_t + operator()(std::string s) const + { return __stl_hash_string(s.c_str()); } +}; + +template +struct hash +{ + size_t + operator()(T* p) const + { return reinterpret_cast(p); } +}; + +} + +#else + +# define Unordered_map(KEYTYPE, VALTYPE) \ + std::map + +# define Unordered_set(KEYTYPE) \ + std::set + +// We could make this work by writing an adapter class which +// implemented operator< in terms of the hash function. +# error "requires hash table type" + +#endif + +// We don't really need iostream, but some versions of gmp.h include +// it when compiled with C++, which means that we need to include it +// before the macro magic of safe-ctype.h, which is included by +// system.h. +#include + +// Some versions of gmp.h assume that #include will define +// std::FILE. This is not true with libstdc++ 4.3 and later. This is +// fixed in GMP 4.3, but at this point we don't know which version of +// GMP is in use. Since the top level configure script accepts GMP +// 4.2, at least for now we #include to ensure that GMP 4.2 +// will work. FIXME: This can be removed when we require GMP 4.3 or +// later. +#include + +#ifndef ENABLE_BUILD_WITH_CXX +extern "C" +{ +#endif + +#include "system.h" +#include "ansidecl.h" +#include "coretypes.h" + +#include "diagnostic-core.h" /* For error_at and friends. */ +#include "input.h" /* For source_location. */ + +#ifndef ENABLE_BUILD_WITH_CXX +} // End extern "C" +#endif + +#endif // !defined(GO_SYSTEM_H) -- cgit v1.2.3