Index: m3-sys/cm3/src/Builder.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/cm3/src/Builder.m3,v retrieving revision 1.33 diff -u -r1.33 Builder.m3 --- m3-sys/cm3/src/Builder.m3 12 Mar 2010 11:40:08 -0000 1.33 +++ m3-sys/cm3/src/Builder.m3 9 May 2010 10:07:42 -0000 @@ -163,14 +163,14 @@ value := GetDefn (s, "NAMING_CONVENTIONS"); IF value # NIL THEN - M3Path.SetOS (ConvertNamingConventionStringToEnum (s, value), host := FALSE); + M3Path.SetTargetOS (ConvertNamingConventionStringToEnum (s, value)); END; value := GetDefn (s, "TARGET_NAMING"); IF value # NIL THEN WITH target_os = ConvertNamingConventionStringToEnum (s, value) DO s.target_os := target_os; - M3Path.SetOS (target_os, host := FALSE); + M3Path.SetTargetOS (target_os); END; END; @@ -276,7 +276,7 @@ IF value # NIL THEN WITH target_os = ConvertNamingConventionStringToEnum (s, value) DO s.target_os := target_os; - M3Path.SetOS (target_os, host := FALSE); + M3Path.SetTargetOS (target_os); END; END; Index: m3-sys/cm3/test/src/t.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/cm3/test/src/t.m3,v retrieving revision 1.6 diff -u -r1.6 t.m3 --- m3-sys/cm3/test/src/t.m3 12 Mar 2010 11:36:00 -0000 1.6 +++ m3-sys/cm3/test/src/t.m3 9 May 2010 10:07:42 -0000 @@ -6,12 +6,9 @@ buf := NEW (REF ARRAY OF CHAR, length); t2 := ""; BEGIN - FOR i := 0 TO 1 DO - M3Path.SetOS(ARRAY OF M3Path.OSKind {M3Path.OSKind.Unix, M3Path.OSKind.Win32}[i], host := TRUE); - Text.SetChars(buf^, text); - t2 := M3Path.FixPath(buf^); - IO.Put(ARRAY OF TEXT {"Unix", "Win32"}[i] & " " & text & " => " & t2 & Wr.EOL); - END; + Text.SetChars(buf^, text); + t2 := M3Path.FixPath(buf^); + IO.Put(text & " => " & t2 & Wr.EOL); END T; CONST Letters1 = SET OF CHAR {'a' .. 'z', 'A' .. 'Z'}; Index: m3-sys/m3quake/src/M3Path.i3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3quake/src/M3Path.i3,v retrieving revision 1.1 diff -u -r1.1 M3Path.i3 --- m3-sys/m3quake/src/M3Path.i3 27 Jun 2009 14:55:29 -0000 1.1 +++ m3-sys/m3quake/src/M3Path.i3 9 May 2010 10:07:42 -0000 @@ -6,6 +6,8 @@ INTERFACE M3Path; +IMPORT Compiler; + TYPE T = RECORD dir : TEXT; @@ -13,8 +15,7 @@ kind : Kind; END; -VAR (* possibly changed at initialization and then CONST *) - SlashText := "/"; +CONST SlashText = ARRAY Compiler.OS OF TEXT{"/", "\\"}[Compiler.ThisOS]; TYPE Kind = { Unknown, I3, IC, IS, IO, M3, MC, MS, MO, @@ -28,8 +29,8 @@ "GrumpyUnix", "Win32" }; -PROCEDURE SetOS (os: OSKind; host: BOOLEAN); -(* Set the conventions for the specifed platform *) +PROCEDURE SetTargetOS (os: OSKind); +(* Set the conventions for the target platform *) PROCEDURE New (a, b, c, d: TEXT := NIL): TEXT; (* Return "a/b/c/d" using the host naming conventions *) Index: m3-sys/m3quake/src/M3Path.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3quake/src/M3Path.m3,v retrieving revision 1.2 diff -u -r1.2 M3Path.m3 --- m3-sys/m3quake/src/M3Path.m3 26 Aug 2009 04:01:13 -0000 1.2 +++ m3-sys/m3quake/src/M3Path.m3 9 May 2010 10:07:42 -0000 @@ -56,18 +56,13 @@ Default_pgm = ARRAY OSKind OF TEXT { "a.out", "a.out", "NONAME.EXE" }; -VAR - host_os := OSKind.Unix; - target_os := OSKind.Unix; +CONST host_os = ARRAY Compiler.OS OF OSKind{OSKind.Unix, OSKind.Win32}[Compiler.ThisOS]; +VAR target_os := host_os; -PROCEDURE SetOS (kind: OSKind; host: BOOLEAN) = +PROCEDURE SetTargetOS (kind: OSKind) = BEGIN - IF host THEN - host_os := kind; - ELSE - target_os := kind; - END; - END SetOS; + target_os := kind; + END SetTargetOS; PROCEDURE New (a, b, c, d: TEXT := NIL): TEXT = VAR len: CARDINAL; buf: ARRAY [0..255] OF CHAR; ref: REF ARRAY OF CHAR; @@ -606,9 +601,4 @@ END FixPath; BEGIN - IF (Compiler.ThisOS = Compiler.OS.WIN32) THEN - SlashText := "\\"; - SetOS (OSKind.Win32, TRUE); - SetOS (OSKind.Win32, FALSE); - END; END M3Path.