diff options
author | Damien Doligez <damien.doligez-inria.fr> | 2004-01-16 15:24:03 +0000 |
---|---|---|
committer | Damien Doligez <damien.doligez-inria.fr> | 2004-01-16 15:24:03 +0000 |
commit | 776a8d59b77947bddc5203ad323697e26725f264 (patch) | |
tree | 5700391e7badd7e635700ffcae24b1b9ee282249 | |
parent | 111747916aa51bcc4fe14dec1730bf17ac4933e2 (diff) | |
download | ocaml-776a8d59b77947bddc5203ad323697e26725f264.tar.gz |
suppression support MacOS9
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6074 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | bytecomp/bytelink.ml | 5 | ||||
-rw-r--r-- | bytecomp/dll.ml | 1 | ||||
-rw-r--r-- | driver/main.ml | 7 | ||||
-rw-r--r-- | ocamldoc/odoc_ocamlhtml.mll | 25 | ||||
-rw-r--r-- | parsing/lexer.mll | 25 | ||||
-rw-r--r-- | parsing/location.ml | 4 | ||||
-rw-r--r-- | stdlib/filename.ml | 33 | ||||
-rw-r--r-- | stdlib/filename.mli | 5 | ||||
-rw-r--r-- | stdlib/printexc.ml | 8 | ||||
-rw-r--r-- | stdlib/scanf.ml | 29 | ||||
-rw-r--r-- | stdlib/sys.mli | 3 | ||||
-rw-r--r-- | tools/lexer299.mll | 25 | ||||
-rw-r--r-- | tools/lexer301.mll | 25 | ||||
-rw-r--r-- | tools/ocamldep.ml | 6 | ||||
-rw-r--r-- | toplevel/expunge.ml | 5 |
15 files changed, 39 insertions, 167 deletions
diff --git a/bytecomp/bytelink.ml b/bytecomp/bytelink.ml index 831ddeec61..aa8e4e759c 100644 --- a/bytecomp/bytelink.ml +++ b/bytecomp/bytelink.ml @@ -264,11 +264,6 @@ let make_absolute file = (* Create a bytecode executable file *) let link_bytecode tolink exec_name standalone = - if Sys.os_type = "MacOS" then begin - (* Create it as a text file for bytecode scripts *) - let c = open_out_gen [Open_wronly; Open_creat] 0o777 exec_name in - close_out c - end; let outchan = open_out_gen [Open_wronly; Open_trunc; Open_creat; Open_binary] 0o777 exec_name in try diff --git a/bytecomp/dll.ml b/bytecomp/dll.ml index eea7cc01f4..aa79a173b0 100644 --- a/bytecomp/dll.ml +++ b/bytecomp/dll.ml @@ -139,7 +139,6 @@ let ld_library_path_contents () = match Sys.os_type with | "Unix" | "Cygwin" -> ':' | "Win32" -> ';' - | "MacOS" -> ',' | _ -> assert false in try split (Sys.getenv "CAML_LD_LIBRARY_PATH") path_separator diff --git a/driver/main.ml b/driver/main.ml index 7bbbf05666..eb84cddbb6 100644 --- a/driver/main.ml +++ b/driver/main.ml @@ -40,11 +40,8 @@ let process_file ppf name = dllibs := name :: !dllibs else if Filename.check_suffix name ".c" then begin Compile.c_file name; - match Sys.os_type with - | "MacOS" -> ccobjs := (name ^ ".o") :: (name ^ ".x") :: !ccobjs - | _ -> - ccobjs := (Filename.chop_suffix (Filename.basename name) ".c" ^ ext_obj) - :: !ccobjs + ccobjs := (Filename.chop_suffix (Filename.basename name) ".c" ^ ext_obj) + :: !ccobjs end else raise(Arg.Bad("don't know what to do with " ^ name)) diff --git a/ocamldoc/odoc_ocamlhtml.mll b/ocamldoc/odoc_ocamlhtml.mll index ba4c0c8f31..337c1a325b 100644 --- a/ocamldoc/odoc_ocamlhtml.mll +++ b/ocamldoc/odoc_ocamlhtml.mll @@ -205,25 +205,12 @@ let get_stored_string () = (** To translate escape sequences *) -let char_for_backslash = - match Sys.os_type with - | "Unix" | "Win32" | "Cygwin" -> - begin function - | 'n' -> '\010' - | 'r' -> '\013' - | 'b' -> '\008' - | 't' -> '\009' - | c -> c - end - | "MacOS" -> - begin function - | 'n' -> '\013' - | 'r' -> '\010' - | 'b' -> '\008' - | 't' -> '\009' - | c -> c - end - | x -> fatal_error "Lexer: unknown system type" +let char_for_backslash = function + | 'n' -> '\010' + | 'r' -> '\013' + | 'b' -> '\008' + | 't' -> '\009' + | c -> c let char_for_decimal_code lexbuf i = let c = 100 * (Char.code(Lexing.lexeme_char lexbuf i) - 48) + diff --git a/parsing/lexer.mll b/parsing/lexer.mll index 080def85f0..809a37e7b8 100644 --- a/parsing/lexer.mll +++ b/parsing/lexer.mll @@ -125,25 +125,12 @@ let in_comment () = !comment_start_loc <> [];; (* To translate escape sequences *) -let char_for_backslash = - match Sys.os_type with - | "Unix" | "Win32" | "Cygwin" -> - begin function - | 'n' -> '\010' - | 'r' -> '\013' - | 'b' -> '\008' - | 't' -> '\009' - | c -> c - end - | "MacOS" -> - begin function - | 'n' -> '\013' - | 'r' -> '\010' - | 'b' -> '\008' - | 't' -> '\009' - | c -> c - end - | x -> fatal_error "Lexer: unknown system type" +let char_for_backslash = function + | 'n' -> '\010' + | 'r' -> '\013' + | 'b' -> '\008' + | 't' -> '\009' + | c -> c let char_for_decimal_code lexbuf i = let c = 100 * (Char.code(Lexing.lexeme_char lexbuf i) - 48) + diff --git a/parsing/location.ml b/parsing/location.ml index 806754d779..acbc7b5ff9 100644 --- a/parsing/location.ml +++ b/parsing/location.ml @@ -189,9 +189,7 @@ let reset () = num_loc_lines := 0 let (msg_file, msg_line, msg_chars, msg_to, msg_colon, msg_head) = - match Sys.os_type with - | "MacOS" -> ("File \"", "\"; line ", "; characters ", " to ", "", "### ") - | _ -> ("File \"", "\", line ", ", characters ", "-", ":", "") + ("File \"", "\", line ", ", characters ", "-", ":", "") (* return file, line, char from the given position *) let get_pos_info pos = diff --git a/stdlib/filename.ml b/stdlib/filename.ml index 15f65e0ddb..82dce717bd 100644 --- a/stdlib/filename.ml +++ b/stdlib/filename.ml @@ -151,35 +151,6 @@ module Cygwin = struct let quote = Unix.quote end -module MacOS = struct - let current_dir_name = "." - let parent_dir_name = ".." - let concat dirname filename = - let l = String.length dirname in - if l = 0 || dirname.[l-1] = ':' - then dirname ^ filename - else dirname ^ ":" ^ filename - let contains_colon n = String.contains n ':' - let is_relative n = - (String.length n >= 1 && n.[0] = ':') - || not (contains_colon n) - let is_implicit n = not (contains_colon n) - let check_suffix = Unix.check_suffix - let basename name = - try - let p = String.rindex name ':' + 1 in - String.sub name p (String.length name - p) - with Not_found -> name - let dirname name = - try match String.rindex name ':' with - | 0 -> ":" - | n -> String.sub name 0 n - with Not_found -> ":" - let temporary_directory = - try Sys.getenv "TempFolder" with Not_found -> ":" - let quote = generic_quote "'\182''" -end - let (current_dir_name, parent_dir_name, concat, is_relative, is_implicit, check_suffix, basename, dirname, temporary_directory, quote) = match Sys.os_type with @@ -196,10 +167,6 @@ let (current_dir_name, parent_dir_name, concat, is_relative, is_implicit, Cygwin.is_relative, Cygwin.is_implicit, Cygwin.check_suffix, Cygwin.basename, Cygwin.dirname, Cygwin.temporary_directory, Cygwin.quote) - | "MacOS" -> - (MacOS.current_dir_name, MacOS.parent_dir_name, MacOS.concat, - MacOS.is_relative, MacOS.is_implicit, MacOS.check_suffix, - MacOS.basename, MacOS.dirname, MacOS.temporary_directory, MacOS.quote) | _ -> assert false let chop_suffix name suff = diff --git a/stdlib/filename.mli b/stdlib/filename.mli index e3b2b7c7f8..2d0d34396d 100644 --- a/stdlib/filename.mli +++ b/stdlib/filename.mli @@ -76,10 +76,7 @@ val temp_file : string -> string -> string Under Unix, the temporary directory is [/tmp] by default; if set, the value of the environment variable [TMPDIR] is used instead. Under Windows, the name of the temporary directory is the - value of the environment variable [TEMP], or [C:\temp] by default. - Under MacOS 9, the name of the temporary directory is given - by the environment variable [TempFolder]; if not set, - temporary files are created in the current directory. *) + value of the environment variable [TEMP], or [C:\temp] by default. *) val open_temp_file : ?mode: open_flag list -> string -> string -> string * out_channel diff --git a/stdlib/printexc.ml b/stdlib/printexc.ml index a724069225..cbc9d3a685 100644 --- a/stdlib/printexc.ml +++ b/stdlib/printexc.ml @@ -15,13 +15,7 @@ open Printf;; -let locfmt = - match Sys.os_type with - | "MacOS" -> - format_of_string "File \"%s\"; line %d; characters %d to %d ### %s" - | _ -> - format_of_string "File \"%s\", line %d, characters %d-%d: %s" -;; +let locfmt = format_of_string "File \"%s\", line %d, characters %d-%d: %s";; let field x i = let f = Obj.field x i in diff --git a/stdlib/scanf.ml b/stdlib/scanf.ml index 5a49783570..2c8a2ac1cb 100644 --- a/stdlib/scanf.ml +++ b/stdlib/scanf.ml @@ -471,27 +471,14 @@ let scan_string stp max ib = let scan_char max ib = Scanning.store_char ib (Scanning.checked_peek_char ib) max;; -let char_for_backslash = - match Sys.os_type with - | "Unix" | "Win32" | "Cygwin" -> - begin function - | 'n' -> '\010' - | 'r' -> '\013' - | 'b' -> '\008' - | 't' -> '\009' - | c -> c - end - | "MacOS" -> - begin function - | 'n' -> '\013' - | 'r' -> '\010' - | 'b' -> '\008' - | 't' -> '\009' - | c -> c - end - | x -> assert false;; - -(* The integervalue correspondingt to the facial value of a valid +let char_for_backslash = function + | 'n' -> '\010' + | 'r' -> '\013' + | 'b' -> '\008' + | 't' -> '\009' + | c -> c + +(* The integer value corresponding to the facial value of a valid decimal digit character. *) let int_value_of_char c = int_of_char c - 48;; diff --git a/stdlib/sys.mli b/stdlib/sys.mli index 1dd4fc038c..28cb6de0e3 100644 --- a/stdlib/sys.mli +++ b/stdlib/sys.mli @@ -69,8 +69,7 @@ val os_type : string (** Operating system currently executing the Caml program. One of - ["Unix"] (for all Unix versions, including Linux and Mac OS X), - ["Win32"] (for MS-Windows, OCaml compiled with MSVC++ or Mingw), -- ["Cygwin"] (for MS-Windows, OCaml compiled with Cygwin), -- ["MacOS"] (for MacOS 9). *) +- ["Cygwin"] (for MS-Windows, OCaml compiled with Cygwin). *) val word_size : int (** Size of one word on the machine currently executing the Caml diff --git a/tools/lexer299.mll b/tools/lexer299.mll index afdabbd6aa..5b611427ae 100644 --- a/tools/lexer299.mll +++ b/tools/lexer299.mll @@ -219,25 +219,12 @@ let get_stored_string () = (* To translate escape sequences *) -let char_for_backslash = - match Sys.os_type with - | "Unix" | "Win32" -> - begin function - | 'n' -> '\010' - | 'r' -> '\013' - | 'b' -> '\008' - | 't' -> '\009' - | c -> c - end - | "MacOS" -> - begin function - | 'n' -> '\013' - | 'r' -> '\010' - | 'b' -> '\008' - | 't' -> '\009' - | c -> c - end - | x -> fatal_error "Lexer: unknown system type" +let char_for_backslash = function + | 'n' -> '\010' + | 'r' -> '\013' + | 'b' -> '\008' + | 't' -> '\009' + | c -> c let char_for_decimal_code lexbuf i = let c = 100 * (Char.code(Lexing.lexeme_char lexbuf i) - 48) + diff --git a/tools/lexer301.mll b/tools/lexer301.mll index 33beb041fa..38de299de0 100644 --- a/tools/lexer301.mll +++ b/tools/lexer301.mll @@ -223,25 +223,12 @@ let get_stored_string () = (* To translate escape sequences *) -let char_for_backslash = - match Sys.os_type with - | "Unix" | "Win32" | "Cygwin" -> - begin function - | 'n' -> '\010' - | 'r' -> '\013' - | 'b' -> '\008' - | 't' -> '\009' - | c -> c - end - | "MacOS" -> - begin function - | 'n' -> '\013' - | 'r' -> '\010' - | 'b' -> '\008' - | 't' -> '\009' - | c -> c - end - | x -> fatal_error "Lexer: unknown system type" +let char_for_backslash = function + | 'n' -> '\010' + | 'r' -> '\013' + | 'b' -> '\008' + | 't' -> '\009' + | c -> c let char_for_decimal_code lexbuf i = let c = 100 * (Char.code(Lexing.lexeme_char lexbuf i) - 48) + diff --git a/tools/ocamldep.ml b/tools/ocamldep.ml index c791923302..f0084732dd 100644 --- a/tools/ocamldep.ml +++ b/tools/ocamldep.ml @@ -73,11 +73,7 @@ let find_dependency modname (byt_deps, opt_deps) = with Not_found -> (byt_deps, opt_deps) -let (depends_on, escaped_eol) = - match Sys.os_type with - | "Unix" | "Win32" | "Cygwin" -> (": ", "\\\n ") - | "MacOS" -> ("\196 ", "\182\n ") - | _ -> assert false +let (depends_on, escaped_eol) = (": ", "\\\n ") let print_dependencies target_file deps = match deps with diff --git a/toplevel/expunge.ml b/toplevel/expunge.ml index 1b52d1bc64..5debb41243 100644 --- a/toplevel/expunge.ml +++ b/toplevel/expunge.ml @@ -47,11 +47,6 @@ let main () = Bytesections.read_toc ic; let toc = Bytesections.toc() in let pos_first_section = Bytesections.pos_first_section ic in - if Sys.os_type = "MacOS" then begin - (* Create output as a text file for bytecode scripts *) - let c = open_out_gen [Open_wronly; Open_creat] 0o777 output_name in - close_out c - end; let oc = open_out_gen [Open_wronly; Open_creat; Open_trunc; Open_binary] 0o777 output_name in |