Changeset 1299


Ignore:
Timestamp:
Mar 15, 2004, 4:30:37 PM (21 years ago)
Author:
bird
Message:

Check if stuff is defined before accessing it in #if. Stops -Wundef from bitching.

Location:
trunk/src/emx/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/features.h

    • Property cvs2svn:cvs-rev changed from 1.6 to 1.7
    r1298 r1299  
    2222 *                off_t is 64bits.
    2323 * @changed bird: not GLIBC version numbers.
    24  * @chagned bird: _GNU_SOURCE should not set _POSIX_SOURCE or _POSIX_C_SOURCE as that
     24 * @changed bird: _GNU_SOURCE should not set _POSIX_SOURCE or _POSIX_C_SOURCE as that
    2525 *                means somewhat imporatant exclusions in EMX and BSD style headers.
    2626 *                Some of this have been fixed by __USE_EMX/_EMX_SOURCE, but that's
    2727 *                not gonna help enough.
     28 * @changed bird: Check if stuff is defined before accessing it in #if. Stops -Wundef
     29 *                from bitching.
    2830 */
    2931
     
    200202#endif /* bird */
    201203
    202 #ifdef __EMX__ /* This spawns warnings with -Wundef. */
    203 #if defined _POSIX_SOURCE || (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 1) || defined _XOPEN_SOURCE
     204#if defined _POSIX_SOURCE || (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 1) || defined _XOPEN_SOURCE /* bird: check if defined, -Wundef. */
    204205# define __USE_POSIX    1
    205 #endif
    206 #else
    207 #if defined _POSIX_SOURCE || _POSIX_C_SOURCE >= 1 || defined _XOPEN_SOURCE
    208 # define __USE_POSIX    1
    209 #endif
    210206#endif
    211207
     
    214210#endif
    215211
    216 #if (_POSIX_C_SOURCE - 0) >= 199309L
     212#if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 199309L /* bird: check if defined, -Wundef. */
    217213# define __USE_POSIX199309      1
    218214#endif
    219215
    220 #if (_POSIX_C_SOURCE - 0) >= 199506L
     216#if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 199506L /* bird: check if defined, -Wundef. */
    221217# define __USE_POSIX199506      1
    222218#endif
  • trunk/src/emx/include/sys/cdefs.h

    • Property cvs2svn:cvs-rev changed from 1.7 to 1.8
    r1298 r1299  
    4343 * @changed bird: Toolkit compatibility (_CDEFS_H_ and __TCPROTO()).
    4444 * @changed zap:  _System definition for older GCC compilers.
     45 * @changed bird: Check if stuff is defined before accessing it in #if. Stops -Wundef
     46 *                from bitching.
    4547 */
    4648
     
    199201
    200202/* Compiler-dependent macros that rely on FreeBSD-specific extensions. */
    201 #if __FreeBSD_cc_version >= 300001
     203#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 /* bird: check if defined to avoid -Wundef messages */
    202204#define __printf0like(fmtarg, firstvararg) \
    203205            __attribute__((__format__ (__printf0__, fmtarg, firstvararg)))
     
    319321
    320322/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */
    321 #if _POSIX_C_SOURCE == 1
     323#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1 /* bird: check if defined to avoid -Wundef message. */
    322324#undef _POSIX_C_SOURCE          /* Probably illegal, but beyond caring now. */
    323325#define _POSIX_C_SOURCE         199009
     
    325327
    326328/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */
    327 #if _POSIX_C_SOURCE == 2
     329#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2 /* bird: check if defined to avoid -Wundef message. */
    328330#undef _POSIX_C_SOURCE
    329331#define _POSIX_C_SOURCE         199209
Note: See TracChangeset for help on using the changeset viewer.