commit ce5258bd0b66fb9d9eec2ee3baf31c7e7730ed3a Author: Hubert Figuière Date: Sun Oct 30 23:09:40 2016 -0400 Bug 733085 - Remove tr1 since we require C++11 * configure.ac: remove tr1 detection and boost's * src/*: replace tr1 by std:: diff --git a/configure.ac b/configure.ac index 86f7c97..cb1314c 100644 --- a/configure.ac +++ b/configure.ac @@ -274,11 +274,6 @@ dnl detect if c++11 is required, because of glibmm-24 >= 2.46 PKG_CHECK_EXISTS([glibmm-2.4 >= 2.46], [CXX11_IS_REQUIRED=yes], [CXX11_IS_REQUIRED=no]) - -dnl Check for tr1 headers -AC_CHECK_HEADERS([tr1/unordered_map boost/tr1/unordered_map.hpp]) -AC_CHECK_HEADERS([tr1/memory boost/tr1/memory.hpp]) -AC_CHECK_HEADERS([tr1/tuple boost/tr1/tuple.hpp]) dnl Check for pty.h and its alternatives dnl https://www.gnu.org/software/gnulib/manual/html_node/pty_002eh.html diff --git a/src/common/nmv-log-stream.cc b/src/common/nmv-log-stream.cc index 6822de1..bd4ac93 100644 --- a/src/common/nmv-log-stream.cc +++ b/src/common/nmv-log-stream.cc @@ -43,34 +43,14 @@ #include "nmv-date-utils.h" #include "nmv-safe-ptr-utils.h" -#if defined(HAVE_TR1_UNORDERED_MAP) -#include -#elif defined(HAVE_BOOST_TR1_UNORDERED_MAP_HPP) -#include -#else -#include - -namespace __gnu_cxx { - template<> - struct hash { - size_t operator() (const std::string& s) const - { - return hash() (s.c_str ()); - } - }; -} -#endif +#include namespace nemiver { namespace common { using namespace std; -#if defined(HAVE_TR1_UNORDERED_MAP) || defined(HAVE_BOOST_TR1_UNORDERED_MAP_HPP) -typedef std::tr1::unordered_map DomainMap; -#else -typedef __gnu_cxx::hash_map DomainMap; -#endif +typedef std::unordered_map DomainMap; static enum LogStream::StreamType s_stream_type = LogStream::COUT_STREAM; static enum LogStream::LogLevel s_level_filter = LogStream::LOG_LEVEL_NORMAL; diff --git a/src/dbgengine/nmv-dbg-common.h b/src/dbgengine/nmv-dbg-common.h index 41074b0..2026495 100644 --- a/src/dbgengine/nmv-dbg-common.h +++ b/src/dbgengine/nmv-dbg-common.h @@ -27,11 +27,7 @@ #ifndef __NMV_DBG_COMMON_H_H__ #define __NMV_DBG_COMMON_H_H__ #include "nmv-i-debugger.h" -#if defined(HAVE_TR1_MEMORY) -#include -#elif defined(HAVE_BOOST_TR1_MEMORY_HPP) -#include -#endif +#include NEMIVER_BEGIN_NAMESPACE (nemiver) @@ -41,7 +37,7 @@ NEMIVER_BEGIN_NAMESPACE (nemiver) /// of a variable value. class VarChange { struct Priv; - std::tr1::shared_ptr m_priv; + std::shared_ptr m_priv; public: VarChange (); @@ -73,7 +69,7 @@ public: void apply_to_variable (IDebugger::VariableSafePtr a_var, std::list &a_changed_vars); }; -typedef std::tr1::shared_ptr VarChangePtr; +typedef std::shared_ptr VarChangePtr; /// Update variable a_to with new bits from a_from. Note that only /// things that can reasonably change are updated here. diff --git a/src/langs/nmv-cpp-ast-utils.cc b/src/langs/nmv-cpp-ast-utils.cc index 4c429ff..c7cc7c6 100644 --- a/src/langs/nmv-cpp-ast-utils.cc +++ b/src/langs/nmv-cpp-ast-utils.cc @@ -47,7 +47,7 @@ get_declarator_id_as_string (const DeclaratorPtr a_decl, string &a_id) return true; case Declarator::ARRAY_DECLARATOR: { ArrayDeclaratorPtr decl; - decl = std::tr1::static_pointer_cast (a_decl); + decl = std::static_pointer_cast (a_decl); if (!decl->get_declarator ()) { return false; } diff --git a/src/langs/nmv-cpp-ast.h b/src/langs/nmv-cpp-ast.h index 321f735..0f302f8 100644 --- a/src/langs/nmv-cpp-ast.h +++ b/src/langs/nmv-cpp-ast.h @@ -28,18 +28,14 @@ #include "config.h" #include #include -#if defined(HAVE_TR1_MEMORY) -#include -#elif defined(HAVE_BOOST_TR1_MEMORY_HPP) -#include -#endif +#include #include "common/nmv-namespace.h" #include "common/nmv-api-macros.h" NEMIVER_BEGIN_NAMESPACE (nemiver) NEMIVER_BEGIN_NAMESPACE (cpp) -using std::tr1::shared_ptr; +using std::shared_ptr; using std::list; using std::string; diff --git a/src/langs/nmv-cpp-parser.cc b/src/langs/nmv-cpp-parser.cc index a04a972..52c8c5b 100644 --- a/src/langs/nmv-cpp-parser.cc +++ b/src/langs/nmv-cpp-parser.cc @@ -1831,7 +1831,7 @@ Parser::parse_decl_specifier_seq (list &a_result) break; } TypeSpecifierPtr type_specifier = - std::tr1::static_pointer_cast (decl); + std::static_pointer_cast (decl); //— const or volatile can be combined with any other type-specifier. // However, redundant cv-qualifiers are prohibited except if (type_specifier->is_cv_qualifier ()) { @@ -1852,7 +1852,7 @@ Parser::parse_decl_specifier_seq (list &a_result) //— long can be combined with double. //TODO: handle this SimpleTypeSpecPtr simple_type_spec = - std::tr1::static_pointer_cast (type_specifier); + std::static_pointer_cast (type_specifier); result.push_back (simple_type_spec); string type_name_str = simple_type_spec->get_name_as_string (); diff --git a/src/langs/nmv-cpp-parser.h b/src/langs/nmv-cpp-parser.h index 16f0b9d..5d6f651 100644 --- a/src/langs/nmv-cpp-parser.h +++ b/src/langs/nmv-cpp-parser.h @@ -26,6 +26,7 @@ #define __NMV_CPP_PARSER_H__ #include +#include #include "nmv-cpp-ast.h" #include "common/nmv-namespace.h" #include "common/nmv-api-macros.h" @@ -33,7 +34,7 @@ NEMIVER_BEGIN_NAMESPACE (nemiver) NEMIVER_BEGIN_NAMESPACE (cpp) -using std::tr1::shared_ptr; +using std::shared_ptr; using std::string; class NEMIVER_API Parser { diff --git a/src/uicommon/nmv-terminal.cc b/src/uicommon/nmv-terminal.cc index 42408c7..51d8fd2 100644 --- a/src/uicommon/nmv-terminal.cc +++ b/src/uicommon/nmv-terminal.cc @@ -36,11 +36,7 @@ #endif #include #include -#if defined(HAVE_TR1_TUPLE) -#include -#elif defined(HAVE_BOOST_TR1_TUPLE_HPP) -#include -#endif +#include #include #include #include @@ -60,7 +56,7 @@ NEMIVER_BEGIN_NAMESPACE(nemiver) using namespace common; -typedef std::tr1::tuple&> TerminalPrivDataTuple; @@ -76,9 +72,9 @@ on_button_press_signal (GtkWidget*, NEMIVER_TRY; THROW_IF_FAIL (a_tuple); - VteTerminal*& vte = std::tr1::get<0> (*a_tuple); - Gtk::Menu*& menu = std::tr1::get<1> (*a_tuple); - Glib::RefPtr& action_group = std::tr1::get<2> (*a_tuple); + VteTerminal*& vte = std::get<0> (*a_tuple); + Gtk::Menu*& menu = std::get<1> (*a_tuple); + Glib::RefPtr& action_group = std::get<2> (*a_tuple); THROW_IF_FAIL (vte); THROW_IF_FAIL (action_group);