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 /* This Source Code Form is subject to the terms of the Mozilla Public | 2 /* This Source Code Form is subject to the terms of the Mozilla Public |
3 * License, v. 2.0. If a copy of the MPL was not distributed with this | 3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
5 | 5 |
6 /* | 6 /* |
7 ** File: prtypes.h | 7 ** File: prtypes.h |
8 ** Description: Definitions of NSPR's basic types | 8 ** Description: Definitions of NSPR's basic types |
9 ** | 9 ** |
10 ** Prototypes and macros used to make up for deficiencies that we have found | 10 ** Prototypes and macros used to make up for deficiencies that we have found |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 ** http://java.sun.com/docs/books/vmspec/index.html.) | 519 ** http://java.sun.com/docs/books/vmspec/index.html.) |
520 */ | 520 */ |
521 #ifdef _WIN64 | 521 #ifdef _WIN64 |
522 typedef PRInt64 PRWord; | 522 typedef PRInt64 PRWord; |
523 typedef PRUint64 PRUword; | 523 typedef PRUint64 PRUword; |
524 #else | 524 #else |
525 typedef long PRWord; | 525 typedef long PRWord; |
526 typedef unsigned long PRUword; | 526 typedef unsigned long PRUword; |
527 #endif | 527 #endif |
528 | 528 |
| 529 /* |
| 530 * PR_PRETEND_NORETURN, specified at the end of a function declaration, |
| 531 * indicates that for the purposes of static analysis, this function does not |
| 532 * return. (The function definition does not need to be annotated.) |
| 533 * |
| 534 * void PR_Assert(const char *s, const char *file, PRIntn ln) |
| 535 * PR_PRETEND_NORETURN; |
| 536 * |
| 537 * Some static analyzers, like scan-build from clang, can use this information |
| 538 * to eliminate false positives. From the upstream documentation of |
| 539 * scan-build: |
| 540 * This attribute is useful for annotating assertion handlers that actually |
| 541 * can return, but for the purpose of using the analyzer we want to pretend |
| 542 * that such functions do not return. |
| 543 */ |
| 544 #ifdef __clang_analyzer__ |
| 545 #if __has_extension(attribute_analyzer_noreturn) |
| 546 #define PR_PRETEND_NORETURN __attribute__((analyzer_noreturn)) |
| 547 #endif |
| 548 #endif |
| 549 |
| 550 #ifndef PR_PRETEND_NORETURN |
| 551 #define PR_PRETEND_NORETURN /* no support */ |
| 552 #endif |
| 553 |
529 #if defined(NO_NSPR_10_SUPPORT) | 554 #if defined(NO_NSPR_10_SUPPORT) |
530 #else | 555 #else |
531 /********* ???????????????? FIX ME ??????????????????????????? *****/ | 556 /********* ???????????????? FIX ME ??????????????????????????? *****/ |
532 /********************** Some old definitions until pr=>ds transition is done ***
/ | 557 /********************** Some old definitions until pr=>ds transition is done ***
/ |
533 /********************** Also, we are still using NSPR 1.0. GC ******************
/ | 558 /********************** Also, we are still using NSPR 1.0. GC ******************
/ |
534 /* | 559 /* |
535 ** Fundamental NSPR macros, used nearly everywhere. | 560 ** Fundamental NSPR macros, used nearly everywhere. |
536 */ | 561 */ |
537 | 562 |
538 #define PR_PUBLIC_API PR_IMPLEMENT | 563 #define PR_PUBLIC_API PR_IMPLEMENT |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 ** The macro can be used only in places where an "extern" declaration is | 597 ** The macro can be used only in places where an "extern" declaration is |
573 ** allowed. | 598 ** allowed. |
574 */ | 599 */ |
575 #define PR_STATIC_ASSERT(condition) \ | 600 #define PR_STATIC_ASSERT(condition) \ |
576 extern void pr_static_assert(int arg[(condition) ? 1 : -1]) | 601 extern void pr_static_assert(int arg[(condition) ? 1 : -1]) |
577 | 602 |
578 PR_END_EXTERN_C | 603 PR_END_EXTERN_C |
579 | 604 |
580 #endif /* prtypes_h___ */ | 605 #endif /* prtypes_h___ */ |
581 | 606 |
OLD | NEW |