From b39e68c51e67ad6b44f46f5f63b776aa371599eb Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Wed, 12 Jan 2011 14:01:07 +0100 Subject: [PATCH] Fix a compilation failure with g++-3.3. * src/misc/hash.hh (identity_hash): New function. * src/tgba/tgbaexplicit.hh (tgba_explicit_number): Use identity_hash instead of std::tr1::hash that does not exist with g++-3.3. --- ChangeLog | 9 +++++++++ src/misc/hash.hh | 16 ++++++++++++++-- src/tgba/tgbaexplicit.hh | 4 ++-- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6e0295226..dcf9f06af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-01-12 Alexandre Duret-Lutz + + Fix a compilation failure with g++-3.3. + + * src/misc/hash.hh (identity_hash): New function. + * src/tgba/tgbaexplicit.hh (tgba_explicit_number): Use + identity_hash instead of std::tr1::hash that does not + exist with g++-3.3. + 2011-01-07 Alexandre Duret-Lutz Fix usage of minimize_obligation in the CGI script. diff --git a/src/misc/hash.hh b/src/misc/hash.hh index 5010b5af4..f13a4fc72 100644 --- a/src/misc/hash.hh +++ b/src/misc/hash.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2008 Laboratoire de Recherche et Développement +// Copyright (C) 2008, 2011 Laboratoire de Recherche et Développement // de l'Epita (LRDE). // Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de // Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), @@ -86,7 +86,7 @@ namespace spot # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4 typedef std::tr1::hash string_hash; # else // GCC < 4.3 - struct string_hash : + struct string_hash: public Sgi::hash, public std::unary_function { @@ -99,6 +99,18 @@ namespace spot }; /// @} # endif + + /// \brief A hash function that returns identity + /// \ingroup hash_funcs + template + struct identity_hash: + public std::unary_function + { + size_t operator()(const T& s) const + { + return s; + } + }; } #endif // SPOT_MISC_HASH_HH diff --git a/src/tgba/tgbaexplicit.hh b/src/tgba/tgbaexplicit.hh index f896438a5..f9f08cbfa 100644 --- a/src/tgba/tgbaexplicit.hh +++ b/src/tgba/tgbaexplicit.hh @@ -360,11 +360,11 @@ namespace spot #ifndef SWIG class tgba_explicit_number: - public tgba_explicit_labelled > + public tgba_explicit_labelled > { public: tgba_explicit_number(bdd_dict* dict): - tgba_explicit_labelled >(dict) + tgba_explicit_labelled >(dict) {}; virtual ~tgba_explicit_number(); virtual state* add_default_init();