dylan-hackers / mindy

Mindy - minimal compiler-interpreter for Dylan
Other
21 stars 9 forks source link

[windows] Clean up. Make it compilable on MSVC and MinGW. #73

Closed phongphan closed 8 years ago

phongphan commented 8 years ago

Hi

This will make mindy compile successfully on vc++ 2013 and MinGW 5.1. And can use mindy -x to run the demos*.

**note***: The mindy debugger doesn't seem to work on Windows. It always crashed with error 122 ERROR_INSUFFICIENT_BUFFER. I have to disabled it with the patch below just to make mindy -x run.

On my machine (Windows 7 64-bit), the ReadFile function doesn't return after first keyboard hit, but it will wait until we hit the Enter key.

diff --git a/mindy/interpreter/fd.c b/mindy/interpreter/fd.c
index 74080eb..ec276c3 100644
--- a/mindy/interpreter/fd.c
+++ b/mindy/interpreter/fd.c
@@ -104,6 +104,7 @@ static DWORD input_checker (LPDWORD param)
         bool read_result;
         /* Wait until someone invalidates our last answer */
         WaitForSingleObject(update_input_available[fd], INFINITE);
+#if 0
         /* Now loop until we complete a read without getting a
            broken pipe error */
         /* read 0 bytes, block if not available */
@@ -125,6 +126,7 @@ static DWORD input_checker (LPDWORD param)
             SuspendThread(fd_threads[fd]);
         }
         read_from = 1;
+#endif
     }
     lose("This is not supposed to be reached!");
     return 0;
waywardmonkeys commented 8 years ago

Thanks!