Hello, 

the attached patch fixes the compile errors with gcc-6. However, in the
packaging git the new upstream version has already been started to be
packaged, and it suggests that the upstream package is now split into
two packages. Also the wxwidgets patch doesn't apply cleanly. 
Hence I don't know how to handle this without interfering. 

My suggestion would be to upload a corrected 1.0.3 to get rid of the RC
bug and then see how to deal with the new upstream version.

Best, 
Gert 



 
Description: Make code compile with g++-6 and default C++ standart
 The code uses boost::shared_ptr, but with c++11 the definition
 of std::shared_ptr is also pulled in, so that it comes to name clashes.
 this patch fixes this by either fully specifying boost::shared_ptr
 or replacing the broad "using namespace std" by using directives of the
 std:: types that are artually used.
Author: Gert Wollny <gw.foss...@gmail.com>
Bug-Debian: https://bugs.debian.org/811795


--- a/src/mod_collage/Kernel/kernel.cpp
+++ b/src/mod_collage/Kernel/kernel.cpp
@@ -26,8 +26,8 @@
 
 using boost::shared_ptr;
 using std::vector;
+using std::string;
 
-using namespace std;
 using namespace XMLImplementation;
 using namespace Pictures;
 
@@ -379,4 +379,4 @@
 	shared_ptr<AbstractKernel> CiclicKernelFactory::getKernel(shared_ptr<Module> mod) {
 		return shared_ptr<AbstractKernel>(new CiclicKernel(mod));
 	}
-}
\ No newline at end of file
+}
--- a/src/mod_collage/Pictures/Transitions.cpp
+++ b/src/mod_collage/Pictures/Transitions.cpp
@@ -28,7 +28,6 @@
 
 using namespace spcore;
 using namespace mod_sdl;
-using namespace std;
 
 
 namespace Pictures {
@@ -258,4 +257,4 @@
 	SmartPtr<mod_sdl::CTypeSDLSurface> VibratePackagePictureTransition::getTransition(){
 		return m_transition->getTransition();
 	}
-}
\ No newline at end of file
+}
--- a/src/mod_collage/XMLImplementation/DBImages.cpp
+++ b/src/mod_collage/XMLImplementation/DBImages.cpp
@@ -28,10 +28,11 @@
 #include <SDL_main.h>
 
 using std::string;
+using std::pair;
+using std::map;
 using mod_sdl::CTypeSDLSurface;
 using boost::shared_ptr;
 using Poco::FileNotFoundException;
-using namespace std;
 
 namespace XMLImplementation{
 	
@@ -103,4 +104,4 @@
 		else  surf = it->second;
 		return surf;
 	}
-}
\ No newline at end of file
+}
--- a/src/mod_collage/XMLImplementation/LoadXML.cpp
+++ b/src/mod_collage/XMLImplementation/LoadXML.cpp
@@ -28,7 +28,7 @@
 
 using boost::shared_ptr;
 using Poco::XML::XMLReader;
-using namespace std;
+using std::string;
 
 namespace XMLImplementation{
 	/*
--- a/src/sphost/componenthelper.cpp
+++ b/src/sphost/componenthelper.cpp
@@ -61,7 +61,10 @@
 
 using namespace spcore;
 using namespace std;
-using namespace boost;
+
+using boost::tokenizer;
+using boost::trim;
+using boost::escaped_list_separator;
 
 
 #define GETTEXT_DOMAIN_SCRIPTS	"sitplus-sp"
@@ -825,14 +828,14 @@
 					ThrowError (err_msg, linenum, line.c_str(), m_file.c_str());
 				}
 
-				shared_ptr<ParsingContext> child= shared_ptr<ParsingContext>(new ParsingContext);
+				boost::shared_ptr<ParsingContext> child= boost::shared_ptr<ParsingContext>(new ParsingContext);
 
 				unsigned int child_linenum= 0;
 				child->PreProcess (ifs, true, child_linenum, fname);
 
 				// Try to add to the subcomponents map
-				pair<map<string,shared_ptr<ParsingContext> >::iterator,bool> ret;
-				ret= m_subcomponents.insert (pair<string,shared_ptr<ParsingContext> >(child->m_type, child));
+				pair<map<string,boost::shared_ptr<ParsingContext> >::iterator,bool> ret;
+				ret= m_subcomponents.insert (pair<string,boost::shared_ptr<ParsingContext> >(child->m_type, child));
 				if (ret.second== false) {
 					// Component already found
 					string error_msg("Parse error. Component ");
@@ -861,13 +864,13 @@
 				// Subcomponent found
 				CheckNumTokens (t, 1, 1, linenum, &line, &m_file);
 		
-				shared_ptr<ParsingContext> child= shared_ptr<ParsingContext>(new ParsingContext);
+				boost::shared_ptr<ParsingContext> child= boost::shared_ptr<ParsingContext>(new ParsingContext);
 
 				child->PreProcess (is, false, linenum, m_file);
 
 				// Try to add to the subcomponents map
-				pair<map<string,shared_ptr<ParsingContext> >::iterator,bool> ret;
-				ret= m_subcomponents.insert (pair<string,shared_ptr<ParsingContext> >(child->m_type, child));
+				pair<map<string,boost::shared_ptr<ParsingContext> >::iterator,bool> ret;
+				ret= m_subcomponents.insert (pair<string,boost::shared_ptr<ParsingContext> >(child->m_type, child));
 				if (ret.second== false) {
 					// Component already found
 					string error_msg("Parse error. Component ");
@@ -1030,7 +1033,7 @@
 				SmartPtr<IComponent> compo;
 				try {
 					// Check subcomponents
-					map<string,shared_ptr<ParsingContext> >::iterator itm= m_subcomponents.find (t[1]);
+					map<string,boost::shared_ptr<ParsingContext> >::iterator itm= m_subcomponents.find (t[1]);
 					if (itm!= m_subcomponents.end()) compo= itm->second->BuildComponent(t[2].c_str(), argc, argv);
 					else {
 						compo= getSpCoreRuntime()->CreateComponent(t[1].c_str(), t[2].c_str(), argc, argv);				
@@ -1201,7 +1204,7 @@
 	// Stores script lines with additional context information
 	vector< LineWithContext > m_lines;
 	// Subcomponents (stored in a vector for simplif
-	map<string,shared_ptr<ParsingContext> > m_subcomponents;
+	map<string,boost::shared_ptr<ParsingContext> > m_subcomponents;
 };
 
 SmartPtr<IComponent> ComponentHelper::SimpleParser (std::istream& is, const string& file)

Reply via email to