Author: brane
Date: Tue Dec 18 18:14:13 2018
New Revision: 1849202

URL: http://svn.apache.org/viewvc?rev=1849202&view=rev
Log:
Switch default C++ language level to C++11 on Unix.

 - "Modern" C++ (C++11 and later) has become ubiquitous.
 - We already need C++11 to compile the KWallet plugin.
 - JavaHL compiles in C++11 mode, otherwise it would not build on Windows
   with newer versions of MSVC.
 - Our code code is not affected at all.

* configure.ac: Display the C and C++ language level flags.
* build/ac-macros/compiler.m4
  (SVN_CXX_MODE_SETUP): Switch to C++11.
  (SVN_CXX_MODE_SETUP11): Remove; it's now obsolete.
* build/ac-macros/kwallet.m4
  (SVN_LIB_KWALLET): Remove reference to SVN_CXX_MODE_SETUP11.

* subversion/bindings/javahl/native/RemoteSession.cpp
  (compare_c_strings::operator()): Make this method const to avoid a warning.

Modified:
    subversion/trunk/build/ac-macros/compiler.m4
    subversion/trunk/build/ac-macros/kwallet.m4
    subversion/trunk/configure.ac
    subversion/trunk/subversion/bindings/javahl/native/RemoteSession.cpp

Modified: subversion/trunk/build/ac-macros/compiler.m4
URL: 
http://svn.apache.org/viewvc/subversion/trunk/build/ac-macros/compiler.m4?rev=1849202&r1=1849201&r2=1849202&view=diff
==============================================================================
--- subversion/trunk/build/ac-macros/compiler.m4 (original)
+++ subversion/trunk/build/ac-macros/compiler.m4 Tue Dec 18 18:14:13 2018
@@ -102,7 +102,7 @@ AC_DEFUN([SVN_CXX_MODE_SETUP],
   if test "$GXX" = "yes"; then
     dnl Find flags to force C++98 mode
                   dnl g++ and clang++
-    SVN_CXXFLAGS_ADD_IFELSE([-std=c++98])
+    SVN_CXXFLAGS_ADD_IFELSE([-std=c++11])
   fi
 
   CXXMODEFLAGS="$CXXFLAGS"
@@ -126,18 +126,3 @@ AC_DEFUN([SVN_CXX_MODE_SETUP],
     SVN_CXXFLAGS_ADD_IFELSE([-Werror=unknown-warning-option])
   fi
 ])
-
-dnl The KWallet provider needs to use C++11 mode when using KDE 5
-AC_DEFUN([SVN_CXX_MODE_SETUP11],
-[
-  CXXFLAGS_KEEP="$CXXFLAGS"
-  CXXFLAGS=""
-
-  if test "$GXX" = "yes"; then
-    SVN_CXXFLAGS_ADD_IFELSE([-std=c++11])
-  fi
-
-  CXXMODEFLAGS="$CXXFLAGS"
-  CXXFLAGS="$CXXFLAGS_KEEP"
-  AC_SUBST(CXXMODEFLAGS)
-])

Modified: subversion/trunk/build/ac-macros/kwallet.m4
URL: 
http://svn.apache.org/viewvc/subversion/trunk/build/ac-macros/kwallet.m4?rev=1849202&r1=1849201&r2=1849202&view=diff
==============================================================================
--- subversion/trunk/build/ac-macros/kwallet.m4 (original)
+++ subversion/trunk/build/ac-macros/kwallet.m4 Tue Dec 18 18:14:13 2018
@@ -83,10 +83,6 @@ AC_DEFUN(SVN_LIB_KWALLET,
                   fi
                 fi
                 if test -n "$KDE_CONFIG"; then
-                  if test $kde_config_name = "kf5-config"; then
-                    dnl KF5 does not compile with -std=c++98
-                    SVN_CXX_MODE_SETUP11
-                  fi
                   old_CXXFLAGS="$CXXFLAGS"
                   old_LDFLAGS="$LDFLAGS"
                   old_LIBS="$LIBS"

Modified: subversion/trunk/configure.ac
URL: 
http://svn.apache.org/viewvc/subversion/trunk/configure.ac?rev=1849202&r1=1849201&r2=1849202&view=diff
==============================================================================
--- subversion/trunk/configure.ac (original)
+++ subversion/trunk/configure.ac Tue Dec 18 18:14:13 2018
@@ -1164,9 +1164,11 @@ fi
 
 dnl Dump the current compiler options
 AC_MSG_NOTICE([C compiler flags: $CFLAGS])
+AC_MSG_NOTICE([  language-level: $CMODEFLAGS])
 AC_MSG_NOTICE([    user-defined: $CUSERFLAGS])
 AC_MSG_NOTICE([ maintainer-mode: $CMAINTAINERFLAGS])
 AC_MSG_NOTICE([C++ compiler flags: $CXXFLAGS])
+AC_MSG_NOTICE([    language-level: $CXXMODEFLAGS])
 AC_MSG_NOTICE([      user-defined: $CXXUSERFLAGS])
 AC_MSG_NOTICE([   maintainer-mode: $CXXMAINTAINERFLAGS])
 

Modified: subversion/trunk/subversion/bindings/javahl/native/RemoteSession.cpp
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/RemoteSession.cpp?rev=1849202&r1=1849201&r2=1849202&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/RemoteSession.cpp 
(original)
+++ subversion/trunk/subversion/bindings/javahl/native/RemoteSession.cpp Tue 
Dec 18 18:14:13 2018
@@ -169,7 +169,7 @@ RemoteSession::open(jint jretryAttempts,
 namespace{
   struct compare_c_strings
   {
-    bool operator()(const char* a, const char* b)
+    bool operator()(const char* a, const char* b) const
       {
         return (0 < std::strcmp(a, b));
       }


Reply via email to