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 ***** */
40 #ifndef js_cpucfg___
41 #define js_cpucfg___
43 #include "jsosdep.h"
45 #if defined(XP_WIN) || defined(XP_OS2) || defined(WINCE)
47 #ifdef __WATCOMC__
48 #define HAVE_VA_LIST_AS_ARRAY
49 #endif
51 #if defined(_WIN32) || defined(XP_OS2) || defined(WINCE)
52 #define IS_LITTLE_ENDIAN 1
53 #undef IS_BIG_ENDIAN
55 #define JS_BYTES_PER_BYTE 1L
56 #define JS_BYTES_PER_SHORT 2L
57 #define JS_BYTES_PER_INT 4L
58 #define JS_BYTES_PER_INT64 8L
59 #define JS_BYTES_PER_LONG 4L
60 #define JS_BYTES_PER_FLOAT 4L
61 #define JS_BYTES_PER_DOUBLE 8L
62 #define JS_BYTES_PER_WORD 4L
63 #define JS_BYTES_PER_DWORD 8L
65 #define JS_BITS_PER_BYTE 8L
66 #define JS_BITS_PER_SHORT 16L
67 #define JS_BITS_PER_INT 32L
68 #define JS_BITS_PER_INT64 64L
69 #define JS_BITS_PER_LONG 32L
70 #define JS_BITS_PER_FLOAT 32L
71 #define JS_BITS_PER_DOUBLE 64L
72 #define JS_BITS_PER_WORD 32L
74 #define JS_BITS_PER_BYTE_LOG2 3L
75 #define JS_BITS_PER_SHORT_LOG2 4L
76 #define JS_BITS_PER_INT_LOG2 5L
77 #define JS_BITS_PER_INT64_LOG2 6L
78 #define JS_BITS_PER_LONG_LOG2 5L
79 #define JS_BITS_PER_FLOAT_LOG2 5L
80 #define JS_BITS_PER_DOUBLE_LOG2 6L
81 #define JS_BITS_PER_WORD_LOG2 5L
83 #define JS_ALIGN_OF_SHORT 2L
84 #define JS_ALIGN_OF_INT 4L
85 #define JS_ALIGN_OF_LONG 4L
86 #define JS_ALIGN_OF_INT64 8L
87 #define JS_ALIGN_OF_FLOAT 4L
88 #define JS_ALIGN_OF_DOUBLE 4L
89 #define JS_ALIGN_OF_POINTER 4L
90 #define JS_ALIGN_OF_WORD 4L
92 #define JS_BYTES_PER_WORD_LOG2 2L
93 #define JS_BYTES_PER_DWORD_LOG2 3L
94 #define PR_WORDS_PER_DWORD_LOG2 1L
95 #endif /* _WIN32 || XP_OS2 || WINCE*/
97 #if defined(_WINDOWS) && !defined(_WIN32) /* WIN16 */
98 #define IS_LITTLE_ENDIAN 1
99 #undef IS_BIG_ENDIAN
101 #define JS_BYTES_PER_BYTE 1L
102 #define JS_BYTES_PER_SHORT 2L
103 #define JS_BYTES_PER_INT 2L
104 #define JS_BYTES_PER_INT64 8L
105 #define JS_BYTES_PER_LONG 4L
106 #define JS_BYTES_PER_FLOAT 4L
107 #define JS_BYTES_PER_DOUBLE 8L
108 #define JS_BYTES_PER_WORD 4L
109 #define JS_BYTES_PER_DWORD 8L
111 #define JS_BITS_PER_BYTE 8L
112 #define JS_BITS_PER_SHORT 16L
113 #define JS_BITS_PER_INT 16L
114 #define JS_BITS_PER_INT64 64L
115 #define JS_BITS_PER_LONG 32L
116 #define JS_BITS_PER_FLOAT 32L
117 #define JS_BITS_PER_DOUBLE 64L
118 #define JS_BITS_PER_WORD 32L
120 #define JS_BITS_PER_BYTE_LOG2 3L
121 #define JS_BITS_PER_SHORT_LOG2 4L
122 #define JS_BITS_PER_INT_LOG2 4L
123 #define JS_BITS_PER_INT64_LOG2 6L
124 #define JS_BITS_PER_LONG_LOG2 5L
125 #define JS_BITS_PER_FLOAT_LOG2 5L
126 #define JS_BITS_PER_DOUBLE_LOG2 6L
127 #define JS_BITS_PER_WORD_LOG2 5L
129 #define JS_ALIGN_OF_SHORT 2L
130 #define JS_ALIGN_OF_INT 2L
131 #define JS_ALIGN_OF_LONG 2L
132 #define JS_ALIGN_OF_INT64 2L
133 #define JS_ALIGN_OF_FLOAT 2L
134 #define JS_ALIGN_OF_DOUBLE 2L
135 #define JS_ALIGN_OF_POINTER 2L
136 #define JS_ALIGN_OF_WORD 2L
138 #define JS_BYTES_PER_WORD_LOG2 2L
139 #define JS_BYTES_PER_DWORD_LOG2 3L
140 #define PR_WORDS_PER_DWORD_LOG2 1L
141 #endif /* defined(_WINDOWS) && !defined(_WIN32) */
143 #elif defined(XP_UNIX) || defined(XP_BEOS)
145 #error "This file is supposed to be auto-generated on UNIX platforms, but the"
146 #error "static version for Mac and Windows platforms is being used."
147 #error "Something's probably wrong with paths/headers/dependencies/Makefiles."
149 #else
151 #error "Must define one of XP_BEOS, XP_OS2, XP_WIN, or XP_UNIX"
153 #endif
155 #ifndef JS_STACK_GROWTH_DIRECTION
156 #define JS_STACK_GROWTH_DIRECTION (-1)
157 #endif
159 #endif /* js_cpucfg___ */