This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Review: tclcl -- not yet good to go


This package really needs a man page for the tcl2c++ utility and some sort of
documentation/example/description of what tclcl is. Lack of such shouldn't
prevent the package from being released, but in this state it's very hard to
figure out what this thing is really supposed to do, except perhaps by reading
the headers.

I tried to verify whether tcl2c++ works thusly:

echo -E 'puts "Hello, World!\n"' > foo.tcl
tcl2c++ foo foo.tcl > foo.cpp
g++ -c foo.cpp

This gives me:

In file included from foo.cpp:3:
/usr/include/tclcl.h: In member function `char* Tcl::result() const':
/usr/include/tclcl.h:83: error: invalid conversion from `const char*' to `char*
   '
/usr/include/tclcl.h: In member function `char* Tcl::var(const char*, int)':
/usr/include/tclcl.h:107: error: invalid conversion from `const char*' to `
   char*'

Making a couple small changes to tclcl.h:

--- tclcl.h.orig        2004-02-03 23:31:49.578125000 -0800
+++ /usr/include/tclcl.h        2004-02-03 23:19:56.953125000 -0800
@@ -80,7 +80,7 @@
                return Tcl_GetDoubleFromObj(tcl_, objResult(), pDbl);
        }
        void result(Tcl_Obj *pObj) { Tcl_SetObjResult(tcl_, pObj); }
-       inline char* result() const { return Tcl_GetStringResult(tcl_); }
+       inline const char* result() const { return Tcl_GetStringResult(tcl_); }
 #else /* TCL_MAJOR_VERSION >= 8 */     
        inline char* result() const { return (tcl_->result); }
 #endif  /* TCL_MAJOR_VERSION >= 8 */
@@ -103,7 +103,7 @@
                if (Tcl_EvalFile(tcl_, (char*)file) != TCL_OK)
                        error(file);
        }
-       inline char* var(const char* varname, int flags = TCL_GLOBAL_ONLY) {
+       inline const char* var(const char* varname, int flags =
TCL_GLOBAL_ONLY) {
                return (Tcl_GetVar(tcl_, (char*)varname, flags));
        }
        /*

Allows me to compile my trivial example, note this is with the current version
of gcc/g++.

I don't know how to run it though, would help to verify that as well.

The build works beautifully, no complaints there.

-- 
Rafael


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]