[Orxonox-commit 3613] r8298 - in code/branches/kicklib2: cmake src/external/cpptcl

rgrieder at orxonox.net rgrieder at orxonox.net
Fri Apr 22 18:23:45 CEST 2011


Author: rgrieder
Date: 2011-04-22 18:23:45 +0200 (Fri, 22 Apr 2011)
New Revision: 8298

Modified:
   code/branches/kicklib2/cmake/CompilerConfigMSVC.cmake
   code/branches/kicklib2/src/external/cpptcl/changes_orxonox.diff
   code/branches/kicklib2/src/external/cpptcl/cpptcl.cc
Log:
Fixed build for MSVC 10: disabling the C++0x features seems a bad idea because some boost code relies on it for the new Visual Studio version.
Leaving it enabled breaks cpptcl though --> fixed.

Modified: code/branches/kicklib2/cmake/CompilerConfigMSVC.cmake
===================================================================
--- code/branches/kicklib2/cmake/CompilerConfigMSVC.cmake	2011-04-22 15:59:40 UTC (rev 8297)
+++ code/branches/kicklib2/cmake/CompilerConfigMSVC.cmake	2011-04-22 16:23:45 UTC (rev 8298)
@@ -68,11 +68,6 @@
 # Note: It hasn't been checked yet whether we have code that might break
 #ADD_COMPILER_FLAGS("-fp:fast" CACHE)
 
-# Newer MSVC versions come with std::shared_ptr which conflicts with
-# boost::shared_ptr in cpptcl. And since we don't yet use the new C++ standard
-# anyway, disable it completely.
-ADD_COMPILER_FLAGS("-D_HAS_CPP0X=0" CACHE)
-
 # Use Link time code generation for Release config if ORXONOX_RELEASE is defined
 IF(ORXONOX_RELEASE)
   ADD_COMPILER_FLAGS("-GL" ReleaseAll CACHE)

Modified: code/branches/kicklib2/src/external/cpptcl/changes_orxonox.diff
===================================================================
--- code/branches/kicklib2/src/external/cpptcl/changes_orxonox.diff	2011-04-22 15:59:40 UTC (rev 8297)
+++ code/branches/kicklib2/src/external/cpptcl/changes_orxonox.diff	2011-04-22 16:23:45 UTC (rev 8298)
@@ -1,7 +1,35 @@
---- cpptcl.cc	So Feb  8 23:14:34 2009
-+++ cpptcl.cc	So Feb  8 23:13:07 2009
-@@ -320,7 +320,7 @@
+--- cpptcl.cc	Fri Apr 22 12:18:47 2011
++++ cpptcl.cc	Fri Apr 22 12:20:02 2011
+@@ -16,7 +16,8 @@
+ using namespace Tcl;
+ using namespace Tcl::details;
+ using namespace std;
+-using namespace boost;
++// boost::shared_ptr conflicts with the new std::shared_ptr
++//using namespace boost;
  
+ 
+ result::result(Tcl_Interp *interp) : interp_(interp) {}
+@@ -166,7 +167,7 @@
+ {
+ 
+ // map of polymorphic callbacks
+-typedef map<string, shared_ptr<callback_base> > callback_interp_map;
++typedef map<string, boost::shared_ptr<callback_base> > callback_interp_map;
+ typedef map<Tcl_Interp *, callback_interp_map> callback_map;
+ 
+ callback_map callbacks;
+@@ -179,7 +180,7 @@
+ policies_map call_policies;
+ 
+ // map of object handlers
+-typedef map<string, shared_ptr<class_handler_base> > class_interp_map;
++typedef map<string, boost::shared_ptr<class_handler_base> > class_interp_map;
+ typedef map<Tcl_Interp *, class_interp_map> class_handlers_map;
+ 
+ class_handlers_map class_handlers;
+@@ -320,7 +321,7 @@
+ 
            post_process_policies(interp, pol, objv, false);
       }
 -     catch (exception const &e)
@@ -9,7 +37,7 @@
       {
            Tcl_SetResult(interp, const_cast<char*>(e.what()), TCL_VOLATILE);
            return TCL_ERROR;
-@@ -363,7 +363,7 @@
+@@ -363,7 +364,7 @@
  
            post_process_policies(interp, pol, objv, true);
       }
