Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/branches/SMLNJ/src/cm/main/specific-symval-fn.sml
ViewVC logotype

Diff of /sml/branches/SMLNJ/src/cm/main/specific-symval-fn.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 629, Wed Apr 26 04:06:41 2000 UTC revision 630, Wed Apr 26 18:40:56 2000 UTC
# Line 1  Line 1 
1    (*
2     * Building a host/OS-specific environments for CM "preprocessor" variables.
3     *
4     * (C) 1999 Lucent Technologies, Bell Laboratories
5     *
6     * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
7     *)
8  functor SpecificSymValFn (structure MachDepVC: MACHDEP_VC  functor SpecificSymValFn (structure MachDepVC: MACHDEP_VC
9                            val os: SMLofNJ.SysInfo.os_kind) =                            val os: SMLofNJ.SysInfo.os_kind) =
10      struct      struct
11          local          local
12              val (arch, extra_arch, big, size) =              val (arch, big, size) =
13                  case MachDepVC.architecture of                  case MachDepVC.architecture of
14                      "sparc" => ("SPARC", NONE, true, 32)                      "sparc" => ("SPARC", true, 32)
15                    | "alpha32" => ("ALPHA", NONE, false, 32)                    | "alpha32" => ("ALPHA", false, 32)
16                    | "alpha32x" => ("ALPHA", SOME "ALHPA_OLD", false, 32)                    | "mipsel" => ("MIPS", false, 32)
17                    | "mipsel" => ("MIPS", NONE, false, 32)                    | "mipseb" => ("MIPS", true, 32)
18                    | "mipseb" => ("MIPS", NONE, true, 32)                    | "x86" => ("X86", false, 32)
19                    | "x86" => ("X86", NONE, false, 32)                    | "hppa" => ("HPPA", false, 32)
20                    | "hppa" => ("HPPA", NONE, false, 32)                    | "rs6000" => ("RS6000", false, 32)
21                    | "rs6000" => ("RS6000", NONE, false, 32)                    | "ppc" => ("PPC", false, 32)
                   | "ppc" => ("PPC", NONE, false, 32)  
22                    | arch => GenericVC.ErrorMsg.impossible                    | arch => GenericVC.ErrorMsg.impossible
23                          ("unknown architecture: " ^ arch)                          ("unknown architecture: " ^ arch)
24          in              val env0 =
             val env =  
25                  SymVal.default { arch = arch,                  SymVal.default { arch = arch,
                                  extra_arch = extra_arch,  
26                                   big = big,                                   big = big,
27                                   size = size,                                   size = size,
28                                   os = os,                                   os = os,
29                                   version = #version_id GenericVC.version }                                   version = #version_id GenericVC.version }
30                val er = ref env0
31            in
32                fun symval s = let
33                    fun get () = SymVal.look (!er) s
34                    fun set v = er := SymVal.define (!er, s, v)
35                in
36                    { get = get, set = set }
37                end
38          end          end
39      end      end

Legend:
Removed from v.629  
changed lines
  Added in v.630

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0