1 |
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
2 |
* |
3 |
* ***** BEGIN LICENSE BLOCK ***** |
4 |
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
5 |
* |
6 |
* The contents of this file are subject to the Mozilla Public License Version |
7 |
* 1.1 (the "License"); you may not use this file except in compliance with |
8 |
* the License. You may obtain a copy of the License at |
9 |
* http://www.mozilla.org/MPL/ |
10 |
* |
11 |
* Software distributed under the License is distributed on an "AS IS" basis, |
12 |
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
13 |
* for the specific language governing rights and limitations under the |
14 |
* License. |
15 |
* |
16 |
* The Original Code is Mozilla Communicator client code, released |
17 |
* March 31, 1998. |
18 |
* |
19 |
* The Initial Developer of the Original Code is |
20 |
* Netscape Communications Corporation. |
21 |
* Portions created by the Initial Developer are Copyright (C) 1998 |
22 |
* the Initial Developer. All Rights Reserved. |
23 |
* |
24 |
* Contributor(s): |
25 |
* |
26 |
* Alternatively, the contents of this file may be used under the terms of |
27 |
* either of the GNU General Public License Version 2 or later (the "GPL"), |
28 |
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
29 |
* in which case the provisions of the GPL or the LGPL are applicable instead |
30 |
* of those above. If you wish to allow use of your version of this file only |
31 |
* under the terms of either the GPL or the LGPL, and not to allow others to |
32 |
* use your version of this file under the terms of the MPL, indicate your |
33 |
* decision by deleting the provisions above and replace them with the notice |
34 |
* and other provisions required by the GPL or the LGPL. If you do not delete |
35 |
* the provisions above, a recipient may use your version of this file under |
36 |
* the terms of any one of the MPL, the GPL or the LGPL. |
37 |
* |
38 |
* ***** END LICENSE BLOCK ***** */ |
39 |
|
40 |
#ifndef js_cpucfg___ |
41 |
#define js_cpucfg___ |
42 |
|
43 |
#define JS_HAVE_LONG_LONG |
44 |
|
45 |
#if defined(XP_WIN) || defined(XP_OS2) || defined(WINCE) |
46 |
|
47 |
#if defined(_WIN64) |
48 |
|
49 |
#if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_) |
50 |
#define IS_LITTLE_ENDIAN 1 |
51 |
#undef IS_BIG_ENDIAN |
52 |
|
53 |
#define JS_BYTES_PER_BYTE 1L |
54 |
#define JS_BYTES_PER_SHORT 2L |
55 |
#define JS_BYTES_PER_INT 4L |
56 |
#define JS_BYTES_PER_INT64 8L |
57 |
#define JS_BYTES_PER_LONG 4L |
58 |
#define JS_BYTES_PER_FLOAT 4L |
59 |
#define JS_BYTES_PER_DOUBLE 8L |
60 |
#define JS_BYTES_PER_WORD 8L |
61 |
#define JS_BYTES_PER_DWORD 8L |
62 |
|
63 |
#define JS_BITS_PER_BYTE 8L |
64 |
#define JS_BITS_PER_SHORT 16L |
65 |
#define JS_BITS_PER_INT 32L |
66 |
#define JS_BITS_PER_INT64 64L |
67 |
#define JS_BITS_PER_LONG 32L |
68 |
#define JS_BITS_PER_FLOAT 32L |
69 |
#define JS_BITS_PER_DOUBLE 64L |
70 |
#define JS_BITS_PER_WORD 64L |
71 |
|
72 |
#define JS_BITS_PER_BYTE_LOG2 3L |
73 |
#define JS_BITS_PER_SHORT_LOG2 4L |
74 |
#define JS_BITS_PER_INT_LOG2 5L |
75 |
#define JS_BITS_PER_INT64_LOG2 6L |
76 |
#define JS_BITS_PER_LONG_LOG2 5L |
77 |
#define JS_BITS_PER_FLOAT_LOG2 5L |
78 |
#define JS_BITS_PER_DOUBLE_LOG2 6L |
79 |
#define JS_BITS_PER_WORD_LOG2 6L |
80 |
|
81 |
#define JS_ALIGN_OF_SHORT 2L |
82 |
#define JS_ALIGN_OF_INT 4L |
83 |
#define JS_ALIGN_OF_LONG 4L |
84 |
#define JS_ALIGN_OF_INT64 8L |
85 |
#define JS_ALIGN_OF_FLOAT 4L |
86 |
#define JS_ALIGN_OF_DOUBLE 8L |
87 |
#define JS_ALIGN_OF_POINTER 8L |
88 |
#define JS_ALIGN_OF_WORD 8L |
89 |
|
90 |
#define JS_BYTES_PER_WORD_LOG2 3L |
91 |
#define JS_BYTES_PER_DWORD_LOG2 3L |
92 |
#define PR_WORDS_PER_DWORD_LOG2 0L |
93 |
#else /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */ |
94 |
#error "CPU type is unknown" |
95 |
#endif /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */ |
96 |
|
97 |
#elif defined(_WIN32) || defined(XP_OS2) || defined(WINCE) |
98 |
|
99 |
#ifdef __WATCOMC__ |
100 |
#define HAVE_VA_LIST_AS_ARRAY 1 |
101 |
#endif |
102 |
|
103 |
#define IS_LITTLE_ENDIAN 1 |
104 |
#undef IS_BIG_ENDIAN |
105 |
|
106 |
#define JS_BYTES_PER_BYTE 1L |
107 |
#define JS_BYTES_PER_SHORT 2L |
108 |
#define JS_BYTES_PER_INT 4L |
109 |
#define JS_BYTES_PER_INT64 8L |
110 |
#define JS_BYTES_PER_LONG 4L |
111 |
#define JS_BYTES_PER_FLOAT 4L |
112 |
#define JS_BYTES_PER_DOUBLE 8L |
113 |
#define JS_BYTES_PER_WORD 4L |
114 |
#define JS_BYTES_PER_DWORD 8L |
115 |
|
116 |
#define JS_BITS_PER_BYTE 8L |
117 |
#define JS_BITS_PER_SHORT 16L |
118 |
#define JS_BITS_PER_INT 32L |
119 |
#define JS_BITS_PER_INT64 64L |
120 |
#define JS_BITS_PER_LONG 32L |
121 |
#define JS_BITS_PER_FLOAT 32L |
122 |
#define JS_BITS_PER_DOUBLE 64L |
123 |
#define JS_BITS_PER_WORD 32L |
124 |
|
125 |
#define JS_BITS_PER_BYTE_LOG2 3L |
126 |
#define JS_BITS_PER_SHORT_LOG2 4L |
127 |
#define JS_BITS_PER_INT_LOG2 5L |
128 |
#define JS_BITS_PER_INT64_LOG2 6L |
129 |
#define JS_BITS_PER_LONG_LOG2 5L |
130 |
#define JS_BITS_PER_FLOAT_LOG2 5L |
131 |
#define JS_BITS_PER_DOUBLE_LOG2 6L |
132 |
#define JS_BITS_PER_WORD_LOG2 5L |
133 |
|
134 |
#define JS_ALIGN_OF_SHORT 2L |
135 |
#define JS_ALIGN_OF_INT 4L |
136 |
#define JS_ALIGN_OF_LONG 4L |
137 |
#define JS_ALIGN_OF_INT64 8L |
138 |
#define JS_ALIGN_OF_FLOAT 4L |
139 |
#define JS_ALIGN_OF_DOUBLE 4L |
140 |
#define JS_ALIGN_OF_POINTER 4L |
141 |
#define JS_ALIGN_OF_WORD 4L |
142 |
|
143 |
#define JS_BYTES_PER_WORD_LOG2 2L |
144 |
#define JS_BYTES_PER_DWORD_LOG2 3L |
145 |
#define PR_WORDS_PER_DWORD_LOG2 1L |
146 |
#endif /* _WIN32 || XP_OS2 || WINCE*/ |
147 |
|
148 |
#if defined(_WINDOWS) && !defined(_WIN32) /* WIN16 */ |
149 |
|
150 |
#define IS_LITTLE_ENDIAN 1 |
151 |
#undef IS_BIG_ENDIAN |
152 |
|
153 |
#define JS_BYTES_PER_BYTE 1L |
154 |
#define JS_BYTES_PER_SHORT 2L |
155 |
#define JS_BYTES_PER_INT 2L |
156 |
#define JS_BYTES_PER_INT64 8L |
157 |
#define JS_BYTES_PER_LONG 4L |
158 |
#define JS_BYTES_PER_FLOAT 4L |
159 |
#define JS_BYTES_PER_DOUBLE 8L |
160 |
#define JS_BYTES_PER_WORD 4L |
161 |
#define JS_BYTES_PER_DWORD 8L |
162 |
|
163 |
#define JS_BITS_PER_BYTE 8L |
164 |
#define JS_BITS_PER_SHORT 16L |
165 |
#define JS_BITS_PER_INT 16L |
166 |
#define JS_BITS_PER_INT64 64L |
167 |
#define JS_BITS_PER_LONG 32L |
168 |
#define JS_BITS_PER_FLOAT 32L |
169 |
#define JS_BITS_PER_DOUBLE 64L |
170 |
#define JS_BITS_PER_WORD 32L |
171 |
|
172 |
#define JS_BITS_PER_BYTE_LOG2 3L |
173 |
#define JS_BITS_PER_SHORT_LOG2 4L |
174 |
#define JS_BITS_PER_INT_LOG2 4L |
175 |
#define JS_BITS_PER_INT64_LOG2 6L |
176 |
#define JS_BITS_PER_LONG_LOG2 5L |
177 |
#define JS_BITS_PER_FLOAT_LOG2 5L |
178 |
#define JS_BITS_PER_DOUBLE_LOG2 6L |
179 |
#define JS_BITS_PER_WORD_LOG2 5L |
180 |
|
181 |
#define JS_ALIGN_OF_SHORT 2L |
182 |
#define JS_ALIGN_OF_INT 2L |
183 |
#define JS_ALIGN_OF_LONG 2L |
184 |
#define JS_ALIGN_OF_INT64 2L |
185 |
#define JS_ALIGN_OF_FLOAT 2L |
186 |
#define JS_ALIGN_OF_DOUBLE 2L |
187 |
#define JS_ALIGN_OF_POINTER 2L |
188 |
#define JS_ALIGN_OF_WORD 2L |
189 |
|
190 |
#define JS_BYTES_PER_WORD_LOG2 2L |
191 |
#define JS_BYTES_PER_DWORD_LOG2 3L |
192 |
#define PR_WORDS_PER_DWORD_LOG2 1L |
193 |
|
194 |
#endif /* defined(_WINDOWS) && !defined(_WIN32) */ |
195 |
|
196 |
#elif defined(XP_UNIX) || defined(XP_BEOS) |
197 |
|
198 |
#error "This file is supposed to be auto-generated on UNIX platforms, but the" |
199 |
#error "static version for Mac and Windows platforms is being used." |
200 |
#error "Something's probably wrong with paths/headers/dependencies/Makefiles." |
201 |
|
202 |
#else |
203 |
|
204 |
#error "Must define one of XP_BEOS, XP_OS2, XP_WIN, or XP_UNIX" |
205 |
|
206 |
#endif |
207 |
|
208 |
#ifndef JS_STACK_GROWTH_DIRECTION |
209 |
#define JS_STACK_GROWTH_DIRECTION (-1) |
210 |
#endif |
211 |
|
212 |
#endif /* js_cpucfg___ */ |