]> gitweb.factorcode.org Git - factor.git/blob - vm/platform.hpp
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / vm / platform.hpp
1 #if defined(__arm__)
2         #define FACTOR_ARM
3 #elif defined(__amd64__) || defined(__x86_64__)
4         #define FACTOR_AMD64
5 #elif defined(i386) || defined(__i386) || defined(__i386__) || defined(WIN32)
6         #define FACTOR_X86
7 #elif defined(__POWERPC__) || defined(__ppc__) || defined(_ARCH_PPC)
8         #define FACTOR_PPC
9 #else
10         #error "Unsupported architecture"
11 #endif
12
13 #if defined(WINDOWS)
14         #if defined(WINCE)
15                 #include "os-windows-ce.hpp"
16         #else
17                 #include "os-windows-nt.hpp"
18         #endif
19
20         #include "os-windows.hpp"
21         #if defined(FACTOR_AMD64)
22                 #include "os-windows-nt.64.hpp"
23         #elif defined(FACTOR_X86)
24                 #include "os-windows-nt.32.hpp"
25         #endif
26 #else
27         #include "os-unix.hpp"
28
29         #ifdef __APPLE__
30                 #include "os-macosx.hpp"
31                 #include "mach_signal.hpp"
32                 
33                 #ifdef FACTOR_X86
34                         #include "os-macosx-x86.32.hpp"
35                 #elif defined(FACTOR_PPC)
36                         #include "os-macosx-ppc.hpp"
37                 #elif defined(FACTOR_AMD64)
38                         #include "os-macosx-x86.64.hpp"
39                 #else
40                         #error "Unsupported Mac OS X flavor"
41                 #endif
42         #else
43                 #include "os-genunix.hpp"
44
45                 #ifdef __FreeBSD__
46                         #define FACTOR_OS_STRING "freebsd"
47                         #include "os-freebsd.hpp"
48                         
49                         #if defined(FACTOR_X86)
50                                 #include "os-freebsd-x86.32.hpp"
51                         #elif defined(FACTOR_AMD64)
52                                 #include "os-freebsd-x86.64.hpp"
53                         #else
54                                 #error "Unsupported FreeBSD flavor"
55                         #endif
56                 #elif defined(__OpenBSD__)
57                         #define FACTOR_OS_STRING "openbsd"
58
59                         #if defined(FACTOR_X86)
60                                 #include "os-openbsd-x86.32.hpp"
61                         #elif defined(FACTOR_AMD64)
62                                 #include "os-openbsd-x86.64.hpp"
63                         #else
64                                 #error "Unsupported OpenBSD flavor"
65                         #endif
66                 #elif defined(__NetBSD__)
67                         #define FACTOR_OS_STRING "netbsd"
68
69                         #if defined(FACTOR_X86)
70                                 #include "os-netbsd-x86.32.hpp"
71                         #elif defined(FACTOR_AMD64)
72                                 #include "os-netbsd-x86.64.hpp"
73                         #else
74                                 #error "Unsupported NetBSD flavor"
75                         #endif
76
77                         #include "os-netbsd.hpp"
78                 #elif defined(linux)
79                         #define FACTOR_OS_STRING "linux"
80                         #include "os-linux.hpp"
81
82                         #if defined(FACTOR_X86)
83                                 #include "os-linux-x86.32.hpp"
84                         #elif defined(FACTOR_PPC)
85                                 #include "os-linux-ppc.hpp"
86                         #elif defined(FACTOR_ARM)
87                                 #include "os-linux-arm.hpp"
88                         #elif defined(FACTOR_AMD64)
89                                 #include "os-linux-x86.64.hpp"
90                         #else
91                                 #error "Unsupported Linux flavor"
92                         #endif
93                 #elif defined(__SVR4) && defined(sun)
94                         #define FACTOR_OS_STRING "solaris"
95
96                         #if defined(FACTOR_X86)
97                                 #include "os-solaris-x86.32.hpp"
98                         #elif defined(FACTOR_AMD64)
99                                 #include "os-solaris-x86.64.hpp"
100                         #else
101                                 #error "Unsupported Solaris flavor"
102                         #endif
103
104                 #else
105                         #error "Unsupported OS"
106                 #endif
107         #endif
108 #endif
109
110 #if defined(FACTOR_X86)
111         #include "cpu-x86.32.hpp"
112         #include "cpu-x86.hpp"
113 #elif defined(FACTOR_AMD64)
114         #include "cpu-x86.64.hpp"
115         #include "cpu-x86.hpp"
116 #elif defined(FACTOR_PPC)
117         #include "cpu-ppc.hpp"
118 #elif defined(FACTOR_ARM)
119         #include "cpu-arm.hpp"
120 #else
121         #error "Unsupported CPU"
122 #endif