Dear all,

I got a chance to play with Mozart on "Windows Vista" in the last days and could solve the problem with the GUI components (<http://lists.gforge.info.ucl.ac.be/pipermail/mozart-users/2007/008998.html>).

The attached patch can be applied like this:

> cd mozart-1.3.2.20060615
> patch -p1 <../emulator_2007_12_29.patch

If you want to use Oz on Vista but don't want to compile the system yourself, you might download this version of "emulator.dll": <http://code.google.com/p/oz-code/downloads/list>

The change is minimal: I removed two uses of the sprintf "%n"-specifier in the Emulator-Tcl-communication layer (/platform/emulator/tk.cc). Microsoft decided to drop support for this specifier with Vista. As a result, the names of Tk widgets were mangled.

Cheeers,
Wolfgang

diff -x '*~' -x '*.ozf' -urp 
mozart-1.3.2.20060615_original/platform/emulator/tk.cc 
mozart-1.3.2.20060615/platform/emulator/tk.cc
--- mozart-1.3.2.20060615_original/platform/emulator/tk.cc      2002-09-25 
00:30:32.000000000 +0200
+++ mozart-1.3.2.20060615/platform/emulator/tk.cc       2008-01-05 
12:20:45.829239500 +0100
@@ -322,9 +322,7 @@ public:
 
   void put_int(TaggedRef i) {
     if (oz_isSmallInt(i)) {
-      int len;
-      sprintf(buffer,"%d%n",tagged2SmallInt(i),&len);
-      buffer += len;
+      buffer += sprintf(buffer,"%d",tagged2SmallInt(i));
       ensure(0);
     } else {
       char * s = toC(i);
@@ -337,9 +335,7 @@ public:
   }
 
   void put_float(TaggedRef f) {
-    int len;
-    sprintf(buffer,"%g%n",floatValue(f),&len);
-    buffer += len;
+    buffer += sprintf(buffer,"%g",floatValue(f));
     ensure(0);
   }
 
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to