Merge mozilla-central and tracemonkey. (a=blockers)
[mozilla-central.git] / js / src / jsotypes.h
blobbfc85ccc2367bf0a7d6c020038b112211235ae70
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is Mozilla Communicator client code, released
16 * March 31, 1998.
18 * The Initial Developer of the Original Code is
19 * Netscape Communications Corporation.
20 * Portions created by the Initial Developer are Copyright (C) 1998
21 * the Initial Developer. All Rights Reserved.
23 * Contributor(s):
25 * Alternatively, the contents of this file may be used under the terms of
26 * either of the GNU General Public License Version 2 or later (the "GPL"),
27 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
40 * This section typedefs the old 'native' types to the new PR<type>s.
41 * These definitions are scheduled to be eliminated at the earliest
42 * possible time. The NSPR API is implemented and documented using
43 * the new definitions.
47 * Note that we test for PROTYPES_H, not JSOTYPES_H. This is to avoid
48 * double-definitions of scalar types such as uint32, if NSPR's
49 * protypes.h is also included.
51 #ifndef PROTYPES_H
52 #define PROTYPES_H
54 #ifdef XP_BEOS
55 /* BeOS defines most int types in SupportDefs.h (int8, uint8, int16,
56 * uint16, int32, uint32, int64, uint64), so in the interest of
57 * not conflicting with other definitions elsewhere we have to skip the
58 * #ifdef jungle below, duplicate some definitions, and do our stuff.
60 #include <SupportDefs.h>
62 typedef JSUintn uintn;
63 #ifndef _XP_Core_
64 typedef JSIntn intn;
65 #endif
67 #else
69 /* SVR4 typedef of uint is commonly found on UNIX machines. */
70 #ifdef XP_UNIX
71 #include <sys/types.h>
72 #else
73 typedef JSUintn uint;
74 #endif
76 typedef JSUintn uintn;
77 typedef JSUint64 uint64;
78 typedef JSUint32 uint32;
79 typedef JSUint16 uint16;
80 typedef JSUint8 uint8;
82 #ifndef _XP_Core_
83 typedef JSIntn intn;
84 #endif
87 * On AIX 4.3, sys/inttypes.h (which is included by sys/types.h, a very
88 * common header file) defines the types int8, int16, int32, and int64.
89 * So we don't define these four types here to avoid conflicts in case
90 * the code also includes sys/types.h.
92 #if defined(AIX) && defined(HAVE_SYS_INTTYPES_H)
93 #include <sys/inttypes.h>
94 #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
95 typedef JSInt64 int64;
97 /* Explicit signed keyword for bitfield types is required. */
98 /* Some compilers may treat them as unsigned without it. */
99 typedef signed int int32;
100 typedef signed short int16;
101 typedef signed char int8;
102 #else
103 typedef JSInt64 int64;
105 /* /usr/include/model.h on HP-UX defines int8, int16, and int32 */
106 typedef JSInt32 int32;
107 typedef JSInt16 int16;
108 typedef JSInt8 int8;
109 #endif /* AIX && HAVE_SYS_INTTYPES_H */
111 #endif /* XP_BEOS */
113 typedef JSFloat64 float64;
115 /* Re: jsbit.h */
116 #define TEST_BIT JS_TEST_BIT
117 #define SET_BIT JS_SET_BIT
118 #define CLEAR_BIT JS_CLEAR_BIT
120 /* Re: prarena.h->plarena.h */
121 #define PRArena PLArena
122 #define PRArenaPool PLArenaPool
123 #define PRArenaStats PLArenaStats
124 #define PR_ARENA_ALIGN PL_ARENA_ALIGN
125 #define PR_INIT_ARENA_POOL PL_INIT_ARENA_POOL
126 #define PR_ARENA_ALLOCATE PL_ARENA_ALLOCATE
127 #define PR_ARENA_GROW PL_ARENA_GROW
128 #define PR_ARENA_MARK PL_ARENA_MARK
129 #define PR_CLEAR_UNUSED PL_CLEAR_UNUSED
130 #define PR_CLEAR_ARENA PL_CLEAR_ARENA
131 #define PR_ARENA_RELEASE PL_ARENA_RELEASE
132 #define PR_COUNT_ARENA PL_COUNT_ARENA
133 #define PR_ARENA_DESTROY PL_ARENA_DESTROY
134 #define PR_InitArenaPool PL_InitArenaPool
135 #define PR_FreeArenaPool PL_FreeArenaPool
136 #define PR_FinishArenaPool PL_FinishArenaPool
137 #define PR_CompactArenaPool PL_CompactArenaPool
138 #define PR_ArenaFinish PL_ArenaFinish
139 #define PR_ArenaAllocate PL_ArenaAllocate
140 #define PR_ArenaGrow PL_ArenaGrow
141 #define PR_ArenaRelease PL_ArenaRelease
142 #define PR_ArenaCountAllocation PL_ArenaCountAllocation
143 #define PR_ArenaCountInplaceGrowth PL_ArenaCountInplaceGrowth
144 #define PR_ArenaCountGrowth PL_ArenaCountGrowth
145 #define PR_ArenaCountRelease PL_ArenaCountRelease
146 #define PR_ArenaCountRetract PL_ArenaCountRetract
148 /* Re: prevent.h->plevent.h */
149 #define PREvent PLEvent
150 #define PREventQueue PLEventQueue
151 #define PR_CreateEventQueue PL_CreateEventQueue
152 #define PR_DestroyEventQueue PL_DestroyEventQueue
153 #define PR_GetEventQueueMonitor PL_GetEventQueueMonitor
154 #define PR_ENTER_EVENT_QUEUE_MONITOR PL_ENTER_EVENT_QUEUE_MONITOR
155 #define PR_EXIT_EVENT_QUEUE_MONITOR PL_EXIT_EVENT_QUEUE_MONITOR
156 #define PR_PostEvent PL_PostEvent
157 #define PR_PostSynchronousEvent PL_PostSynchronousEvent
158 #define PR_GetEvent PL_GetEvent
159 #define PR_EventAvailable PL_EventAvailable
160 #define PREventFunProc PLEventFunProc
161 #define PR_MapEvents PL_MapEvents
162 #define PR_RevokeEvents PL_RevokeEvents
163 #define PR_ProcessPendingEvents PL_ProcessPendingEvents
164 #define PR_WaitForEvent PL_WaitForEvent
165 #define PR_EventLoop PL_EventLoop
166 #define PR_GetEventQueueSelectFD PL_GetEventQueueSelectFD
167 #define PRHandleEventProc PLHandleEventProc
168 #define PRDestroyEventProc PLDestroyEventProc
169 #define PR_InitEvent PL_InitEvent
170 #define PR_GetEventOwner PL_GetEventOwner
171 #define PR_HandleEvent PL_HandleEvent
172 #define PR_DestroyEvent PL_DestroyEvent
173 #define PR_DequeueEvent PL_DequeueEvent
174 #define PR_GetMainEventQueue PL_GetMainEventQueue
176 /* Re: prhash.h->plhash.h */
177 #define PRHashEntry PLHashEntry
178 #define PRHashTable PLHashTable
179 #define PRHashNumber PLHashNumber
180 #define PRHashFunction PLHashFunction
181 #define PRHashComparator PLHashComparator
182 #define PRHashEnumerator PLHashEnumerator
183 #define PRHashAllocOps PLHashAllocOps
184 #define PR_NewHashTable PL_NewHashTable
185 #define PR_HashTableDestroy PL_HashTableDestroy
186 #define PR_HashTableRawLookup PL_HashTableRawLookup
187 #define PR_HashTableRawAdd PL_HashTableRawAdd
188 #define PR_HashTableRawRemove PL_HashTableRawRemove
189 #define PR_HashTableAdd PL_HashTableAdd
190 #define PR_HashTableRemove PL_HashTableRemove
191 #define PR_HashTableEnumerateEntries PL_HashTableEnumerateEntries
192 #define PR_HashTableLookup PL_HashTableLookup
193 #define PR_HashTableDump PL_HashTableDump
194 #define PR_HashString PL_HashString
195 #define PR_CompareStrings PL_CompareStrings
196 #define PR_CompareValues PL_CompareValues
198 #endif /* !defined(PROTYPES_H) */