- Fix install order computation losing some installed packages
[platform/upstream/libzypp.git] / devel / genclass.in
index a29c220..3307458 100644 (file)
@@ -10,9 +10,9 @@ EOF
 
 test -z "$1" && usage "Missing name!"
 
-TOPSRCDIR=$( cd @abs_top_srcdir@ && pwd )
+TOPSRCDIR=${XTOPSRCDIR:-$(cd @CMAKE_SOURCE_DIR@ && pwd)}
 test -z "$TOPSRCDIR" && {
-   echo "Dir does not exist '@abs_top_srcdir@'" >&2
+   echo "Dir does not exist '$TOPSRCDIR'" >&2
    exit 1
 }
 
@@ -112,7 +112,8 @@ ${INDENT}//
 ${INDENT}/** */
 ${INDENT}class ${CLASS}
 ${INDENT}{
-${INDENT}  friend std::ostream & operator<<( std::ostream & str, const ${CLASS} & obj )
+${INDENT}  friend std::ostream & operator<<( std::ostream & str, const ${CLASS} & obj );
+
 ${INDENT}public:
 ${INDENT}  /** Implementation  */
 ${INDENT}  class Impl;
@@ -145,7 +146,7 @@ function genCC() {
 cat <<EOF
 $(intro $CLASS_CC)
 #include <iostream>
-//#include "zypp/base/Logger.h"
+//#include "zypp/base/LogTools.h"
 
 #include "${INCLUDE_H}"
 
@@ -164,11 +165,10 @@ ${INDENT}{
 ${INDENT}public:
 ${INDENT}  /** Offer default Impl. */
 ${INDENT}  static shared_ptr<Impl> nullimpl()
-${INDENT}  { if ( ! _nullimpl ) _nullimpl.reset( new Impl ); return _nullimpl; }
-
-${INDENT}private:
-${INDENT}  /** Default Impl. */
-${INDENT}  static shared_ptr<Impl> _nullimpl;
+${INDENT}  {
+${INDENT}    static shared_ptr<Impl> _nullimpl( new Impl );
+${INDENT}    return _nullimpl;
+${INDENT}  }
 
 ${INDENT}private:
 ${INDENT}  friend Impl * rwcowClone<Impl>( const Impl * rhs );
@@ -178,10 +178,6 @@ ${INDENT}  { return new Impl( *this ); }
 ${INDENT}};
 ${INDENT}///////////////////////////////////////////////////////////////////
 
-${INDENT}shared_ptr<${CLASS}::Impl> ${CLASS}::Impl::_nullimpl;
-
-${INDENT}///////////////////////////////////////////////////////////////////
-
 ${INDENT}/** \relates ${CLASS}::Impl Stream output */
 ${INDENT}inline std::ostream & operator<<( std::ostream & str, const ${CLASS}::Impl & obj )
 ${INDENT}{