]> granicus.if.org Git - icinga2/commitdiff
Make VS 2013 happy
authorGunnar Beutner <gunnar.beutner@netways.de>
Sat, 27 Aug 2016 18:03:12 +0000 (20:03 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Sat, 27 Aug 2016 18:07:48 +0000 (20:07 +0200)
refs #12555

lib/base/console.cpp
lib/base/process.cpp
lib/base/string.hpp
lib/base/value.hpp

index 7d4257c19e4d3d835b1cd4cb8c29209c9fd41012..b9f9f3b8df49fb4c3458ad770d2ff066aca985ea 100644 (file)
@@ -25,7 +25,8 @@ using namespace icinga;
 
 static ConsoleType l_ConsoleType = Console_Dumb;
 
-INITIALIZE_ONCE([]() {
+static void InitializeConsole(void)
+{
        l_ConsoleType = Console_Dumb;
 
 #ifndef _WIN32
@@ -34,7 +35,9 @@ INITIALIZE_ONCE([]() {
 #else /* _WIN32 */
        l_ConsoleType = Console_Windows;
 #endif /* _WIN32 */
-});
+}
+
+INITIALIZE_ONCE(InitializeConsole);
 
 ConsoleColorTag::ConsoleColorTag(int color, ConsoleType consoleType)
        : m_Color(color), m_ConsoleType(consoleType)
index f29de86fe951f00a2499c8b763c1546cdcee830f..a2bba4d325385fe0af6779a7bbbfafe5229c7c27 100644 (file)
@@ -74,7 +74,8 @@ Process::~Process(void)
 #endif /* _WIN32 */
 }
 
-INITIALIZE_ONCE([]() {
+static void InitializeProcess(void)
+{
        for (int tid = 0; tid < IOTHREADS; tid++) {
 #ifdef _WIN32
                l_Events[tid] = CreateEvent(NULL, TRUE, FALSE, NULL);
@@ -101,7 +102,9 @@ INITIALIZE_ONCE([]() {
 #      endif /* HAVE_PIPE2 */
 #endif /* _WIN32 */
        }
-});
+}
+
+INITIALIZE_ONCE(InitializeProcess);
 
 void Process::ThreadInitialize(void)
 {
index 159fbdc1b5cf2cfc3a459a682669080afe1525f3..695f4201c6347ee336ad27265963b1267315cf9e 100644 (file)
@@ -77,8 +77,13 @@ public:
                : m_Data(n, c)
        { }
 
-       String(const String& other) = default;
-       String(String&& other) = default;
+       String(const String& other)
+               : m_Data(other)
+       { }
+
+       String(String&& other)
+               : m_Data(std::move(other.m_Data))
+       { }
 
        inline ~String(void)
        { }
@@ -88,8 +93,17 @@ public:
                : m_Data(begin, end)
        { }
 
-       String& operator=(const String& rhs) = default;
-       String& operator=(String&& rhs) = default;
+       String& operator=(const String& rhs)
+       {
+               m_Data = rhs.m_Data;
+               return *this;
+       }
+
+       String& operator=(String&& rhs)
+       {
+               m_Data = std::move(rhs.m_Data);
+               return *this;
+       }
 
        inline String& operator=(const std::string& rhs)
        {
index 60e213d4b51f6afffda9aaa093bcdbbe3d3dc670..56fed2c40c533b1f0b57eedbc7102b622020aee1 100644 (file)
@@ -99,16 +99,18 @@ public:
                : m_Value(String(value))
        { }
 
-       Value(const Value& other) = default;
+       Value(const Value& other)
+               : m_Value(other.m_Value)
+       { }
 
-#if BOOST_VERSION >= 105400
-       Value(Value&& other) = default;
-#else /* BOOST_VERSION */
        Value(Value&& other)
        {
+#if BOOST_VERSION >= 105400
+               m_Value = std::move(other.m_Value);
+#else /* BOOST_VERSION */
                m_Value.swap(other.m_Value);
-       }
 #endif /* BOOST_VERSION */
+       }
 
        inline Value(Object *value)
        {
@@ -132,17 +134,23 @@ public:
        operator double(void) const;
        operator String(void) const;
 
-       Value& operator=(const Value& other) = default;
+       Value& operator=(const Value& other)
+       {
+               m_Value = other.m_Value;
+               return *this;
+       }
 
-#if BOOST_VERSION >= 105400
-       Value& operator=(Value&& other) = default;
-#else /* BOOST_VERSION */
        Value& operator=(Value&& other)
        {
+#if BOOST_VERSION >= 105400
+               m_Value = std::move(other.m_Value);
+#else /* BOOST_VERSION */
                m_Value.swap(other.m_Value);
-       }
 #endif /* BOOST_VERSION */
 
+               return *this;
+       }
+
        bool operator==(bool rhs) const;
        bool operator!=(bool rhs) const;