[Scummvm-git-logs] scummvm master -> c544e5119b301a4e3b9ba68f00d8b639e8317f3b
sev-
sev at scummvm.org
Sun Oct 31 09:55:23 UTC 2021
This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
63d1d81c5d CONFIGURE: Enable C++11 by default
886a8c43a1 CREATE_PROJECT: Drop cxx11 feature
a9267184f4 ENGINES: Drop cxx11 feature dependency. Now it is always preent
e5a60d34cc CREATE_PROJECT: Enable C++11 for Xcode by default
c544e5119b COMMON: Remove USE_CXX11 checks, it is now always present
Commit: 63d1d81c5d4fe574cd43232f7c46416c84b9e9ca
https://github.com/scummvm/scummvm/commit/63d1d81c5d4fe574cd43232f7c46416c84b9e9ca
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-10-31T11:40:43+02:00
Commit Message:
CONFIGURE: Enable C++11 by default
Changed paths:
configure
diff --git a/configure b/configure
index e942c853c4..e0e0c04c0b 100755
--- a/configure
+++ b/configure
@@ -181,7 +181,6 @@ _test_cxx11=no
_debug_build=auto
_release_build=auto
_optimizations=auto
-_use_cxx11=yes
_verbose_build=no
_text_console=no
_mt32emu=yes
@@ -284,7 +283,6 @@ add_feature vorbis "Vorbis file support" "_vorbis _tremor"
add_feature zlib "zlib" "_zlib"
add_feature lua "lua" "_lua"
add_feature fribidi "FriBidi" "_fribidi"
-add_feature cxx11 "c++11" "_use_cxx11"
add_feature test_cxx11 "Test C++11" "_test_cxx11"
# Directories for installing ScummVM.
@@ -1335,12 +1333,6 @@ for ac_option in $@; do
--backend=*)
_backend=`echo $ac_option | cut -d '=' -f 2`
;;
- --enable-c++11)
- _use_cxx11=yes
- ;;
- --disable-c++11)
- _use_cxx11=no
- ;;
--enable-debug)
_debug_build=yes
;;
@@ -1726,8 +1718,6 @@ switch)
datarootdir='${prefix}/data'
datadir='${datarootdir}'
docdir='${prefix}/doc'
- # Switch SDK has C++11 constructs so we must enable it
- _use_cxx11=yes
;;
wasm32-*)
_endian=little # the endian check below fails, but emscripten is always little endian anyway
@@ -2162,13 +2152,18 @@ fi
#
# Check whether the compiler supports C++11
#
+echo_n "Checking if compiler supports C++11... "
have_cxx11=no
cat > $TMPC << EOF
int main(int argc, char *argv[]) { if (argv == nullptr) return -1; else return 0; }
EOF
cc_check -std=c++11 && have_cxx11=yes
-if test "$_use_cxx11" = "yes" ; then
- _use_cxx11=$have_cxx11
+echo $have_cxx11
+
+if test "$have_cxx11" = "no" ; then
+ echo
+ echo "ScummVM requires C++11 compiler support. Please ensure your compiler supports it"
+ exit 1
fi
#
@@ -2178,10 +2173,6 @@ fi
#
if test "$have_gcc" = yes ; then
if test "$_cxx_major" -ge "3" ; then
- # Try to use ANSI mode when C++11 is disabled.
- if test "$_use_cxx11" = "no" ; then
- append_var CXXFLAGS "-ansi"
- fi
case $_host_os in
# newlib-based system include files suppress non-C89 function
# declarations under __STRICT_ANSI__, undefine it
@@ -2208,22 +2199,17 @@ elif test "$have_icc" = yes ; then
fi;
#
-# Update status about C++11 mode
+# Set status about C++11 mode
#
-echo_n "Building as C++11... "
-if test "$_use_cxx11" = "yes" ; then
- append_var CXXFLAGS "-std=c++11"
-fi
-echo $_use_cxx11
-define_in_config_if_yes "$_use_cxx11" 'USE_CXX11'
+append_var CXXFLAGS "-std=c++11"
#
# Additional tests for C++11 features that may not be present
#
-if test "$_use_cxx11" = "yes" ; then
- # Check if initializer list is available
- echo_n "Checking if C++11 initializer list is available... "
- cat > $TMPC << EOF
+
+# Check if initializer list is available
+echo_n "Checking if C++11 initializer list is available... "
+cat > $TMPC << EOF
#include <initializer_list>
#include <cstddef>
class FOO {
@@ -2233,30 +2219,29 @@ public:
};
int main(int argc, char *argv[]) { return 0; }
EOF
- cc_check
- if test "$TMPR" -eq 0; then
- echo yes
- else
- echo no
- define_in_config_if_yes yes 'NO_CXX11_INITIALIZER_LIST'
- fi
+cc_check
+if test "$TMPR" -eq 0; then
+ echo yes
+else
+ echo no
+ define_in_config_if_yes yes 'NO_CXX11_INITIALIZER_LIST'
+fi
- # Check if std::nullptr_t is available
- echo_n "Checking if C++11 std::nullptr_t is available..."
- cat > $TMPC << EOF
+# Check if std::nullptr_t is available
+echo_n "Checking if C++11 std::nullptr_t is available..."
+cat > $TMPC << EOF
#include <cstddef>
int main(int argc, char *argv[]) {
std::nullptr_t i = nullptr;
return 0;
}
EOF
- cc_check
- if test "$TMPR" -eq 0; then
- echo yes
- else
- echo no
- define_in_config_if_yes yes 'NO_CXX11_NULLPTR_T'
- fi
+cc_check
+if test "$TMPR" -eq 0; then
+ echo yes
+else
+ echo no
+ define_in_config_if_yes yes 'NO_CXX11_NULLPTR_T'
fi
#
Commit: 886a8c43a1f5a8745bfb8a0ac538d8f605f16440
https://github.com/scummvm/scummvm/commit/886a8c43a1f5a8745bfb8a0ac538d8f605f16440
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-10-31T11:45:08+02:00
Commit Message:
CREATE_PROJECT: Drop cxx11 feature
Changed paths:
devtools/create_project/create_project.cpp
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index c1535cf9f6..c2ae03513a 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -1094,7 +1094,6 @@ const Feature s_features[] = {
{ "tts", "USE_TTS", false, true, "Text to speech support"},
{"builtin-resources", "BUILTIN_RESOURCES", false, true, "include resources (e.g. engine data, fonts) into the binary"},
{ "detection-static", "USE_DETECTION_FEATURES_STATIC", false, true, "Static linking of detection objects for engines."},
- { "cxx11", "USE_CXX11", false, true, "Compile with c++11 support"}
};
const Tool s_tools[] = {
Commit: a9267184f466940895e1467eaf35fa4d5c8b570e
https://github.com/scummvm/scummvm/commit/a9267184f466940895e1467eaf35fa4d5c8b570e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-10-31T11:46:26+02:00
Commit Message:
ENGINES: Drop cxx11 feature dependency. Now it is always preent
Changed paths:
engines/ags/configure.engine
engines/groovie/configure.engine
engines/nancy/configure.engine
engines/petka/configure.engine
engines/playground3d/configure.engine
engines/stark/configure.engine
engines/tinsel/configure.engine
engines/twine/configure.engine
diff --git a/engines/ags/configure.engine b/engines/ags/configure.engine
index f092d79a0d..a0da95bdf6 100644
--- a/engines/ags/configure.engine
+++ b/engines/ags/configure.engine
@@ -1,3 +1,3 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine ags "Adventure Game Studio" yes "" "" "cxx11 16bit"
+add_engine ags "Adventure Game Studio" yes "" "" "16bit"
diff --git a/engines/groovie/configure.engine b/engines/groovie/configure.engine
index 30b30ecb72..f283731a58 100644
--- a/engines/groovie/configure.engine
+++ b/engines/groovie/configure.engine
@@ -1,4 +1,4 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
add_engine groovie "Groovie" yes "groovie2" "7th Guest" "highres"
-add_engine groovie2 "Groovie 2 games" no "" "" "jpeg 16bit cxx11"
+add_engine groovie2 "Groovie 2 games" no "" "" "jpeg 16bit"
diff --git a/engines/nancy/configure.engine b/engines/nancy/configure.engine
index 1a5b7d41e1..51fdfc16c3 100644
--- a/engines/nancy/configure.engine
+++ b/engines/nancy/configure.engine
@@ -1,3 +1,3 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine nancy "Nancy Drew" no "" "" "16bit highres cxx11 vorbis"
+add_engine nancy "Nancy Drew" no "" "" "16bit highres vorbis"
diff --git a/engines/petka/configure.engine b/engines/petka/configure.engine
index ddf38b8d1a..893ad48ce9 100644
--- a/engines/petka/configure.engine
+++ b/engines/petka/configure.engine
@@ -1,3 +1,3 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine petka "Red Comrades" yes "" "" "highres 16bit freetype2 cxx11"
+add_engine petka "Red Comrades" yes "" "" "highres 16bit freetype2"
diff --git a/engines/playground3d/configure.engine b/engines/playground3d/configure.engine
index a39709cd1a..bb84dffb56 100644
--- a/engines/playground3d/configure.engine
+++ b/engines/playground3d/configure.engine
@@ -1,3 +1,3 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine playground3d "Playground 3d: the testing and plaground environment for 3d renderers" no "" "" "cxx11 tinygl 16bit highres"
+add_engine playground3d "Playground 3d: the testing and plaground environment for 3d renderers" no "" "" "tinygl 16bit highres"
diff --git a/engines/stark/configure.engine b/engines/stark/configure.engine
index edeaa4d3f7..f2c96fac71 100644
--- a/engines/stark/configure.engine
+++ b/engines/stark/configure.engine
@@ -1,3 +1,3 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine stark "The Longest Journey" yes "" "" "cxx11 16bit highres freetype2 vorbis"
+add_engine stark "The Longest Journey" yes "" "" "16bit highres freetype2 vorbis"
diff --git a/engines/tinsel/configure.engine b/engines/tinsel/configure.engine
index 219df8cd04..c0f3e0a18d 100644
--- a/engines/tinsel/configure.engine
+++ b/engines/tinsel/configure.engine
@@ -1,3 +1,3 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine tinsel "Tinsel" yes "" "" "cxx11"
+add_engine tinsel "Tinsel" yes
diff --git a/engines/twine/configure.engine b/engines/twine/configure.engine
index a1f5eb7fac..ed21fa34f3 100644
--- a/engines/twine/configure.engine
+++ b/engines/twine/configure.engine
@@ -1,3 +1,3 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine twine "Little Big Adventure" yes "" "" "cxx11 highres"
+add_engine twine "Little Big Adventure" yes "" "" "highres"
Commit: e5a60d34ccd2f63d02db25527157d42aae90c8e8
https://github.com/scummvm/scummvm/commit/e5a60d34ccd2f63d02db25527157d42aae90c8e8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-10-31T11:52:06+02:00
Commit Message:
CREATE_PROJECT: Enable C++11 for Xcode by default
Changed paths:
devtools/create_project/xcode.cpp
diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp
index cf7784bb2f..2415fd871a 100644
--- a/devtools/create_project/xcode.cpp
+++ b/devtools/create_project/xcode.cpp
@@ -970,9 +970,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
ADD_SETTING(scummvm_Debug, "ALWAYS_SEARCH_USER_PATHS", "NO");
ADD_SETTING_QUOTE(scummvm_Debug, "USER_HEADER_SEARCH_PATHS", "$(SRCROOT) $(SRCROOT)/engines");
ADD_SETTING(scummvm_Debug, "CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED", "YES");
- if (CONTAINS_DEFINE(setup.defines, "USE_CXX11")) {
- ADD_SETTING(scummvm_Debug, "CLANG_CXX_LANGUAGE_STANDARD", "\"c++0x\"");
- }
+ ADD_SETTING(scummvm_Debug, "CLANG_CXX_LANGUAGE_STANDARD", "\"c++0x\"");
ADD_SETTING(scummvm_Debug, "CLANG_WARN_BOOL_CONVERSION", "YES");
ADD_SETTING(scummvm_Debug, "CLANG_WARN_CONSTANT_CONVERSION", "YES");
ADD_SETTING(scummvm_Debug, "CLANG_WARN_EMPTY_BODY", "YES");
@@ -1131,9 +1129,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
ADD_SETTING(scummvmOSX_Debug, "COPY_PHASE_STRIP", "NO");
ADD_SETTING_QUOTE(scummvmOSX_Debug, "DEBUG_INFORMATION_FORMAT", "dwarf");
ADD_SETTING_QUOTE(scummvmOSX_Debug, "FRAMEWORK_SEARCH_PATHS", "");
- if (CONTAINS_DEFINE(setup.defines, "USE_CXX11")) {
- ADD_SETTING(scummvmOSX_Debug, "CLANG_CXX_LANGUAGE_STANDARD", "\"c++0x\"");
- }
+ ADD_SETTING(scummvmOSX_Debug, "CLANG_CXX_LANGUAGE_STANDARD", "\"c++0x\"");
ADD_SETTING(scummvmOSX_Debug, "GCC_C_LANGUAGE_STANDARD", "c99");
ADD_SETTING(scummvmOSX_Debug, "GCC_ENABLE_CPP_EXCEPTIONS", "NO");
ADD_SETTING(scummvmOSX_Debug, "GCC_ENABLE_CPP_RTTI", "YES");
Commit: c544e5119b301a4e3b9ba68f00d8b639e8317f3b
https://github.com/scummvm/scummvm/commit/c544e5119b301a4e3b9ba68f00d8b639e8317f3b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-10-31T11:52:29+02:00
Commit Message:
COMMON: Remove USE_CXX11 checks, it is now always present
Changed paths:
common/array.h
common/initializer_list.h
common/ptr.h
common/scummsys.h
common/str.cpp
common/str.h
common/ustr.h
test/common/array.h
diff --git a/common/array.h b/common/array.h
index 11082a7486..18dc406255 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<T> &&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 9745a92754..024215c96a 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 T> 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 4196bb7659..2bc1005be5 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 <cstddef>
-#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<class T2>
explicit BasePtr(T2 *p) : _refCount(new RefValue(1)), _deletion(new BasePtrDeletionImpl<T2>(p)), _pointer(p) {
@@ -286,10 +283,8 @@ public:
SharedPtr() : BasePtr<T>() {
}
-#ifdef USE_CXX11
SharedPtr(std::nullptr_t) : BasePtr<T>() {
}
-#endif
template<class T2>
explicit SharedPtr(T2 *p) : BasePtr<T>(p) {
@@ -352,10 +347,8 @@ public:
WeakPtr() : BasePtr<T>() {
}
-#ifdef USE_CXX11
WeakPtr(std::nullptr_t) : BasePtr<T>() {
}
-#endif
template<class T2>
explicit WeakPtr(T2 *p) : BasePtr<T>(p) {
diff --git a/common/scummsys.h b/common/scummsys.h
index 655daa1a88..bc2a20e176 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 b861426adf..67c4c88d0e 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 70d7f982f2..02ed4978fa 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 50a8073516..3f9cea7d65 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<u32char_type_t> {
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<u32char_type_t>(str, len) {}
-#ifdef USE_CXX11
explicit U32String(const uint32 *str) : BaseString<u32char_type_t>((const value_type *) str) {}
U32String(const uint32 *str, uint32 len) : BaseString<u32char_type_t>((const value_type *) str, len) {}
U32String(const uint32 *beginP, const uint32 *endP) : BaseString<u32char_type_t>((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<u32char_type_t>(beginP, endP) {}
diff --git a/test/common/array.h b/test/common/array.h
index d382838205..56378c7bee 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<int> 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() {
More information about the Scummvm-git-logs
mailing list