Beginnings of an OCaml cross-compiler.
[fedora-mingw.git] / ocaml / mingw32-ocaml-3.11.0+beta1-filename-win32-dirsep.patch
diff --git a/ocaml/mingw32-ocaml-3.11.0+beta1-filename-win32-dirsep.patch b/ocaml/mingw32-ocaml-3.11.0+beta1-filename-win32-dirsep.patch
new file mode 100644 (file)
index 0000000..bec95c5
--- /dev/null
@@ -0,0 +1,17 @@
+Our compiler will think that os_type = "Win32".  Unfortunately in
+the default OCaml this has the negative effect of causing it to
+use '\' character in paths.  Since it's really running on a Linux
+kernel, that won't work.  This is a quick and dirty fix.
+
+diff --exclude _build -urN ocaml-3.11.0+beta1.orig/stdlib/filename.ml ocaml-3.11.0+beta1.mingw/stdlib/filename.ml
+--- ocaml-3.11.0+beta1.orig/stdlib/filename.ml 2007-01-09 13:42:17.000000000 +0000
++++ ocaml-3.11.0+beta1.mingw/stdlib/filename.ml        2008-11-15 14:34:37.000000000 +0000
+@@ -68,7 +68,7 @@
+ module Win32 = struct
+   let current_dir_name = "."
+   let parent_dir_name = ".."
+-  let dir_sep = "\\"
++  let dir_sep = "/"
+   let is_dir_sep s i = let c = s.[i] in c = '/' || c = '\\' || c = ':'
+   let rindex_dir_sep s =
+     let rec pos i =