From a7e7a04aafdcb91e13180f421df550418041d9bf Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 16 May 2011 12:05:49 -0400 Subject: Fix run_compile_commands build on Apple GCC 3.3 This compiler does not provide the "at" method of std::map. Approximate it well enough for our needs. --- Tests/CMakeLib/run_compile_commands.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx index c925167..31049d3 100644 --- a/Tests/CMakeLib/run_compile_commands.cxx +++ b/Tests/CMakeLib/run_compile_commands.cxx @@ -2,7 +2,19 @@ class CompileCommandParser { public: - typedef std::map CommandType; + class CommandType: public std::map + { + public: +#if defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ < 4 + cmStdString const& at(cmStdString const& k) const + { + const_iterator i = this->find(k); + if(i != this->end()) { return i->second; } + static cmStdString empty; + return empty; + } +#endif + }; typedef std::vector TranslationUnitsType; CompileCommandParser(std::ifstream *input) -- cgit v0.12