diff options
-rw-r--r-- | byterun/Makefile.nt | 4 | ||||
-rw-r--r-- | byterun/debugger.c | 3 | ||||
-rw-r--r-- | byterun/sys.c | 6 | ||||
-rw-r--r-- | config/Makefile.nt | 9 | ||||
-rw-r--r-- | lex/output.ml | 14 | ||||
-rw-r--r-- | otherlibs/win32unix/unixsupport.c | 3 | ||||
-rw-r--r-- | stdlib/Makefile.nt | 4 |
7 files changed, 27 insertions, 16 deletions
diff --git a/byterun/Makefile.nt b/byterun/Makefile.nt index 56fa901c9..418055bfb 100644 --- a/byterun/Makefile.nt +++ b/byterun/Makefile.nt @@ -8,11 +8,11 @@ OBJS=interp.obj misc.obj stacks.obj fix_code.obj startup.obj main.obj \ memory.obj alloc.obj roots.obj compare.obj ints.obj floats.obj \ str.obj array.obj io.obj extern.obj intern.obj hash.obj sys.obj \ meta.obj parsing.obj gc_ctrl.obj terminfo.obj md5.obj obj.obj lexing.obj \ - wincmdline.obj printexc.obj + wincmdline.obj printexc.obj callback.obj debugger.obj PRIMS=array.c compare.c extern.c floats.c gc_ctrl.c hash.c \ intern.c interp.c ints.c io.c lexing.c md5.c meta.c obj.c parsing.c \ - signals.c str.c sys.c terminfo.c + signals.c str.c sys.c terminfo.c callback.c all: ocamlrun.exe diff --git a/byterun/debugger.c b/byterun/debugger.c index 18cfc54eb..4eb8cd1b8 100644 --- a/byterun/debugger.c +++ b/byterun/debugger.c @@ -28,10 +28,9 @@ int debugger_in_use = 0; unsigned long event_count; -#ifndef HAS_SOCKETS +#if !defined(HAS_SOCKETS) || defined(_WIN32) void debugger_init() - char * address; { } diff --git a/byterun/sys.c b/byterun/sys.c index 313912706..c3bd5a9c4 100644 --- a/byterun/sys.c +++ b/byterun/sys.c @@ -249,9 +249,6 @@ char * searchpath(name) char * q; struct stat st; - for (p = name; *p != 0; p++) { - if (*p == '/' || *p == '\\' || *p == ':') return name; - } if (stat(name, &st) == 0) return name; path = getenv("PATH"); if (path == NULL) return 0; @@ -259,6 +256,9 @@ char * searchpath(name) strcpy(fullname, name); strcat(fullname, ".exe"); if (stat(fullname, &st) == 0) return fullname; + for (p = name; *p != 0; p++) { + if (*p == '/' || *p == '\\' || *p == ':') return name; + } while(1) { for (p = fullname; *path != 0 && *path != ';'; p++, path++) *p = *path; if (p != fullname && p[-1] != '\\') *p++ = '\\'; diff --git a/config/Makefile.nt b/config/Makefile.nt index ba69cfdd3..107ca9771 100644 --- a/config/Makefile.nt +++ b/config/Makefile.nt @@ -26,8 +26,7 @@ BYTECCLINKOPTS=/MT CCLIBS= ### How to invoke the C preprocessor -# We don't need it anymore -#CPP=cl /nologo /EP +CPP=cl /nologo /EP ### How to invoke the librarian MKLIB=lib /nologo /debugtype:CV /out: @@ -47,10 +46,10 @@ SYSTEM=win32 NATIVECC=cl /nologo ### Additional compile-time options for $(NATIVECC). -NATIVECCCOMPOPTS=/Ox +NATIVECCCOMPOPTS=/Ox /MT ### Additional link-time options for $(NATIVECC) -NATIVECCLINKOPTS= +NATIVECCLINKOPTS=/MT ### Flags for the assembler AS=ml /nologo @@ -58,7 +57,7 @@ AFLAGS=/coff /Cp ############# Configuration for the contributed libraries -OTHERLIBRARIES=win32unix systhreads str num graph +OTHERLIBRARIES=win32unix systhreads str num graph dynlink ### Name of the target architecture for the "num" library BIGNUM_ARCH=C diff --git a/lex/output.ml b/lex/output.ml index 5ffb3b8c0..78e23b413 100644 --- a/lex/output.ml +++ b/lex/output.ml @@ -22,7 +22,7 @@ open Compact let copy_buffer = String.create 1024 -let copy_chunk ic oc (Location(start,stop)) = +let copy_chunk_unix ic oc (Location(start,stop)) = seek_in ic start; let n = ref (stop - start) in while !n > 0 do @@ -31,6 +31,18 @@ let copy_chunk ic oc (Location(start,stop)) = n := !n - m done +let copy_chunk_win32 ic oc (Location(start,stop)) = + seek_in ic start; + for i = start to stop - 1 do + let c = input_char ic in + if c <> '\r' then output_char oc c + done + +let copy_chunk = + match Sys.os_type with + "Win32" -> copy_chunk_win32 + | _ -> copy_chunk_unix + (* To output an array of short ints, encoded as a string *) let output_byte oc b = diff --git a/otherlibs/win32unix/unixsupport.c b/otherlibs/win32unix/unixsupport.c index a44b502ce..029301454 100644 --- a/otherlibs/win32unix/unixsupport.c +++ b/otherlibs/win32unix/unixsupport.c @@ -12,6 +12,7 @@ /* $Id$ */ #include <mlvalues.h> +#include <callback.h> #include <alloc.h> #include <memory.h> #include <fail.h> @@ -103,7 +104,7 @@ void unix_error(errcode, cmdname, cmdarg) Field(res, 3) = arg; Pop_roots(); #undef name -#under arg +#undef arg mlraise(res); } diff --git a/stdlib/Makefile.nt b/stdlib/Makefile.nt index 3f1b32368..ece8b4620 100644 --- a/stdlib/Makefile.nt +++ b/stdlib/Makefile.nt @@ -7,11 +7,11 @@ OPTCOMPILER=..\ocamlopt CAMLOPT=$(RUNTIME) $(OPTCOMPILER) CAMLDEP=..\boot\ocamlrun ..\tools\ocamldep -OBJS=pervasives.cmo list.cmo string.cmo char.cmo array.cmo sys.cmo \ +OBJS=pervasives.cmo list.cmo char.cmo string.cmo array.cmo sys.cmo \ hashtbl.cmo sort.cmo filename.cmo obj.cmo lexing.cmo parsing.cmo \ set.cmo map.cmo stack.cmo queue.cmo stream.cmo \ printf.cmo format.cmo arg.cmo printexc.cmo gc.cmo \ - digest.cmo random.cmo oo.cmo genlex.cmo + digest.cmo random.cmo oo.cmo genlex.cmo callback.cmo all: stdlib.cma std_exit.cmo camlheader |