]> granicus.if.org Git - graphviz/commitdiff
Re-enable printf emulation on Windows, and make sure text window is turned off
authorerg <devnull@localhost>
Fri, 12 Jan 2007 17:25:55 +0000 (17:25 +0000)
committererg <devnull@localhost>
Fri, 12 Jan 2007 17:25:55 +0000 (17:25 +0000)
by default in dotty.
Merge the Windows versions of dotty.c and lneato.c.

cmd/lefty/common.c

index c3ea6ed25188c9cc2e0021ec44612276fab55fcc..a9979dc69e6294e3f21bbff9a4ba40128356d4ef 100644 (file)
@@ -423,3 +423,23 @@ void panic2 (char *file, int line, char *func, char *fmt, ...) {
     abort ();
 }
 
+#ifdef FEATURE_MS
+int gprintf (const char *fmt, ...) {
+    va_list args;
+    char buf[10240];
+    int l;
+
+    va_start(args, fmt);
+    vsprintf (buf, fmt, args);
+    l = strlen (buf);
+    if (buf[l - 1] == '\n')
+        buf[l - 1] = 0;
+    if (buf[0]) {
+        Gnocallbacks = TRUE;
+        MessageBox ((HWND) NULL, buf, "Lefty printf", MB_APPLMODAL);
+        Gnocallbacks = FALSE;
+    }
+    va_end(args);
+}
+#endif
+