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