OLD | NEW |
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 /* ***** BEGIN LICENSE BLOCK ***** | 2 /* ***** BEGIN LICENSE BLOCK ***** |
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
4 * | 4 * |
5 * The contents of this file are subject to the Mozilla Public License Version | 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 | 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 | 7 * the License. You may obtain a copy of the License at |
8 * http://www.mozilla.org/MPL/ | 8 * http://www.mozilla.org/MPL/ |
9 * | 9 * |
10 * Software distributed under the License is distributed on an "AS IS" basis, | 10 * Software distributed under the License is distributed on an "AS IS" basis, |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 #define PR_EXTERN(__type) extern __declspec(dllexport) __type | 129 #define PR_EXTERN(__type) extern __declspec(dllexport) __type |
130 #define PR_IMPLEMENT(__type) __declspec(dllexport) __type | 130 #define PR_IMPLEMENT(__type) __declspec(dllexport) __type |
131 #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type | 131 #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type |
132 #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type | 132 #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type |
133 | 133 |
134 #define PR_CALLBACK | 134 #define PR_CALLBACK |
135 #define PR_CALLBACK_DECL | 135 #define PR_CALLBACK_DECL |
136 #define PR_STATIC_CALLBACK(__x) static __x | 136 #define PR_STATIC_CALLBACK(__x) static __x |
137 | 137 |
138 #elif defined(WIN16) | |
139 | |
140 #define PR_CALLBACK_DECL __cdecl | |
141 | |
142 #if defined(_WINDLL) | |
143 #define PR_EXPORT(__type) extern __type _cdecl _export _loadds | |
144 #define PR_IMPORT(__type) extern __type _cdecl _export _loadds | |
145 #define PR_EXPORT_DATA(__type) extern __type _export | |
146 #define PR_IMPORT_DATA(__type) extern __type _export | |
147 | |
148 #define PR_EXTERN(__type) extern __type _cdecl _export _loadds | |
149 #define PR_IMPLEMENT(__type) __type _cdecl _export _loadds | |
150 #define PR_EXTERN_DATA(__type) extern __type _export | |
151 #define PR_IMPLEMENT_DATA(__type) __type _export | |
152 | |
153 #define PR_CALLBACK __cdecl __loadds | |
154 #define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK | |
155 | |
156 #else /* this must be .EXE */ | |
157 #define PR_EXPORT(__type) extern __type _cdecl _export | |
158 #define PR_IMPORT(__type) extern __type _cdecl _export | |
159 #define PR_EXPORT_DATA(__type) extern __type _export | |
160 #define PR_IMPORT_DATA(__type) extern __type _export | |
161 | |
162 #define PR_EXTERN(__type) extern __type _cdecl _export | |
163 #define PR_IMPLEMENT(__type) __type _cdecl _export | |
164 #define PR_EXTERN_DATA(__type) extern __type _export | |
165 #define PR_IMPLEMENT_DATA(__type) __type _export | |
166 | |
167 #define PR_CALLBACK __cdecl __loadds | |
168 #define PR_STATIC_CALLBACK(__x) __x PR_CALLBACK | |
169 #endif /* _WINDLL */ | |
170 | |
171 #elif defined(XP_MAC) | |
172 | |
173 #define PR_EXPORT(__type) extern __declspec(export) __type | |
174 #define PR_EXPORT_DATA(__type) extern __declspec(export) __type | |
175 #define PR_IMPORT(__type) extern __declspec(export) __type | |
176 #define PR_IMPORT_DATA(__type) extern __declspec(export) __type | |
177 | |
178 #define PR_EXTERN(__type) extern __declspec(export) __type | |
179 #define PR_IMPLEMENT(__type) __declspec(export) __type | |
180 #define PR_EXTERN_DATA(__type) extern __declspec(export) __type | |
181 #define PR_IMPLEMENT_DATA(__type) __declspec(export) __type | |
182 | |
183 #define PR_CALLBACK | |
184 #define PR_CALLBACK_DECL | |
185 #define PR_STATIC_CALLBACK(__x) static __x | |
186 | |
187 #elif defined(XP_OS2) && defined(__declspec) | 138 #elif defined(XP_OS2) && defined(__declspec) |
188 | 139 |
189 #define PR_EXPORT(__type) extern __declspec(dllexport) __type | 140 #define PR_EXPORT(__type) extern __declspec(dllexport) __type |
190 #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type | 141 #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type |
191 #define PR_IMPORT(__type) extern __declspec(dllimport) __type | 142 #define PR_IMPORT(__type) extern __declspec(dllimport) __type |
192 #define PR_IMPORT_DATA(__type) extern __declspec(dllimport) __type | 143 #define PR_IMPORT_DATA(__type) extern __declspec(dllimport) __type |
193 | 144 |
194 #define PR_EXTERN(__type) extern __declspec(dllexport) __type | 145 #define PR_EXTERN(__type) extern __declspec(dllexport) __type |
195 #define PR_IMPLEMENT(__type) __declspec(dllexport) __type | 146 #define PR_IMPLEMENT(__type) __declspec(dllexport) __type |
196 #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type | 147 #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type |
197 #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type | 148 #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type |
198 | 149 |
199 #define PR_CALLBACK | 150 #define PR_CALLBACK |
200 #define PR_CALLBACK_DECL | 151 #define PR_CALLBACK_DECL |
201 #define PR_STATIC_CALLBACK(__x) static __x | 152 #define PR_STATIC_CALLBACK(__x) static __x |
202 | 153 |
203 #elif defined(XP_OS2_VACPP) | 154 #elif defined(SYMBIAN) |
204 | 155 |
205 #define PR_EXPORT(__type) extern __type | 156 #define PR_EXPORT(__type) extern __declspec(dllexport) __type |
206 #define PR_EXPORT_DATA(__type) extern __type | 157 #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type |
207 #define PR_IMPORT(__type) extern __type | 158 #ifdef __WINS__ |
208 #define PR_IMPORT_DATA(__type) extern __type | 159 #define PR_IMPORT(__type) extern __declspec(dllexport) __type |
| 160 #define PR_IMPORT_DATA(__type) extern __declspec(dllexport) __type |
| 161 #else |
| 162 #define PR_IMPORT(__type) extern __declspec(dllimport) __type |
| 163 #define PR_IMPORT_DATA(__type) extern __declspec(dllimport) __type |
| 164 #endif |
209 | 165 |
210 #define PR_EXTERN(__type) extern __type | 166 #define PR_EXTERN(__type) extern __type |
211 #define PR_IMPLEMENT(__type) __type | 167 #define PR_IMPLEMENT(__type) __type |
212 #define PR_EXTERN_DATA(__type) extern __type | 168 #define PR_EXTERN_DATA(__type) extern __type |
213 #define PR_IMPLEMENT_DATA(__type) __type | 169 #define PR_IMPLEMENT_DATA(__type) __type |
214 #define PR_CALLBACK _Optlink | 170 |
| 171 #define PR_CALLBACK |
215 #define PR_CALLBACK_DECL | 172 #define PR_CALLBACK_DECL |
216 #define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK | 173 #define PR_STATIC_CALLBACK(__x) static __x |
217 | 174 |
218 #else /* Unix */ | 175 #else /* Unix */ |
219 | 176 |
220 /* GCC 3.3 and later support the visibility attribute. */ | 177 /* GCC 3.3 and later support the visibility attribute. */ |
221 #if (__GNUC__ >= 4) || \ | 178 #if (__GNUC__ >= 4) || \ |
222 (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) | 179 (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) |
223 #define PR_VISIBILITY_DEFAULT __attribute__((visibility("default"))) | 180 #define PR_VISIBILITY_DEFAULT __attribute__((visibility("default"))) |
224 #else | 181 #else |
225 #define PR_VISIBILITY_DEFAULT | 182 #define PR_VISIBILITY_DEFAULT |
226 #endif | 183 #endif |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 #define PR_MAX(x,y) ((x)>(y)?(x):(y)) | 251 #define PR_MAX(x,y) ((x)>(y)?(x):(y)) |
295 #define PR_ABS(x) ((x)<0?-(x):(x)) | 252 #define PR_ABS(x) ((x)<0?-(x):(x)) |
296 | 253 |
297 PR_BEGIN_EXTERN_C | 254 PR_BEGIN_EXTERN_C |
298 | 255 |
299 /************************************************************************ | 256 /************************************************************************ |
300 ** TYPES: PRUint8 | 257 ** TYPES: PRUint8 |
301 ** PRInt8 | 258 ** PRInt8 |
302 ** DESCRIPTION: | 259 ** DESCRIPTION: |
303 ** The int8 types are known to be 8 bits each. There is no type that | 260 ** The int8 types are known to be 8 bits each. There is no type that |
304 ** is equivalent to a plain "char". | 261 ** is equivalent to a plain "char". |
305 ************************************************************************/ | 262 ************************************************************************/ |
306 #if PR_BYTES_PER_BYTE == 1 | 263 #if PR_BYTES_PER_BYTE == 1 |
307 typedef unsigned char PRUint8; | 264 typedef unsigned char PRUint8; |
308 /* | 265 /* |
309 ** Some cfront-based C++ compilers do not like 'signed char' and | 266 ** Some cfront-based C++ compilers do not like 'signed char' and |
310 ** issue the warning message: | 267 ** issue the warning message: |
311 ** warning: "signed" not implemented (ignored) | 268 ** warning: "signed" not implemented (ignored) |
312 ** For these compilers, we have to define PRInt8 as plain 'char'. | 269 ** For these compilers, we have to define PRInt8 as plain 'char'. |
313 ** Make sure that plain 'char' is indeed signed under these compilers. | 270 ** Make sure that plain 'char' is indeed signed under these compilers. |
314 */ | 271 */ |
(...skipping 18 matching lines...) Expand all Loading... |
333 ************************************************************************/ | 290 ************************************************************************/ |
334 | 291 |
335 #define PR_INT8_MAX 127 | 292 #define PR_INT8_MAX 127 |
336 #define PR_INT8_MIN (-128) | 293 #define PR_INT8_MIN (-128) |
337 #define PR_UINT8_MAX 255U | 294 #define PR_UINT8_MAX 255U |
338 | 295 |
339 /************************************************************************ | 296 /************************************************************************ |
340 ** TYPES: PRUint16 | 297 ** TYPES: PRUint16 |
341 ** PRInt16 | 298 ** PRInt16 |
342 ** DESCRIPTION: | 299 ** DESCRIPTION: |
343 ** The int16 types are known to be 16 bits each. | 300 ** The int16 types are known to be 16 bits each. |
344 ************************************************************************/ | 301 ************************************************************************/ |
345 #if PR_BYTES_PER_SHORT == 2 | 302 #if PR_BYTES_PER_SHORT == 2 |
346 typedef unsigned short PRUint16; | 303 typedef unsigned short PRUint16; |
347 typedef short PRInt16; | 304 typedef short PRInt16; |
348 #else | 305 #else |
349 #error No suitable type for PRInt16/PRUint16 | 306 #error No suitable type for PRInt16/PRUint16 |
350 #endif | 307 #endif |
351 | 308 |
352 /************************************************************************ | 309 /************************************************************************ |
353 * MACROS: PR_INT16_MAX | 310 * MACROS: PR_INT16_MAX |
354 * PR_INT16_MIN | 311 * PR_INT16_MIN |
355 * PR_UINT16_MAX | 312 * PR_UINT16_MAX |
356 * DESCRIPTION: | 313 * DESCRIPTION: |
357 * The maximum and minimum values of a PRInt16 or PRUint16. | 314 * The maximum and minimum values of a PRInt16 or PRUint16. |
358 ************************************************************************/ | 315 ************************************************************************/ |
359 | 316 |
360 #define PR_INT16_MAX 32767 | 317 #define PR_INT16_MAX 32767 |
361 #define PR_INT16_MIN (-32768) | 318 #define PR_INT16_MIN (-32768) |
362 #define PR_UINT16_MAX 65535U | 319 #define PR_UINT16_MAX 65535U |
363 | 320 |
364 /************************************************************************ | 321 /************************************************************************ |
365 ** TYPES: PRUint32 | 322 ** TYPES: PRUint32 |
366 ** PRInt32 | 323 ** PRInt32 |
367 ** DESCRIPTION: | 324 ** DESCRIPTION: |
368 ** The int32 types are known to be 32 bits each. | 325 ** The int32 types are known to be 32 bits each. |
369 ************************************************************************/ | 326 ************************************************************************/ |
370 #if PR_BYTES_PER_INT == 4 | 327 #if PR_BYTES_PER_INT == 4 |
371 typedef unsigned int PRUint32; | 328 typedef unsigned int PRUint32; |
372 typedef int PRInt32; | 329 typedef int PRInt32; |
373 #define PR_INT32(x) x | 330 #define PR_INT32(x) x |
374 #define PR_UINT32(x) x ## U | 331 #define PR_UINT32(x) x ## U |
375 #elif PR_BYTES_PER_LONG == 4 | 332 #elif PR_BYTES_PER_LONG == 4 |
376 typedef unsigned long PRUint32; | 333 typedef unsigned long PRUint32; |
377 typedef long PRInt32; | 334 typedef long PRInt32; |
378 #define PR_INT32(x) x ## L | 335 #define PR_INT32(x) x ## L |
(...skipping 18 matching lines...) Expand all Loading... |
397 ** TYPES: PRUint64 | 354 ** TYPES: PRUint64 |
398 ** PRInt64 | 355 ** PRInt64 |
399 ** DESCRIPTION: | 356 ** DESCRIPTION: |
400 ** The int64 types are known to be 64 bits each. Care must be used when | 357 ** The int64 types are known to be 64 bits each. Care must be used when |
401 ** declaring variables of type PRUint64 or PRInt64. Different hardware | 358 ** declaring variables of type PRUint64 or PRInt64. Different hardware |
402 ** architectures and even different compilers have varying support for | 359 ** architectures and even different compilers have varying support for |
403 ** 64 bit values. The only guaranteed portability requires the use of | 360 ** 64 bit values. The only guaranteed portability requires the use of |
404 ** the LL_ macros (see prlong.h). | 361 ** the LL_ macros (see prlong.h). |
405 ************************************************************************/ | 362 ************************************************************************/ |
406 #ifdef HAVE_LONG_LONG | 363 #ifdef HAVE_LONG_LONG |
407 #if PR_BYTES_PER_LONG == 8 | 364 /* Keep this in sync with prlong.h. */ |
| 365 /* |
| 366 * On 64-bit Mac OS X, uint64 needs to be defined as unsigned long long to |
| 367 * match uint64_t, otherwise our uint64 typedef conflicts with the uint64 |
| 368 * typedef in cssmconfig.h, which CoreServices.h includes indirectly. |
| 369 */ |
| 370 #if PR_BYTES_PER_LONG == 8 && !defined(__APPLE__) |
408 typedef long PRInt64; | 371 typedef long PRInt64; |
409 typedef unsigned long PRUint64; | 372 typedef unsigned long PRUint64; |
410 #elif defined(WIN16) | |
411 typedef __int64 PRInt64; | |
412 typedef unsigned __int64 PRUint64; | |
413 #elif defined(WIN32) && !defined(__GNUC__) | 373 #elif defined(WIN32) && !defined(__GNUC__) |
414 typedef __int64 PRInt64; | 374 typedef __int64 PRInt64; |
415 typedef unsigned __int64 PRUint64; | 375 typedef unsigned __int64 PRUint64; |
416 #else | 376 #else |
417 typedef long long PRInt64; | 377 typedef long long PRInt64; |
418 typedef unsigned long long PRUint64; | 378 typedef unsigned long long PRUint64; |
419 #endif /* PR_BYTES_PER_LONG == 8 */ | 379 #endif /* PR_BYTES_PER_LONG == 8 */ |
420 #else /* !HAVE_LONG_LONG */ | 380 #else /* !HAVE_LONG_LONG */ |
421 typedef struct { | 381 typedef struct { |
422 #ifdef IS_LITTLE_ENDIAN | 382 #ifdef IS_LITTLE_ENDIAN |
423 PRUint32 lo, hi; | 383 PRUint32 lo, hi; |
424 #else | 384 #else |
425 PRUint32 hi, lo; | 385 PRUint32 hi, lo; |
426 #endif | 386 #endif |
427 } PRInt64; | 387 } PRInt64; |
428 typedef PRInt64 PRUint64; | 388 typedef PRInt64 PRUint64; |
429 #endif /* !HAVE_LONG_LONG */ | 389 #endif /* !HAVE_LONG_LONG */ |
430 | 390 |
431 /************************************************************************ | 391 /************************************************************************ |
432 ** TYPES: PRUintn | 392 ** TYPES: PRUintn |
433 ** PRIntn | 393 ** PRIntn |
434 ** DESCRIPTION: | 394 ** DESCRIPTION: |
435 ** The PRIntn types are most appropriate for automatic variables. They are | 395 ** The PRIntn types are most appropriate for automatic variables. They are |
436 ** guaranteed to be at least 16 bits, though various architectures may | 396 ** guaranteed to be at least 16 bits, though various architectures may |
437 ** define them to be wider (e.g., 32 or even 64 bits). These types are | 397 ** define them to be wider (e.g., 32 or even 64 bits). These types are |
438 ** never valid for fields of a structure. | 398 ** never valid for fields of a structure. |
439 ************************************************************************/ | 399 ************************************************************************/ |
440 #if PR_BYTES_PER_INT >= 2 | 400 #if PR_BYTES_PER_INT >= 2 |
441 typedef int PRIntn; | 401 typedef int PRIntn; |
442 typedef unsigned int PRUintn; | 402 typedef unsigned int PRUintn; |
443 #else | 403 #else |
444 #error 'sizeof(int)' not sufficient for platform use | 404 #error 'sizeof(int)' not sufficient for platform use |
445 #endif | 405 #endif |
446 | 406 |
447 /************************************************************************ | 407 /************************************************************************ |
448 ** TYPES: PRFloat64 | 408 ** TYPES: PRFloat64 |
449 ** DESCRIPTION: | 409 ** DESCRIPTION: |
450 ** NSPR's floating point type is always 64 bits. | 410 ** NSPR's floating point type is always 64 bits. |
451 ************************************************************************/ | 411 ************************************************************************/ |
452 typedef double PRFloat64; | 412 typedef double PRFloat64; |
453 | 413 |
454 /************************************************************************ | 414 /************************************************************************ |
455 ** TYPES: PRSize | 415 ** TYPES: PRSize |
456 ** DESCRIPTION: | 416 ** DESCRIPTION: |
457 ** A type for representing the size of objects. | 417 ** A type for representing the size of objects. |
458 ************************************************************************/ | 418 ************************************************************************/ |
459 typedef size_t PRSize; | 419 typedef size_t PRSize; |
460 | 420 |
461 | 421 |
462 /************************************************************************ | 422 /************************************************************************ |
463 ** TYPES: PROffset32, PROffset64 | 423 ** TYPES: PROffset32, PROffset64 |
464 ** DESCRIPTION: | 424 ** DESCRIPTION: |
465 ** A type for representing byte offsets from some location. | 425 ** A type for representing byte offsets from some location. |
466 ************************************************************************/ | 426 ************************************************************************/ |
467 typedef PRInt32 PROffset32; | 427 typedef PRInt32 PROffset32; |
468 typedef PRInt64 PROffset64; | 428 typedef PRInt64 PROffset64; |
469 | 429 |
470 /************************************************************************ | 430 /************************************************************************ |
471 ** TYPES: PRPtrDiff | 431 ** TYPES: PRPtrDiff |
472 ** DESCRIPTION: | 432 ** DESCRIPTION: |
473 ** A type for pointer difference. Variables of this type are suitable | 433 ** A type for pointer difference. Variables of this type are suitable |
474 ** for storing a pointer or pointer subtraction. | 434 ** for storing a pointer or pointer subtraction. |
475 ************************************************************************/ | 435 ************************************************************************/ |
476 typedef ptrdiff_t PRPtrdiff; | 436 typedef ptrdiff_t PRPtrdiff; |
477 | 437 |
478 /************************************************************************ | 438 /************************************************************************ |
479 ** TYPES: PRUptrdiff | 439 ** TYPES: PRUptrdiff |
480 ** DESCRIPTION: | 440 ** DESCRIPTION: |
481 ** A type for pointer difference. Variables of this type are suitable | 441 ** A type for pointer difference. Variables of this type are suitable |
482 ** for storing a pointer or pointer sutraction. | 442 ** for storing a pointer or pointer sutraction. |
483 ************************************************************************/ | 443 ************************************************************************/ |
484 #ifdef _WIN64 | 444 #ifdef _WIN64 |
485 typedef unsigned __int64 PRUptrdiff; | 445 typedef PRUint64 PRUptrdiff; |
486 #else | 446 #else |
487 typedef unsigned long PRUptrdiff; | 447 typedef unsigned long PRUptrdiff; |
488 #endif | 448 #endif |
489 | 449 |
490 /************************************************************************ | 450 /************************************************************************ |
491 ** TYPES: PRBool | 451 ** TYPES: PRBool |
492 ** DESCRIPTION: | 452 ** DESCRIPTION: |
493 ** Use PRBool for variables and parameter types. Use PR_FALSE and PR_TRUE | 453 ** Use PRBool for variables and parameter types. Use PR_FALSE and PR_TRUE |
494 ** for clarity of target type in assignments and actual arguments. Use | 454 ** for clarity of target type in assignments and actual arguments. Use |
495 ** 'if (bool)', 'while (!bool)', '(bool) ? x : y' etc., to test booleans | 455 ** 'if (bool)', 'while (!bool)', '(bool) ? x : y' etc., to test booleans |
496 ** just as you would C int-valued conditions. | 456 ** just as you would C int-valued conditions. |
497 ************************************************************************/ | 457 ************************************************************************/ |
498 typedef PRIntn PRBool; | 458 typedef PRIntn PRBool; |
499 #define PR_TRUE 1 | 459 #define PR_TRUE 1 |
500 #define PR_FALSE 0 | 460 #define PR_FALSE 0 |
501 | 461 |
502 /************************************************************************ | 462 /************************************************************************ |
503 ** TYPES: PRPackedBool | 463 ** TYPES: PRPackedBool |
504 ** DESCRIPTION: | 464 ** DESCRIPTION: |
505 ** Use PRPackedBool within structs where bitfields are not desirable | 465 ** Use PRPackedBool within structs where bitfields are not desirable |
506 ** but minimum and consistant overhead matters. | 466 ** but minimum and consistant overhead matters. |
507 ************************************************************************/ | 467 ************************************************************************/ |
508 typedef PRUint8 PRPackedBool; | 468 typedef PRUint8 PRPackedBool; |
509 | 469 |
510 /* | 470 /* |
511 ** Status code used by some routines that have a single point of failure or | 471 ** Status code used by some routines that have a single point of failure or |
512 ** special status return. | 472 ** special status return. |
513 */ | 473 */ |
514 typedef enum { PR_FAILURE = -1, PR_SUCCESS = 0 } PRStatus; | 474 typedef enum { PR_FAILURE = -1, PR_SUCCESS = 0 } PRStatus; |
515 | 475 |
516 #ifndef __PRUNICHAR__ | 476 #ifndef __PRUNICHAR__ |
517 #define __PRUNICHAR__ | 477 #define __PRUNICHAR__ |
518 #if defined(WIN32) || defined(XP_MAC) | 478 #ifdef WIN32 |
519 typedef wchar_t PRUnichar; | 479 typedef wchar_t PRUnichar; |
520 #else | 480 #else |
521 typedef PRUint16 PRUnichar; | 481 typedef PRUint16 PRUnichar; |
522 #endif | 482 #endif |
523 #endif | 483 #endif |
524 | 484 |
525 /* | 485 /* |
526 ** WARNING: The undocumented data types PRWord and PRUword are | 486 ** WARNING: The undocumented data types PRWord and PRUword are |
527 ** only used in the garbage collection and arena code. Do not | 487 ** only used in the garbage collection and arena code. Do not |
528 ** use PRWord and PRUword in new code. | 488 ** use PRWord and PRUword in new code. |
529 ** | 489 ** |
530 ** A PRWord is an integer that is the same size as a void*. | 490 ** A PRWord is an integer that is the same size as a void*. |
531 ** It implements the notion of a "word" in the Java Virtual | 491 ** It implements the notion of a "word" in the Java Virtual |
532 ** Machine. (See Sec. 3.4 "Words", The Java Virtual Machine | 492 ** Machine. (See Sec. 3.4 "Words", The Java Virtual Machine |
533 ** Specification, Addison-Wesley, September 1996. | 493 ** Specification, Addison-Wesley, September 1996. |
534 ** http://java.sun.com/docs/books/vmspec/index.html.) | 494 ** http://java.sun.com/docs/books/vmspec/index.html.) |
535 */ | 495 */ |
536 #ifdef _WIN64 | 496 #ifdef _WIN64 |
537 typedef __int64 PRWord; | 497 typedef PRInt64 PRWord; |
538 typedef unsigned __int64 PRUword; | 498 typedef PRUint64 PRUword; |
539 #else | 499 #else |
540 typedef long PRWord; | 500 typedef long PRWord; |
541 typedef unsigned long PRUword; | 501 typedef unsigned long PRUword; |
542 #endif | 502 #endif |
543 | 503 |
544 #if defined(NO_NSPR_10_SUPPORT) | 504 #if defined(NO_NSPR_10_SUPPORT) |
545 #else | 505 #else |
546 /********* ???????????????? FIX ME ??????????????????????????? *****/ | 506 /********* ???????????????? FIX ME ??????????????????????????? *****/ |
547 /********************** Some old definitions until pr=>ds transition is done ***
/ | 507 /********************** Some old definitions until pr=>ds transition is done ***
/ |
548 /********************** Also, we are still using NSPR 1.0. GC ******************
/ | 508 /********************** Also, we are still using NSPR 1.0. GC ******************
/ |
(...skipping 24 matching lines...) Expand all Loading... |
573 #define NSPR_BEGIN_EXTERN_C extern "C" { | 533 #define NSPR_BEGIN_EXTERN_C extern "C" { |
574 #define NSPR_END_EXTERN_C } | 534 #define NSPR_END_EXTERN_C } |
575 #else | 535 #else |
576 #define NSPR_BEGIN_EXTERN_C | 536 #define NSPR_BEGIN_EXTERN_C |
577 #define NSPR_END_EXTERN_C | 537 #define NSPR_END_EXTERN_C |
578 #endif | 538 #endif |
579 | 539 |
580 /********* ????????????? End Fix me ?????????????????????????????? *****/ | 540 /********* ????????????? End Fix me ?????????????????????????????? *****/ |
581 #endif /* NO_NSPR_10_SUPPORT */ | 541 #endif /* NO_NSPR_10_SUPPORT */ |
582 | 542 |
| 543 /* |
| 544 ** Compile-time assert. "condition" must be a constant expression. |
| 545 ** The macro can be used only in places where an "extern" declaration is |
| 546 ** allowed. |
| 547 */ |
| 548 #define PR_STATIC_ASSERT(condition) \ |
| 549 extern void pr_static_assert(int arg[(condition) ? 1 : -1]) |
| 550 |
583 PR_END_EXTERN_C | 551 PR_END_EXTERN_C |
584 | 552 |
585 #if !defined(NO_NSPR_10_SUPPORT) | 553 #if !defined(NO_NSPR_10_SUPPORT) |
586 #include "base/basictypes.h" | 554 #include "base/basictypes.h" |
587 #endif | 555 #endif |
588 | 556 |
589 #endif /* prtypes_h___ */ | 557 #endif /* prtypes_h___ */ |
590 | 558 |
OLD | NEW |