Use gcc-c++ >= 4.5
authorMichael Andres <ma@suse.de>
Thu, 6 Oct 2011 15:05:00 +0000 (17:05 +0200)
committerMichael Andres <ma@suse.de>
Thu, 6 Oct 2011 15:05:00 +0000 (17:05 +0200)
CMakeLists.txt
libzypp.spec.cmake
zypp/ProblemSolution.cc
zypp/base/Easy.h
zypp/base/ProfilingFormater.cc
zypp/parser/ProductFileReader.cc
zypp/target/rpm/RpmHeader.cc

index f4d9a68..c975716 100644 (file)
@@ -25,7 +25,7 @@ include(CheckCXXCompilerFlag)
 CHECK_C_COMPILER_FLAG("-Werror=format-security" CC_FORMAT_SECURITY)
 CHECK_CXX_COMPILER_FLAG("-Werror=format-security" CXX_FORMAT_SECURITY)
 
-SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fPIC -g -Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wl,-as-needed" )
+SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fPIC -g -Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wl,-as-needed -std=c++0x" )
 SET( CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   -fno-strict-aliasing -fPIC -g -Wall -Wl,-as-needed" )
 
 set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3" )
index 603b41f..557a6d5 100644 (file)
@@ -44,7 +44,7 @@ BuildRequires:  hal-devel
 BuildRequires:  boost-devel
 BuildRequires:  dejagnu
 BuildRequires:  doxygen
-BuildRequires:  gcc-c++
+BuildRequires:  gcc-c++ >= 4.5
 BuildRequires:  gettext-devel
 BuildRequires:  graphviz
 BuildRequires:  libxml2-devel
index cc741f3..cbaf555 100644 (file)
@@ -96,17 +96,18 @@ ProblemSolution::apply (solver::detail::Resolver & resolver)
        solver::detail::SolutionAction_constPtr action = *iter;
        if (! action->execute (resolver))
        {
+           WAR << "apply solution action failed: " << action << endl;
            ret = false;
            break;
        }
     }
-    return true;
+    return ret;
 }
 
 
 /**
  * Add an action to the actions list.
- **/ 
+ **/
 void
 ProblemSolution::addAction (solver::detail::SolutionAction_constPtr action)
 {
index 4a565ce..e1809a3 100644 (file)
@@ -21,7 +21,7 @@
  *  }
  * \endcode
 */
-#define for_(IT,BEG,END) for ( typeof(BEG) IT = BEG, _for_end = END; IT != _for_end; ++IT )
+#define for_(IT,BEG,END) for ( auto IT = BEG, _for_end = END; IT != _for_end; ++IT )
 #define for_each_(IT,CONT) for_( IT, CONT.begin(), CONT.end() )
 
 /** Simple C-array iterator
index 28a21ac..63fc9ac 100644 (file)
@@ -37,7 +37,7 @@ namespace zypp
     ///////////////////////////////////////////////////////////////////
     // ProfilingFormater
     ///////////////////////////////////////////////////////////////////
-    
+
     std::string ProfilingFormater::format( const std::string & group_r,
                                                   logger::LogLevel    level_r,
                                                   const char *        file_r,
@@ -45,11 +45,10 @@ namespace zypp
                                                   int                 line_r,
                                                   const std::string & message_r )
     {
-       struct timeval tp;
-       int rtn;
-       rtn = gettimeofday( &tp, NULL);
-       
-        return str::form( "%ld.%ld [%d] <%d> %s(%s):%d %s",
+      struct timeval tp;
+      gettimeofday( &tp, NULL);
+
+      return str::form( "%ld.%ld [%d] <%d> %s(%s):%d %s",
                         tp.tv_sec,
                         tp.tv_usec,
                         level_r,
index c6d07ff..b68d4cd 100644 (file)
@@ -147,7 +147,7 @@ namespace zypp
             ("arch",          MANDTAORY,  xml::parseDefAssign( _pdata._arch ) )
             ("shortsummary",  OPTIONAL,   xml::parseDefAssign( _pdata._shortName ) )
             ("summary",       MULTIPLE_OPTIONAL, xml::parseDefAssign( _ttext )( "lang", _tlocale )
-                                         >>bind( &ProductNode::doneLocalizedDefault, this, _1, ref(_pdata._summary) ))
+                                         >>bind( &ProductNode::doneLocalizedDefault, this, _1, boost::ref(_pdata._summary) ))
             ("productline",   OPTIONAL,   xml::parseDefAssign( _pdata._productline ) )
             ("register",      OPTIONAL)
             ("updaterepokey", OPTIONAL,   xml::parseDefAssign( _pdata._updaterepokey ) )
index b83bcba..2ea29fa 100644 (file)
@@ -914,9 +914,9 @@ std::list<FileInfo> RpmHeader::tag_fileinfos() const
                         md5sums[i],
                         uid,
                         gid,
-                        filemodes[i],
+                        mode_t(filemodes[i]),
                         filemtimes[i],
-                        fileflags[i] & RPMFILE_GHOST,
+                        bool(fileflags[i] & RPMFILE_GHOST),
                         filelinks[i]
                       };