Rev 6109 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6109 | Rev 6536 | ||
---|---|---|---|
Line 622... | Line 622... | ||
622 | 622 | ||
623 | #ifndef __DEQUALIFY |
623 | #ifndef __DEQUALIFY |
624 | #define __DEQUALIFY(type, var) ((type)(__uintptr_t)(const volatile void *)(var)) |
624 | #define __DEQUALIFY(type, var) ((type)(__uintptr_t)(const volatile void *)(var)) |
Line 625... | Line -... | ||
625 | #endif |
- | |
626 | - | ||
627 | /*- |
- | |
628 | * The following definitions are an extension of the behavior originally |
- | |
629 | * implemented in |
- | |
630 | * POSIX.1 requires that the macros we test be defined before any standard |
- | |
631 | * header file is included. |
- | |
632 | * |
- | |
633 | * Here's a quick run-down of the versions: |
- | |
634 | * defined(_POSIX_SOURCE) 1003.1-1988 |
- | |
635 | * _POSIX_C_SOURCE == 1 1003.1-1990 |
- | |
636 | * _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option |
- | |
637 | * _POSIX_C_SOURCE == 199309 1003.1b-1993 |
- | |
638 | * _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, |
- | |
639 | * and the omnibus ISO/IEC 9945-1: 1996 |
- | |
640 | * _POSIX_C_SOURCE == 200112 1003.1-2001 |
- | |
641 | * _POSIX_C_SOURCE == 200809 1003.1-2008 |
- | |
642 | * |
- | |
643 | * In addition, the X/Open Portability Guide, which is now the Single UNIX |
- | |
644 | * Specification, defines a feature-test macro which indicates the version of |
- | |
645 | * that specification, and which subsumes _POSIX_C_SOURCE. |
- | |
646 | * |
- | |
647 | * Our macros begin with two underscores to avoid namespace screwage. |
- | |
648 | */ |
- | |
649 | - | ||
650 | /* Deal with _GNU_SOURCE, which implies everything and the kitchen sink */ |
- | |
651 | #ifdef _GNU_SOURCE |
- | |
652 | #undef _XOPEN_SOURCE |
- | |
653 | #define _XOPEN_SOURCE 700 |
- | |
654 | #define __BSD_VISIBLE 1 |
- | |
655 | #define __GNU_VISIBLE 1 |
- | |
656 | #endif |
- | |
657 | - | ||
658 | #define __GNU_VISIBLE 1 |
- | |
659 | - | ||
660 | /* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */ |
- | |
661 | #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1 |
- | |
662 | #undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */ |
- | |
663 | #define _POSIX_C_SOURCE 199009 |
- | |
664 | #endif |
- | |
665 | - | ||
666 | /* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */ |
- | |
667 | #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2 |
- | |
668 | #undef _POSIX_C_SOURCE |
- | |
669 | #define _POSIX_C_SOURCE 199209 |
- | |
670 | #endif |
- | |
671 | - | ||
672 | /* Deal with various X/Open Portability Guides and Single UNIX Spec. */ |
- | |
673 | #ifdef _XOPEN_SOURCE |
- | |
674 | #if _XOPEN_SOURCE - 0 >= 700 |
- | |
675 | #define __XSI_VISIBLE 700 |
- | |
676 | #undef _POSIX_C_SOURCE |
- | |
677 | #define _POSIX_C_SOURCE 200809 |
- | |
678 | #elif _XOPEN_SOURCE - 0 >= 600 |
- | |
679 | #define __XSI_VISIBLE 600 |
- | |
680 | #undef _POSIX_C_SOURCE |
- | |
681 | #define _POSIX_C_SOURCE 200112 |
- | |
682 | #elif _XOPEN_SOURCE - 0 >= 500 |
- | |
683 | #define __XSI_VISIBLE 500 |
- | |
684 | #undef _POSIX_C_SOURCE |
- | |
685 | #define _POSIX_C_SOURCE 199506 |
- | |
686 | #endif |
- | |
687 | #endif |
- | |
688 | - | ||
689 | /* |
- | |
690 | * Deal with all versions of POSIX. The ordering relative to the tests above is |
- | |
691 | * important. |
- | |
692 | */ |
- | |
693 | #if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) |
- | |
694 | #define _POSIX_C_SOURCE 198808 |
- | |
695 | #endif |
- | |
696 | #ifdef _POSIX_C_SOURCE |
- | |
697 | #if _POSIX_C_SOURCE >= 200809 |
- | |
698 | #define __POSIX_VISIBLE 200809 |
- | |
699 | #define __ISO_C_VISIBLE 1999 |
- | |
700 | #elif _POSIX_C_SOURCE >= 200112 |
- | |
701 | #define __POSIX_VISIBLE 200112 |
- | |
702 | #define __ISO_C_VISIBLE 1999 |
- | |
703 | #elif _POSIX_C_SOURCE >= 199506 |
- | |
704 | #define __POSIX_VISIBLE 199506 |
- | |
705 | #define __ISO_C_VISIBLE 1990 |
- | |
706 | #elif _POSIX_C_SOURCE >= 199309 |
- | |
707 | #define __POSIX_VISIBLE 199309 |
- | |
708 | #define __ISO_C_VISIBLE 1990 |
- | |
709 | #elif _POSIX_C_SOURCE >= 199209 |
- | |
710 | #define __POSIX_VISIBLE 199209 |
- | |
711 | #define __ISO_C_VISIBLE 1990 |
- | |
712 | #elif _POSIX_C_SOURCE >= 199009 |
- | |
713 | #define __POSIX_VISIBLE 199009 |
- | |
714 | #define __ISO_C_VISIBLE 1990 |
- | |
715 | #else |
- | |
716 | #define __POSIX_VISIBLE 198808 |
- | |
717 | #define __ISO_C_VISIBLE 0 |
- | |
718 | #endif /* _POSIX_C_SOURCE */ |
- | |
719 | #else |
- | |
720 | /*- |
- | |
721 | * Deal with _ANSI_SOURCE: |
- | |
722 | * If it is defined, and no other compilation environment is explicitly |
- | |
723 | * requested, then define our internal feature-test macros to zero. This |
- | |
724 | * makes no difference to the preprocessor (undefined symbols in preprocessing |
- | |
725 | * expressions are defined to have value zero), but makes it more convenient for |
- | |
726 | * a test program to print out the values. |
- | |
727 | * |
- | |
728 | * If a program mistakenly defines _ANSI_SOURCE and some other macro such as |
- | |
729 | * _POSIX_C_SOURCE, we will assume that it wants the broader compilation |
- | |
730 | * environment (and in fact we will never get here). |
- | |
731 | */ |
- | |
732 | #if defined(_ANSI_SOURCE) /* Hide almost everything. */ |
- | |
733 | #define __POSIX_VISIBLE 0 |
- | |
734 | #define __XSI_VISIBLE 0 |
- | |
735 | #define __BSD_VISIBLE 0 |
- | |
736 | #define __ISO_C_VISIBLE 1990 |
- | |
737 | #elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */ |
- | |
738 | #define __POSIX_VISIBLE 0 |
- | |
739 | #define __XSI_VISIBLE 0 |
- | |
740 | #define __BSD_VISIBLE 0 |
- | |
741 | #define __ISO_C_VISIBLE 1999 |
- | |
742 | #elif defined(_C11_SOURCE) /* Localism to specify strict C11 env. */ |
- | |
743 | #define __POSIX_VISIBLE 0 |
- | |
744 | #define __XSI_VISIBLE 0 |
- | |
745 | #define __BSD_VISIBLE 0 |
- | |
746 | #define __ISO_C_VISIBLE 2011 |
- | |
747 | #else /* Default: everything except __GNU_VISIBLE. */ |
- | |
748 | #define __POSIX_VISIBLE 200809 |
- | |
749 | #define __XSI_VISIBLE 700 |
- | |
750 | #define __BSD_VISIBLE 1 |
- | |
751 | #define __ISO_C_VISIBLE 2011 |
- | |
752 | #endif |
- | |
753 | #endif |
625 | #endif |
754 | 626 | ||
755 | /* |
627 | /* |
756 | * Type Safety Checking |
628 | * Type Safety Checking |
757 | * |
629 | * |