X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gold%2Fgold.h;h=b78a16562847db6b06dcd79a8699c2f75942c3b1;hb=cfd4e875aeacf565f945c2818dbfff47807b6199;hp=9aa7cf3506ced351a33451bf088d33be203bc33a;hpb=81c82a68dc3bb09bd3b5b4101ed9737814023f1a;p=platform%2Fupstream%2Fbinutils.git diff --git a/gold/gold.h b/gold/gold.h index 9aa7cf3..b78a165 100644 --- a/gold/gold.h +++ b/gold/gold.h @@ -1,6 +1,6 @@ // gold.h -- general definitions for gold -*- C++ -*- -// Copyright 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 2006-2014 Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -32,137 +32,7 @@ #include #include -#ifndef ENABLE_NLS - // The Solaris version of locale.h always includes libintl.h. If we - // have been configured with --disable-nls then ENABLE_NLS will not - // be defined and the dummy definitions of bindtextdomain (et al) - // below will conflict with the definitions in libintl.h. So we - // define these values to prevent the bogus inclusion of libintl.h. -# define _LIBINTL_H -# define _LIBGETTEXT_H -#endif - -// Always include first to avoid conflicts with the macros -// used when ENABLE_NLS is not defined. -#include - -#ifdef ENABLE_NLS -# include -# define _(String) gettext (String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define gettext(Msgid) (Msgid) -# define dgettext(Domainname, Msgid) (Msgid) -# define dcgettext(Domainname, Msgid, Category) (Msgid) -# define textdomain(Domainname) do {} while (0) /* nothing */ -# define bindtextdomain(Domainname, Dirname) do {} while (0) /* nothing */ -# define _(String) (String) -# define N_(String) (String) -#endif - -// Figure out how to get a hash set and a hash map. - -#if defined(HAVE_TR1_UNORDERED_SET) && defined(HAVE_TR1_UNORDERED_MAP) \ - && defined(HAVE_TR1_UNORDERED_MAP_REHASH) - -#include -#include - -// We need a template typedef here. - -#define Unordered_set std::tr1::unordered_set -#define Unordered_map std::tr1::unordered_map -#define Unordered_multimap std::tr1::unordered_multimap - -#define reserve_unordered_map(map, n) ((map)->rehash(n)) - -#ifndef HAVE_TR1_HASH_OFF_T -// The library does not support hashes of off_t values. Add support -// here. This is likely to be specific to libstdc++. This issue -// arises with GCC 4.1.x when compiling in 32-bit mode with a 64-bit -// off_t type. -namespace std { namespace tr1 { -template<> -struct hash : public std::unary_function -{ - std::size_t - operator()(off_t val) const - { return static_cast(val); } -}; -} } // Close namespaces. -#endif // !defined(HAVE_TR1_HASH_OFF_T) - -#elif defined(HAVE_EXT_HASH_MAP) && defined(HAVE_EXT_HASH_SET) - -#include -#include -#include - -#define Unordered_set __gnu_cxx::hash_set -#define Unordered_map __gnu_cxx::hash_map -#define Unordered_multimap __gnu_cxx::hash_multimap - -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); } -}; - -} - -#define reserve_unordered_map(map, n) ((map)->resize(n)) - -#else - -// The fallback is to just use set and map. - -#include -#include - -#define Unordered_set std::set -#define Unordered_map std::map -#define Unordered_multimap std::multimap - -#define reserve_unordered_map(map, n) - -#endif - -#ifndef HAVE_PREAD -extern "C" ssize_t pread(int, void*, size_t, off_t); -#endif - -#ifndef HAVE_FTRUNCATE -extern "C" int ftruncate(int, off_t); -#endif - -#ifndef HAVE_FFSLL -extern "C" int ffsll(long long); -#endif - -#if !HAVE_DECL_MEMMEM -extern "C" void *memmem(const void *, size_t, const void *, size_t); -#endif - -#if !HAVE_DECL_STRNDUP -extern "C" char *strndup(const char *, size_t); -#endif +#include "system.h" namespace gold {