1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3 * The contents of this file are subject to the Mozilla Public
4 * License Version 1.1 (the "License"); you may not use this file
5 * except in compliance with the License. You may obtain a copy of
6 * the License at http://www.mozilla.org/MPL/
8 * Software distributed under the License is distributed on an "AS
9 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10 * implied. See the License for the specific language governing
11 * rights and limitations under the License.
13 * The Original Code is the Netscape Portable Runtime (NSPR).
15 * The Initial Developer of the Original Code is Netscape
16 * Communications Corporation. Portions created by Netscape are
17 * Copyright (C) 1998-2000 Netscape Communications Corporation. All
21 * Portions Copyright (c) 2004-2006, Nokia Corporation
24 * Alternatively, the contents of this file may be used under the
25 * terms of the GNU General Public License Version 2 or later (the
26 * "GPL"), in which case the provisions of the GPL are applicable
27 * instead of those above. If you wish to allow use of your
28 * version of this file only under the terms of the GPL and not to
29 * allow others to use your version of this file under the MPL,
30 * indicate your decision by deleting the provisions above and
31 * replace them with the notice and other provisions required by
32 * the GPL. If you do not delete the provisions above, a recipient
33 * may use your version of this file under either the MPL or the
38 * Nokia modified this file, by changing certain variables for the purpose of
39 * porting the file to the Symbian platform on May 1st, 2004.
43 #ifndef nspr_cpucfg___
44 #define nspr_cpucfg___
69 #define PR_AF_INET6 23 /* same as AF_INET6 */
71 #if defined(_M_IX86) || defined(_X86_) || defined(__SYMBIAN32__)
73 #define IS_LITTLE_ENDIAN 1
76 #define PR_BYTES_PER_BYTE 1
77 #define PR_BYTES_PER_SHORT 2
78 #define PR_BYTES_PER_INT 4
79 #define PR_BYTES_PER_INT64 8
80 #define PR_BYTES_PER_LONG 4
81 #define PR_BYTES_PER_FLOAT 4
82 #define PR_BYTES_PER_WORD 4
83 #define PR_BYTES_PER_DWORD 8
84 #define PR_BYTES_PER_DOUBLE 8
86 #define PR_BITS_PER_BYTE 8
87 #define PR_BITS_PER_SHORT 16
88 #define PR_BITS_PER_INT 32
89 #define PR_BITS_PER_INT64 64
90 #define PR_BITS_PER_LONG 32
91 #define PR_BITS_PER_FLOAT 32
92 #define PR_BITS_PER_WORD 32
93 #define PR_BITS_PER_DWORD 64
94 #define PR_BITS_PER_DOUBLE 64
96 #define PR_BITS_PER_BYTE_LOG2 3
97 #define PR_BITS_PER_SHORT_LOG2 4
98 #define PR_BITS_PER_INT_LOG2 5
99 #define PR_BITS_PER_INT64_LOG2 6
100 #define PR_BITS_PER_LONG_LOG2 5
101 #define PR_BITS_PER_FLOAT_LOG2 5
102 #define PR_BITS_PER_WORD_LOG2 5
103 #define PR_BITS_PER_DWORD_LOG2 6
104 #define PR_BITS_PER_DOUBLE_LOG2 6
106 #define PR_ALIGN_OF_SHORT 2
107 #define PR_ALIGN_OF_INT 4
108 #define PR_ALIGN_OF_LONG 4
109 #define PR_ALIGN_OF_INT64 8
110 #define PR_ALIGN_OF_FLOAT 4
111 #define PR_ALIGN_OF_WORD 4
112 #define PR_ALIGN_OF_DWORD 8
113 #define PR_ALIGN_OF_DOUBLE 4
114 #define PR_ALIGN_OF_POINTER 4
116 #define PR_BYTES_PER_WORD_LOG2 2
117 #define PR_BYTES_PER_DWORD_LOG2 2
119 #elif defined(_ALPHA_)
121 #define IS_LITTLE_ENDIAN 1
124 #define PR_BYTES_PER_BYTE 1
125 #define PR_BYTES_PER_SHORT 2
126 #define PR_BYTES_PER_INT 4
127 #define PR_BYTES_PER_INT64 8
128 #define PR_BYTES_PER_LONG 4
129 #define PR_BYTES_PER_FLOAT 4
130 #define PR_BYTES_PER_DOUBLE 8
131 #define PR_BYTES_PER_WORD 4
132 #define PR_BYTES_PER_DWORD 8
134 #define PR_BITS_PER_BYTE 8
135 #define PR_BITS_PER_SHORT 16
136 #define PR_BITS_PER_INT 32
137 #define PR_BITS_PER_INT64 64
138 #define PR_BITS_PER_LONG 32
139 #define PR_BITS_PER_FLOAT 32
140 #define PR_BITS_PER_DOUBLE 64
141 #define PR_BITS_PER_WORD 32
143 #define PR_BITS_PER_BYTE_LOG2 3
144 #define PR_BITS_PER_SHORT_LOG2 4
145 #define PR_BITS_PER_INT_LOG2 5
146 #define PR_BITS_PER_INT64_LOG2 6
147 #define PR_BITS_PER_LONG_LOG2 5
148 #define PR_BITS_PER_FLOAT_LOG2 5
149 #define PR_BITS_PER_DOUBLE_LOG2 6
150 #define PR_BITS_PER_WORD_LOG2 5
152 #define PR_BYTES_PER_WORD_LOG2 2
153 #define PR_BYTES_PER_DWORD_LOG2 3
155 #define PR_ALIGN_OF_SHORT 2
156 #define PR_ALIGN_OF_INT 4
157 #define PR_ALIGN_OF_LONG 4
158 #define PR_ALIGN_OF_INT64 8
159 #define PR_ALIGN_OF_FLOAT 4
160 #define PR_ALIGN_OF_DOUBLE 8
161 #define PR_ALIGN_OF_POINTER 4
163 #else /* defined(_M_IX86) || defined(_X86_) */
165 #error unknown processor architecture
167 #endif /* defined(_M_IX86) || defined(_X86_) */
169 #define HAVE_LONG_LONG
171 #ifndef NO_NSPR_10_SUPPORT
173 #define BYTES_PER_BYTE PR_BYTES_PER_BYTE
174 #define BYTES_PER_SHORT PR_BYTES_PER_SHORT
175 #define BYTES_PER_INT PR_BYTES_PER_INT
176 #define BYTES_PER_INT64 PR_BYTES_PER_INT64
177 #define BYTES_PER_LONG PR_BYTES_PER_LONG
178 #define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
179 #define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
180 #define BYTES_PER_WORD PR_BYTES_PER_WORD
181 #define BYTES_PER_DWORD PR_BYTES_PER_DWORD
183 #define BITS_PER_BYTE PR_BITS_PER_BYTE
184 #define BITS_PER_SHORT PR_BITS_PER_SHORT
185 #define BITS_PER_INT PR_BITS_PER_INT
186 #define BITS_PER_INT64 PR_BITS_PER_INT64
187 #define BITS_PER_LONG PR_BITS_PER_LONG
188 #define BITS_PER_FLOAT PR_BITS_PER_FLOAT
189 #define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
190 #define BITS_PER_WORD PR_BITS_PER_WORD
192 #define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
193 #define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
194 #define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
195 #define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
196 #define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
197 #define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
198 #define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
199 #define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
201 #define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
202 #define ALIGN_OF_INT PR_ALIGN_OF_INT
203 #define ALIGN_OF_LONG PR_ALIGN_OF_LONG
204 #define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
205 #define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
206 #define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
207 #define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
208 #define ALIGN_OF_WORD PR_ALIGN_OF_WORD
210 #define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
211 #define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
212 #define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
214 #endif /* NO_NSPR_10_SUPPORT */
216 #endif /* nspr_cpucfg___ */