-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjs.h
190 lines (155 loc) · 5.78 KB
/
js.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/* Copyright 1990-2011, Jsoftware Inc. All rights reserved. */
/* License in license.txt. */
/* */
/* SYS_ and friends */
#ifndef SYS /* only include once (dtoa.c) */
/* Inclusion of a system herein does not necessarily mean that the source */
/* compiles or works under that system. */
#define SYS_AMIGA 1L /* DICE */
#define SYS_ARCHIMEDES 2L
#define SYS_ATARIST 4L /* GCC */
#define SYS_ATT3B1 8L /* System V C */
#define SYS_DEC5500 16L /* GCC */
#define SYS_IBMRS6000 32L /* AIX XL C */
#define SYS_MACINTOSH 64L /* Think C */
#define SYS_MIPS 128L /* GCC */
#define SYS_CYGWIN 256L /* GCC */
#define SYS_OS2 512L
#define SYS_PC 1024L /* Turbo C */
#define SYS_PCWIN 2048L /* Watcom C 386 */
#define SYS_PC386 4096L /* Watcom C 386 */
#define SYS_SGI 8192L /* GCC */
#define SYS_SUN3 16384L /* GCC */
#define SYS_SUN4 32768L /* GCC */
#define SYS_VAX 65536L /* GCC */
#define SYS_HPUX 131072L /* C89 */
#define SYS_LINUX 262144L /* GCC */
#define SYS_FREEBSD 524288L /* x86 only */
#define SYS_NETBSD 1048576L /* GCC */
#define SYS_SUNSOL2 2097152L /* GCC */
#define SYS_MACOSX 4194304L /* GCC (CC) */
#define SY_64 0 /* 64-bit systems */
#define SY_WIN32 0 /* any windows intel version */
#define SY_WINCE 0 /* any windows ce versions */
#define SY_LINUX 0 /* any linux intel version */
#define SY_MAC 0 /* any macosx intel or powerpc version */
#define SY_MACPPC 0 /* macosx powerpc */
#define SY_CYGWIN 0 /* cygwin */
#define SY_GETTOD 0 /* gettimeofday on unix */
#define SYS_DOS (SYS_PC + SYS_PC386 + SYS_PCWIN)
#define SYS_UNIX (SYS_ATT3B1 + SYS_DEC5500 + SYS_IBMRS6000 + \
SYS_MIPS + SYS_CYGWIN + SYS_SGI + SYS_SUN3 + \
SYS_SUN4 + SYS_VAX + SYS_LINUX + SYS_MACOSX + \
SYS_FREEBSD + SYS_NETBSD + SYS_SUNSOL2 + SYS_HPUX)
#define SYS_ANSILIB (SYS_AMIGA + SYS_ARCHIMEDES + SYS_DOS + \
SYS_MACINTOSH + SYS_OS2 + SYS_UNIX)
#define SYS_SESM (SYS_ARCHIMEDES + SYS_DOS + SYS_MACINTOSH + \
SYS_OS2 + SYS_UNIX)
#define SYS_LILENDIAN (SYS_ARCHIMEDES + SYS_DEC5500 + SYS_DOS + \
SYS_OS2 + SYS_LINUX + SYS_FREEBSD + \
SYS_NETBSD)
#if defined(__FreeBSD__)
#define SYS SYS_FREEBSD
#endif
#if defined(__NetBSD__)
#define SYS SYS_NETBSD
#endif
#if defined(sparc) && ! defined(__svr4__)
#define SYS SYS_SUN4
#endif
#if defined(sparc) && defined(__svr4__)
#define SYS SYS_SUNSOL2
#endif
#if defined(__sgi__)
#define SYS SYS_SGI
#endif
#if defined (_AIX)
#define SYS SYS_IBMRS6000
#endif
#if defined(__linux__) || defined(__CYGWIN__)
#define SYS SYS_LINUX
#undef SY_LINUX
#define SY_LINUX 1
#endif
#ifdef __CYGWIN__
#undef SY_CYGWIN
#define SY_CYGWIN 1
#undef _MISALIGN_BYTEVECTOR
#define _MISALIGN_BYTEVECTOR 0
#endif
#if defined _PA_RISC1_1
#define SYS SYS_HPUX
#endif
#ifdef __MACH__
#ifdef __ppc__
#ifdef __GNUC__
#define SYS SYS_MACOSX // powerpc
#undef SY_MAC
#define SY_MAC 1
#undef SY_MACPPC
#def SY_MACPPC 1
#endif
#endif
#endif
#ifdef __MACH__
#ifndef __ppc__
#ifdef __GNUC__
#define SYS SYS_MACOSX // intel
#undef SY_MAC
#define SY_MAC 1
#undef SYS_LILENDIAN
#define SYS_LILENDIAN SYS_MACOSX
#endif
#endif
#endif
#ifdef _WIN32
#define SYS SYS_PCWIN
#undef SY_WIN32
#define SY_WIN32 1
#endif
#if SYS & SYS_UNIX
#undef SY_GETTOD
#define SY_GETTOD 1
#endif
#ifdef UNDER_CE
#undef SY_WINCE
#define SY_WINCE 1
#endif
#define SY_ALIGN (!(SY_WIN32 || SYS&SYS_LINUX) || SY_WINCE)
/* SY_ALIGN should be 1 for compilers requiring strict alignment */
/* e.g. if (I*)av is not allowed for arbitrary av of type C* */
#ifdef _MISALIGN_BYTEVECTOR
#define MISALIGN_BYTEVECTOR 1
#else
#define MISALIGN_BYTEVECTOR 0
#endif
/* Windows CE target autoconfiguration: */
#if SY_WINCE
#ifdef SH3
#define SY_WINCE_SH 1
#else
#define SY_WINCE_SH 0
#endif
#ifdef MIPS
#define SY_WINCE_MIPS 1
#else
#define SY_WINCE_MIPS 0
#endif
#ifdef ARM
#define SY_WINCE_ARM 1
#else
#define SY_WINCE_ARM 0
#endif
#endif
/* _WIN64 defined by VC++ and _UNIX64 defined in makefile */
#if defined(_WIN64) || defined(_UNIX64)
#undef SY_64
#define SY_64 1
#endif
#ifndef SYS /* must be defined */
#error: "SYS must be defined"
#endif
#if 1!=SY_WIN32+SY_LINUX+SY_MAC
#error: "one and only one of SY_WIN32, SY_LINUX, SY_MAC must be 1"
#endif
#endif /* only include once */