@@ -18,7 +46,7 @@
       {
            Tcl_SetResult(interp, const_cast<char*>(e.what()), TCL_VOLATILE);
            return TCL_ERROR;
-@@ -430,7 +430,7 @@
+@@ -430,7 +431,7 @@
                 Tcl_GetString(Tcl_GetObjResult(interp)),
                 object_handler, static_cast<ClientData>(chb), 0);
       }
@@ -27,3 +55,37 @@
       {
            Tcl_SetResult(interp, const_cast<char*>(e.what()), TCL_VOLATILE);
            return TCL_ERROR;
+@@ -490,7 +491,7 @@
+ }
+ 
+ void class_handler_base::register_method(string const &name,
+-     shared_ptr<object_cmd_base> ocb, policies const &p)
++     boost::shared_ptr<object_cmd_base> ocb, policies const &p)
+ {
+      methods_[name] = ocb;
+      policies_[name] = p;
+@@ -989,7 +990,7 @@
+ }
+ 
+ void interpreter::add_function(string const &name,
+-     shared_ptr<callback_base> cb, policies const &p)
++     boost::shared_ptr<callback_base> cb, policies const &p)
+ {
+      Tcl_CreateObjCommand(interp_, name.c_str(),
+           callback_handler, 0, 0);
+@@ -999,13 +1000,13 @@
+ }
+ 
+ void interpreter::add_class(string const &name,
+-     shared_ptr<class_handler_base> chb)
++     boost::shared_ptr<class_handler_base> chb)
+ {
+      class_handlers[interp_][name] = chb;
+ }
+ 
+ void interpreter::add_constructor(string const &name,
+-     shared_ptr<class_handler_base> chb, shared_ptr<callback_base> cb,
++     boost::shared_ptr<class_handler_base> chb, boost::shared_ptr<callback_base> cb,
+      policies const &p)
+ {
+      Tcl_CreateObjCommand(interp_, name.c_str(),

Modified: code/branches/kicklib2/src/external/cpptcl/cpptcl.cc
===================================================================
--- code/branches/kicklib2/src/external/cpptcl/cpptcl.cc	2011-04-22 15:59:40 UTC (rev 8297)
+++ code/branches/kicklib2/src/external/cpptcl/cpptcl.cc	2011-04-22 16:23:45 UTC (rev 8298)
@@ -16,7 +16,8 @@
 using namespace Tcl;
 using namespace Tcl::details;
 using namespace std;
-using namespace boost;
+// boost::shared_ptr conflicts with the new std::shared_ptr
+//using namespace boost;
 
 
 result::result(Tcl_Interp *interp) : interp_(interp) {}
@@ -166,7 +167,7 @@
 {
 
 // map of polymorphic callbacks
-typedef map<string, shared_ptr<callback_base> > callback_interp_map;
+typedef map<string, boost::shared_ptr<callback_base> > callback_interp_map;
 typedef map<Tcl_Interp *, callback_interp_map> callback_map;
 
 callback_map callbacks;
@@ -179,7 +180,7 @@
 policies_map call_policies;
 
 // map of object handlers
-typedef map<string, shared_ptr<class_handler_base> > class_interp_map;
+typedef map<string, boost::shared_ptr<class_handler_base> > class_interp_map;
 typedef map<Tcl_Interp *, class_interp_map> class_handlers_map;
 
 class_handlers_map class_handlers;
@@ -490,7 +491,7 @@
 }
 
 void class_handler_base::register_method(string const &name,
-     shared_ptr<object_cmd_base> ocb, policies const &p)
+     boost::shared_ptr<object_cmd_base> ocb, policies const &p)
 {
      methods_[name] = ocb;
      policies_[name] = p;
@@ -989,7 +990,7 @@
 }
 
 void interpreter::add_function(string const &name,
-     shared_ptr<callback_base> cb, policies const &p)
+     boost::shared_ptr<callback_base> cb, policies const &p)
 {
      Tcl_CreateObjCommand(interp_, name.c_str(),
           callback_handler, 0, 0);
@@ -999,13 +1000,13 @@
 }
 
 void interpreter::add_class(string const &name,
-     shared_ptr<class_handler_base> chb)
+     boost::shared_ptr<class_handler_base> chb)
 {
      class_handlers[interp_][name] = chb;
 }
 
 void interpreter::add_constructor(string const &name,
-     shared_ptr<class_handler_base> chb, shared_ptr<callback_base> cb,
+     boost::shared_ptr<class_handler_base> chb, boost::shared_ptr<callback_base> cb,
      policies const &p)
 {
      Tcl_CreateObjCommand(interp_, name.c_str(),




More information about the Orxonox-commit mailing list