From 165ede20b4aef9ca0dd028f29a6d9ba73b32010d Mon Sep 17 00:00:00 2001 From: sebastien Date: Mon, 13 Jul 2009 09:13:42 +0000 Subject: [PATCH] Preprocessor: refactor usage of GNU g++ specific features git-svn-id: https://www.dynare.org/svn/dynare/trunk@2840 ac1d8469-bf42-47a9-8791-bf33cf982152 --- ExprNode.cc | 8 ++++++-- StaticModel.cc | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ExprNode.cc b/ExprNode.cc index 47d7bc03..5c799fcc 100644 --- a/ExprNode.cc +++ b/ExprNode.cc @@ -21,7 +21,11 @@ #include #include -#include +// For select1st() +#ifdef __GNUC__ +# include +using namespace __gnu_cxx; +#endif #include #include @@ -103,7 +107,7 @@ ExprNode::collectModelLocalVariables(set &result) const set > symb_ids; collectVariables(eModelLocalVariable, symb_ids); transform(symb_ids.begin(), symb_ids.end(), inserter(result, result.begin()), - __gnu_cxx::select1st >()); + select1st >()); } void diff --git a/StaticModel.cc b/StaticModel.cc index def06c0b..439a2abe 100644 --- a/StaticModel.cc +++ b/StaticModel.cc @@ -26,7 +26,11 @@ #include #ifdef DEBUG -# include +// For select2nd() +# ifdef __GNUC__ +# include +using namespace __gnu_cxx; +# endif #endif #include @@ -320,7 +324,7 @@ StaticModel::computeNormalization() n1++; pair::const_iterator, multimap::const_iterator> x = natural_endo2eqs.equal_range(i); - if (find_if(x.first, x.second, compose1(bind2nd(equal_to(), endo2eq[i]), __gnu_cxx::select2nd::value_type>())) == x.second) + if (find_if(x.first, x.second, compose1(bind2nd(equal_to(), endo2eq[i]), select2nd::value_type>())) == x.second) cout << "Natural normalization of variable " << symbol_table.getName(symbol_table.getID(eEndogenous, i)) << " not used." << endl; else