]> gitweb.factorcode.org Git - factor.git/blob - core/system/system.factor
Remove Windows CE from core/ basis/ and build-support/
[factor.git] / core / system / system.factor
1 ! Copyright (C) 2007, 2010 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel kernel.private sequences math namespaces
4 init splitting assocs system.private layouts words ;
5 IN: system
6
7 SINGLETONS: x86.32 x86.64 arm ppc.32 ppc.64 ;
8
9 UNION: x86 x86.32 x86.64 ;
10 UNION: ppc ppc.32 ppc.64 ;
11
12 : cpu ( -- class ) \ cpu get-global ; foldable
13
14 SINGLETON: windows
15
16 SINGLETONS: freebsd netbsd openbsd solaris macosx linux ;
17
18 SINGLETON: haiku
19
20 UNION: bsd freebsd netbsd openbsd macosx ;
21
22 UNION: unix bsd solaris linux haiku ;
23
24 : os ( -- class ) \ os get-global ; foldable
25
26 : vm-compiler ( -- string ) \ vm-compiler get-global ; foldable
27
28 <PRIVATE
29
30 : string>cpu ( str -- class )
31     H{
32         { "x86.32" x86.32 }
33         { "x86.64" x86.64 }
34         { "arm" arm }
35         { "ppc.32" ppc.32 }
36         { "ppc.64" ppc.64 }
37     } at ;
38
39 : string>os ( str -- class )
40     H{
41         { "windows" windows }
42         { "freebsd" freebsd }
43         { "netbsd" netbsd }
44         { "openbsd" openbsd }
45         { "solaris" solaris }
46         { "macosx" macosx }
47         { "linux" linux }
48         { "haiku" haiku }
49     } at ;
50
51 PRIVATE>
52
53 : image ( -- path ) \ image get-global ;
54
55 : vm ( -- path ) \ vm get-global ;
56
57 : embedded? ( -- ? ) 15 special-object ;
58
59 : exit ( n -- * ) do-shutdown-hooks (exit) ;