[Scummvm-git-logs] scummvm-tools master -> 100ae745826e3fe9c2b93659c89ea344194a1606
criezy
criezy at scummvm.org
Thu Sep 8 00:15:16 CEST 2016
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm-tools' repo located at https://github.com/scummvm/scummvm-tools .
Summary:
03fc92527a TOOLS: Fix compilation of pegasus_save_types
100ae74582 TOOLS: Compile with c++11 by default if supported
Commit: 03fc92527ad3f37c73493f7246ad3644d069178b
https://github.com/scummvm/scummvm-tools/commit/03fc92527ad3f37c73493f7246ad3644d069178b
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2016-09-07T23:12:40+01:00
Commit Message:
TOOLS: Fix compilation of pegasus_save_types
The last argument of FSPathMakeRef is an optional pointer to a bool
and not a bool (if a non-null pointer is given FSPathMakeRef set the
bool value to true if the path is a directory and false otherwise).
Changed paths:
engines/pegasus/pegasus_save_types.cpp
diff --git a/engines/pegasus/pegasus_save_types.cpp b/engines/pegasus/pegasus_save_types.cpp
index 47af63b..b8258c1 100755
--- a/engines/pegasus/pegasus_save_types.cpp
+++ b/engines/pegasus/pegasus_save_types.cpp
@@ -76,7 +76,7 @@ int main(int argc, char **argv) {
FSCatalogInfo catInfo;
FSRef ref;
- if (!FSPathMakeRef((const UInt8 *)argv[1], &ref, false)) {
+ if (!FSPathMakeRef((const UInt8 *)argv[1], &ref, 0)) {
FSGetCatalogInfo(&ref, kFSCatInfoFinderInfo, &catInfo, 0, 0, 0);
FileInfo *info = (FileInfo *)catInfo.finderInfo;
info->fileCreator = creator;
Commit: 100ae745826e3fe9c2b93659c89ea344194a1606
https://github.com/scummvm/scummvm-tools/commit/100ae745826e3fe9c2b93659c89ea344194a1606
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2016-09-07T23:14:59+01:00
Commit Message:
TOOLS: Compile with c++11 by default if supported
This also adds an option to disable the use of c++11 and compile
with -ansi instead as we did before. But compilation of GUI tools
with a recent version of g++ will break when using -ansi.
Changed paths:
configure
diff --git a/configure b/configure
index 5cb8181..c80cb24 100755
--- a/configure
+++ b/configure
@@ -85,6 +85,7 @@ _debug_build=auto
_release_build=auto
_verbose_build=no
_enable_prof=no
+_use_cxx11=yes
# Default commands
_ranlib=ranlib
_strip=strip
@@ -335,6 +336,7 @@ Special configuration feature:
--host=HOST cross-compile to target HOST (arm-linux, ...)
Optional Features:
+ --disable-c++11 disable building as C++11 when the compiler allows that
--disable-debug disable building with debugging symbols
--enable-Werror treat warnings as errors
--enable-profiling enable profiling
@@ -463,6 +465,12 @@ for ac_option in $@; do
--disable-debug)
_debug_build=no
;;
+ --enable-c++11)
+ _use_cxx11=yes
+ ;;
+ --disable-c++11)
+ _use_cxx11=no
+ ;;
--enable-Werror)
CXXFLAGS="$CXXFLAGS -Werror"
;;
@@ -876,33 +884,55 @@ else
fi
#
+# Check whether the 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
+fi
+
+#
# Setup compiler specific CXXFLAGS now that we know the compiler version.
# Foremost, this means enabling various warnings.
# In addition, we set CXX_UPDATE_DEP_FLAG for GCC >= 3.0 and for ICC.
#
if test "$have_gcc" = yes ; then
if test "$_cxx_major" -ge "3" ; then
- case $_host_os in
- # newlib-based system include files suppress non-C89 function
- # declarations under __STRICT_ANSI__
- amigaos* | android | dreamcast | ds | gamecube | mingw* | n64 | psp | ps2 | wii | wince )
- ;;
- *)
- CXXFLAGS="$CXXFLAGS -ansi"
- ;;
- esac
+ # Try to use ANSI mode when C++11 is disabled.
+ if test "$_use_cxx11" = "no" ; then
+ case $_host_os in
+ # newlib-based system include files suppress non-C89 function
+ # declarations under __STRICT_ANSI__
+ amigaos* | android | dreamcast | ds | gamecube | mingw* | n64 | psp | ps2 | wii | wince )
+ ;;
+ *)
+ CXXFLAGS="$CXXFLAGS -ansi"
+ ;;
+ esac
+ fi
CXXFLAGS="$CXXFLAGS -W -Wno-unused-parameter"
add_line_to_config_mk 'HAVE_GCC3 = 1'
add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP'
- fi;
+ fi
if test "$_cxx_major" -eq 4 && test "$_cxx_minor" -ge 3 || \
test "$_cxx_major" -gt 4 ; then
CXXFLAGS="$CXXFLAGS -Wno-empty-body"
else
CXXFLAGS="$CXXFLAGS -Wconversion"
- fi;
-fi;
+ fi
+fi
+
+echo_n "Building as C++11... "
+if test "$_use_cxx11" = "yes" ; then
+ CXXFLAGS="$CXXFLAGS -std=c++11"
+fi
+echo $_use_cxx11
+
# By default, we add -pedantic to the CXXFLAGS to catch some potentially
# non-portable constructs, like use of GNU extensions.
More information about the Scummvm-git-logs
mailing list