Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/buildsystem2/src/cpptcl/changes_orxonox.diff @ 2641

Last change on this file since 2641 was 2641, checked in by rgrieder, 16 years ago
  • Update to boost 1.37: System library is now REQUIRED when finding boost even if you have less than boost 1.35. If this is problem, it's going to get quite ugly, but it's possible.
  • Fixed a problem in cpptcl.cc: Boost 1.36 introduced boost::exception which conflicted with std::exception (cpptcl makes use of 'using namespace'…)
  • Fixed two little bugs for tolua bind files and gcc warnings
File size: 2.0 KB
RevLine 
[2641]1--- cpptcl.cc   So Feb  8 23:14:34 2009
2+++ cpptcl.cc   So Feb  8 23:13:07 2009
3@@ -320,7 +320,7 @@
4 
5           post_process_policies(interp, pol, objv, false);
6      }
7-     catch (exception const &e)
8+     catch (std::exception const &e)
9      {
10           Tcl_SetResult(interp, const_cast<char*>(e.what()), TCL_VOLATILE);
11           return TCL_ERROR;
12@@ -363,7 +363,7 @@
13 
14           post_process_policies(interp, pol, objv, true);
15      }
16-     catch (exception const &e)
17+     catch (std::exception const &e)
18      {
19           Tcl_SetResult(interp, const_cast<char*>(e.what()), TCL_VOLATILE);
20           return TCL_ERROR;
21@@ -430,7 +430,7 @@
22                Tcl_GetString(Tcl_GetObjResult(interp)),
23                object_handler, static_cast<ClientData>(chb), 0);
24      }
25-     catch (exception const &e)
26+     catch (std::exception const &e)
27      {
28           Tcl_SetResult(interp, const_cast<char*>(e.what()), TCL_VOLATILE);
29           return TCL_ERROR;
30@@ -858,6 +858,18 @@
[2600]31      owner_ = true;
32 }
33 
34+interpreter::interpreter(string const &libpath)
35+{
36+     interp_ =  Tcl_CreateInterp();
37+     owner_ = true;
38+
39+     try
40+     {
41+        this->eval("set tcl_library " + libpath);
42+        Tcl_Init(this->interp_);
43+     } catch (...) {}
44+}
45+
46 interpreter::interpreter(Tcl_Interp *interp, bool owner)
47 {
48      interp_ =  interp;
[2641]49@@ -940,6 +952,10 @@
[2600]50      // delete all callbacks that were registered for given interpreter
51 
52      {
53+          // TODO: why could this probably be necessary? map::find of empty map
54+          // shouldn't be a problem.
55+          if (callbacks.size() == 0)
56+            return;
57           callback_map::iterator it = callbacks.find(interp);
58           if (it == callbacks.end())
59           {
[2641]60--- cpptcl.h    Wed Jan 28 20:56:11 2009
61+++ cpptcl.h    Sat Jan 24 12:52:54 2009
[2600]62@@ -467,6 +467,7 @@
63 {
64 public:
65      interpreter();
66+     interpreter(std::string const &libpath);
67      interpreter(Tcl_Interp *, bool owner = true);
68      ~interpreter();
69     
Note: See TracBrowser for help on using the repository browser.