#include <tcl.h>
-#ifdef WNT
-# pragma message( "Information: tcl"TCL_VERSION".lib is using as TCL library" )
-#endif // WNT
-
-
+// on MSVC, use #pragma to define name of the Tcl library to link with,
+// depending on Tcl version number
+#ifdef _MSC_VER
+ // two helper macros are needed to convert version number macro to string literal
+ #define STRINGIZE1(a) #a
+ #define STRINGIZE2(a) STRINGIZE1(a)
+ #pragma comment (lib, "tcl" STRINGIZE2(TCL_MAJOR_VERSION) STRINGIZE2(TCL_MINOR_VERSION) ".lib")
+ #undef STRINGIZE2
+ #undef STRINGIZE1
+ #pragma message ("Information: tcl"TCL_VERSION".lib is using as TCL library")
+#endif
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
// Author: Jean GAUTIER
// <jga@cobrax>
-
-
-
-
#include <tcl.h>
-#ifdef WNT
-# pragma message( "Information: tcl"TCL_VERSION".lib is using as TCL library" )
-#endif // WNT
-
+// on MSVC, use #pragma to define name of the Tcl library to link with,
+// depending on Tcl version number
+#ifdef _MSC_VER
+ // two helper macros are needed to convert version number macro to string literal
+ #define STRINGIZE1(a) #a
+ #define STRINGIZE2(a) STRINGIZE1(a)
+ #pragma comment (lib, "tcl" STRINGIZE2(TCL_MAJOR_VERSION) STRINGIZE2(TCL_MINOR_VERSION) ".lib")
+ #undef STRINGIZE2
+ #undef STRINGIZE1
+ #pragma message ("Information: tcl"TCL_VERSION".lib is using as TCL library")
+#endif
//extern "C" {
//#ifdef NEED_MATHERR
#include <WOKTools_ChDirValue.hxx>
#include <WOKTools_Messages.hxx>
-#ifdef WNT
-#include <WOKUtils_ShellManager.hxx>
-#define WOKUtils_ProcessManager WOKUtils_ShellManager
+#ifdef _WIN32
+ #include <WOKUtils_ShellManager.hxx>
+ #define WOKUtils_ProcessManager WOKUtils_ShellManager
#else
-#include <WOKUtils_ProcessManager.hxx>
-#endif // WNT
+ #include <WOKUtils_ProcessManager.hxx>
+#endif
#include <TCollection_HAsciiString.hxx>
#include <WOKTCL_DefaultCommand.hxx>
+// on MSVC, use #pragma to define name of the Tcl library to link with,
+// depending on Tcl version number
+#ifdef _MSC_VER
+ // two helper macros are needed to convert version number macro to string literal
+ #define STRINGIZE1(a) #a
+ #define STRINGIZE2(a) STRINGIZE1(a)
+ #pragma comment (lib, "tcl" STRINGIZE2(TCL_MAJOR_VERSION) STRINGIZE2(TCL_MINOR_VERSION) ".lib")
+ #undef STRINGIZE2
+ #undef STRINGIZE1
+#endif
+
//=======================================================================
//function : WOKTCL_Interpretor
//purpose :
//=======================================================================
Standard_CString WOKTclTools_Interpretor::Result() const
{
- return myInterp->result;
+ return Tcl_GetStringResult (myInterp);
}
//=======================================================================
#else
Standard_PCharacter* argv;
#endif
-
- if(Tcl_SplitList(myInterp, myInterp->result, &argc, &argv)) return Standard_True;
+
+ if (Tcl_SplitList (myInterp, Tcl_GetStringResult (myInterp), &argc, &argv))
+ {
+ return Standard_True;
+ }
for(i=0; i<argc; i++)
{