diff --git a/common/array.h b/common/array.h index 11082a7486b..18dc406255f 100644 --- a/common/array.h +++ b/common/array.h @@ -27,10 +27,7 @@ #include "common/algorithm.h" #include "common/textconsole.h" // For error() #include "common/memory.h" - -#ifdef USE_CXX11 #include "common/initializer_list.h" -#endif namespace Common { @@ -99,7 +96,6 @@ public: } } -#ifdef USE_CXX11 /** * Construct an array as a copy of the given array using the C++11 move semantic. */ @@ -124,7 +120,6 @@ public: if (_storage) Common::uninitialized_copy(list.begin(), list.end(), _storage); } -#endif /** * Construct an array by copying data from a regular array. @@ -258,7 +253,6 @@ public: return *this; } -#ifdef USE_CXX11 /** Assign the given array to this array using the C++11 move semantic. */ Array &operator=(Array &&old) { if (this == &old) @@ -275,7 +269,6 @@ public: return *this; } -#endif /** Return the size of the array. */ size_type size() const { diff --git a/common/initializer_list.h b/common/initializer_list.h index 9745a927545..024215c96a3 100644 --- a/common/initializer_list.h +++ b/common/initializer_list.h @@ -2,8 +2,6 @@ #define COMMON_INITIALIZER_LIST_H // Some compiler only have partial support for C++11 and we provide replacements for reatures not available. -#ifdef USE_CXX11 - #ifdef NO_CXX11_INITIALIZER_LIST namespace std { template class initializer_list { @@ -44,6 +42,4 @@ namespace std { #endif // NO_CXX11_INITIALIZER_LIST -#endif // USE_CXX11 - #endif // COMMON_INITIALIZER_LIST_H diff --git a/common/ptr.h b/common/ptr.h index 4196bb76599..2bc1005be53 100644 --- a/common/ptr.h +++ b/common/ptr.h @@ -27,10 +27,9 @@ #include "common/noncopyable.h" #include "common/safe-bool.h" #include "common/types.h" -#ifdef USE_CXX11 + /* For nullptr_t */ #include -#endif namespace Common { @@ -89,10 +88,8 @@ public: BasePtr() : _refCount(nullptr), _deletion(nullptr), _pointer(nullptr) { } -#ifdef USE_CXX11 explicit BasePtr(std::nullptr_t) : _refCount(nullptr), _deletion(nullptr), _pointer(nullptr) { } -#endif template explicit BasePtr(T2 *p) : _refCount(new RefValue(1)), _deletion(new BasePtrDeletionImpl(p)), _pointer(p) { @@ -286,10 +283,8 @@ public: SharedPtr() : BasePtr() { } -#ifdef USE_CXX11 SharedPtr(std::nullptr_t) : BasePtr() { } -#endif template explicit SharedPtr(T2 *p) : BasePtr(p) { @@ -352,10 +347,8 @@ public: WeakPtr() : BasePtr() { } -#ifdef USE_CXX11 WeakPtr(std::nullptr_t) : BasePtr() { } -#endif template explicit WeakPtr(T2 *p) : BasePtr(p) { diff --git a/common/scummsys.h b/common/scummsys.h index 655daa1a882..bc2a20e1760 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -482,9 +482,9 @@ typedef uint32 uintptr; #endif // -// std::nullptr_t when c++11 is enabled but this type is not available +// std::nullptr_t when this type is not available // -#if defined(USE_CXX11) && defined(NO_CXX11_NULLPTR_T) +#if defined(NO_CXX11_NULLPTR_T) namespace std { typedef decltype(nullptr) nullptr_t; } diff --git a/common/str.cpp b/common/str.cpp index b861426adff..67c4c88d0e7 100644 --- a/common/str.cpp +++ b/common/str.cpp @@ -172,11 +172,9 @@ bool String::contains(uint32 x) const { return false; } -#ifdef USE_CXX11 bool String::contains(char32_t x) const { return contains((uint32)x); } -#endif #ifndef SCUMMVM_UTIL diff --git a/common/str.h b/common/str.h index 70d7f982f27..02ed4978fae 100644 --- a/common/str.h +++ b/common/str.h @@ -116,9 +116,7 @@ public: bool contains(const char *x) const; bool contains(char x) const; bool contains(uint32 x) const; -#ifdef USE_CXX11 bool contains(char32_t x) const; -#endif /** * Simple DOS-style pattern matching function (understands * and ? like used in DOS). diff --git a/common/ustr.h b/common/ustr.h index 50a8073516d..3f9cea7d654 100644 --- a/common/ustr.h +++ b/common/ustr.h @@ -52,11 +52,7 @@ class String; * The presence of \0 characters in the string will cause undefined * behavior in some operations. */ -#ifdef USE_CXX11 typedef char32_t u32char_type_t; -#else -typedef uint32 u32char_type_t; -#endif class U32String : public BaseString { public: @@ -71,11 +67,9 @@ public: /** Construct a new string containing exactly @p len characters read from address @p str. */ U32String(const value_type *str, uint32 len) : BaseString(str, len) {} -#ifdef USE_CXX11 explicit U32String(const uint32 *str) : BaseString((const value_type *) str) {} U32String(const uint32 *str, uint32 len) : BaseString((const value_type *) str, len) {} U32String(const uint32 *beginP, const uint32 *endP) : BaseString((const value_type *) beginP, (const value_type *) endP) {} -#endif /** Construct a new string containing the characters between @p beginP (including) and @p endP (excluding). */ U32String(const value_type *beginP, const value_type *endP) : BaseString(beginP, endP) {} diff --git a/test/common/array.h b/test/common/array.h index d3828382053..56378c7beee 100644 --- a/test/common/array.h +++ b/test/common/array.h @@ -323,13 +323,11 @@ class ArrayTestSuite : public CxxTest::TestSuite } void test_array_constructor_list() { -#ifdef USE_CXX11 Common::Array array = {1, 42, 255}; TS_ASSERT_EQUALS(array.size(), 3U); TS_ASSERT_EQUALS(array[0], 1); TS_ASSERT_EQUALS(array[1], 42); TS_ASSERT_EQUALS(array[2], 255); -#endif } void test_array_constructor_count_copy_value() {