Ignore:
Timestamp:
Nov 7, 2004, 10:33:03 AM (21 years ago)
Author:
bird
Message:

Debugging signals.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/sys/cdefs.h

    • Property cvs2svn:cvs-rev changed from 1.9 to 1.10
    r1616 r1617  
    1414 *    notice, this list of conditions and the following disclaimer in the
    1515 *    documentation and/or other materials provided with the distribution.
    16  * 3. All advertising materials mentioning features or use of this software
    17  *    must display the following acknowledgement:
    18  *      This product includes software developed by the University of
    19  *      California, Berkeley and its contributors.
    2016 * 4. Neither the name of the University nor the names of its contributors
    2117 *    may be used to endorse or promote products derived from this software
     
    3531 *
    3632 *      @(#)cdefs.h     8.8 (Berkeley) 1/9/95
    37  * $FreeBSD: src/sys/sys/cdefs.h,v 1.69 2003/04/18 18:59:34 bde Exp $
     33 * $FreeBSD: src/sys/sys/cdefs.h,v 1.81 2004/04/07 04:19:49 imp Exp $
    3834 */
    3935
    4036/** @file
    41  * FreeBSD 5.1
     37 * FreeBSD 5.2
    4238 *
    4339 * @changed bird: Toolkit compatibility (_CDEFS_H_ and __TCPROTO()).
     
    5854#define __BEGIN_DECLS
    5955#define __END_DECLS
     56#endif
     57
     58/*
     59 * Macro to test if we're using a specific version of gcc or later.
     60 */
     61#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
     62#define __GNUC_PREREQ__(ma, mi) \
     63        (__GNUC__ > (ma) || __GNUC__ == (ma) && __GNUC_MINOR__ >= (mi))
     64#else
     65#define __GNUC_PREREQ__(ma, mi) 0
    6066#endif
    6167
     
    8591#define __inline        inline          /* convert to C++ keyword */
    8692#else
    87 #ifndef __GNUC__
     93#if !(defined(__GNUC__) || defined(__INTEL_COMPILER))
    8894#define __inline                        /* delete GCC keyword */
    89 #endif /* !__GNUC__ */
     95#endif /* !(__GNUC__ || __INTEL_COMPILER) */
    9096#endif /* !__cplusplus */
    9197
     
    95101#define __STRING(x)     "x"
    96102
    97 #ifndef __GNUC__
     103#if !(defined(__GNUC__) || defined(__INTEL_COMPILER))
    98104#define __const                         /* delete pseudo-ANSI C keywords */
    99105#define __inline
     
    114120#define volatile
    115121#endif  /* !NO_ANSI_KEYWORDS */
    116 #endif  /* !__GNUC__ */
     122#endif  /* !(__GNUC__ || __INTEL_COMPILER) */
    117123#endif  /* !(__STDC__ || __cplusplus) */
    118124
     
    134140#define __section(x)
    135141#else
    136 #if __GNUC__ < 2 || __GNUC__ == 2 && __GNUC_MINOR__ < 5
     142#if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER)
    137143#define __dead2
    138144#define __pure2
    139145#define __unused
    140146#endif
    141 #if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7
     147#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 && !defined(__INTEL_COMPILER)
    142148#define __dead2         __attribute__((__noreturn__))
    143149#define __pure2         __attribute__((__const__))
     
    145151/* XXX Find out what to do for __packed, __aligned and __section */
    146152#endif
    147 #if __GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ == 3
     153#if __GNUC_PREREQ__(2, 7)
    148154#define __dead2         __attribute__((__noreturn__))
    149155#define __pure2         __attribute__((__const__))
     
    153159#define __section(x)    __attribute__((__section__(x)))
    154160#endif
     161#if defined(__INTEL_COMPILER)
     162#define __dead2         __attribute__((__noreturn__))
     163#define __pure2         __attribute__((__const__))
     164#define __unused        __attribute__((__unused__))
     165#define __packed        __attribute__((__packed__))
     166#define __aligned(x)    __attribute__((__aligned__(x)))
     167#define __section(x)    __attribute__((__section__(x)))
     168#endif
     169#endif
     170
     171#if __GNUC_PREREQ__(3, 1) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800)
     172#define __always_inline __attribute__((__always_inline__))
     173#else
     174#define __always_inline
     175#endif
     176
     177#if __GNUC_PREREQ__(3, 3)
     178#define __nonnull(x)    __attribute__((__nonnull__(x)))
     179#else
     180#define __nonnull(x)
    155181#endif
    156182
    157183/* XXX: should use `#if __STDC_VERSION__ < 199901'. */
    158 #if !(__GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ >= 3)
     184#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER)
    159185#define __func__        NULL
    160186#endif
    161187
    162 #if __GNUC__ >= 2 && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901
     188#if (defined(__INTEL_COMPILER) || (defined(__GNUC__) && __GNUC__ >= 2)) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901
    163189#define __LONG_LONG_SUPPORTED
    164190#endif
     
    171197 */
    172198#if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95)
    173 #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 /* bird: check if not defined. (-pedantic) */
     199#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901
    174200#define __restrict
    175201#else
    176202#define __restrict      restrict
    177203#endif
     204#endif
     205
     206/*
     207 * GNU C version 2.96 adds explicit branch prediction so that
     208 * the CPU back-end can hint the processor and also so that
     209 * code blocks can be reordered such that the predicted path
     210 * sees a more linear flow, thus improving cache behavior, etc.
     211 *
     212 * The following two macros provide us with a way to utilize this
     213 * compiler feature.  Use __predict_true() if you expect the expression
     214 * to evaluate to true, and __predict_false() if you expect the
     215 * expression to evaluate to false.
     216 *
     217 * A few notes about usage:
     218 *
     219 *      * Generally, __predict_false() error condition checks (unless
     220 *        you have some _strong_ reason to do otherwise, in which case
     221 *        document it), and/or __predict_true() `no-error' condition
     222 *        checks, assuming you want to optimize for the no-error case.
     223 *
     224 *      * Other than that, if you don't know the likelihood of a test
     225 *        succeeding from empirical or other `hard' evidence, don't
     226 *        make predictions.
     227 *
     228 *      * These are meant to be used in places that are run `a lot'.
     229 *        It is wasteful to make predictions in code that is run
     230 *        seldomly (e.g. at subsystem initialization time) as the
     231 *        basic block reordering that this affects can often generate
     232 *        larger code.
     233 */
     234#if __GNUC_PREREQ__(2, 96)
     235#define __predict_true(exp)     __builtin_expect((exp), 1)
     236#define __predict_false(exp)    __builtin_expect((exp), 0)
     237#else
     238#define __predict_true(exp)     (exp)
     239#define __predict_false(exp)    (exp)
    178240#endif
    179241
     
    190252 * didn't permit keeping the keywords out of the application namespace).
    191253 */
    192 #if __GNUC__ < 2 || __GNUC__ == 2 && __GNUC_MINOR__ < 7
     254#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER)
    193255#define __printflike(fmtarg, firstvararg)
    194256#define __scanflike(fmtarg, firstvararg)
     
    201263
    202264/* Compiler-dependent macros that rely on FreeBSD-specific extensions. */
    203 #if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 /* bird: check if defined to avoid -Wundef messages */
     265#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && defined(__GNUC__) && !defined(__INTEL_COMPILER) /* bird: check if defined to avoid -Wundef messages */
    204266#define __printf0like(fmtarg, firstvararg) \
    205267            __attribute__((__format__ (__printf0__, fmtarg, firstvararg)))
     
    208270#endif
    209271
    210 #if 0 /* def __GNUC__ - bird: ELF specific, so skip everything */
     272#if 0 /* defined(__GNUC__) || defined(__INTEL_COMPILER) - bird: ELF specific, so skip everything */
     273#ifndef __INTEL_COMPILER
    211274#define __strong_reference(sym,aliassym)        \
    212275        extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)));
     276#endif
    213277#ifdef __STDC__
    214278#define __weak_reference(sym,alias)     \
     
    228292        __asm__(".previous")
    229293#endif  /* __STDC__ */
    230 #endif  /* __GNUC__ */
    231 
    232 #if 0 /*def __GNUC__ - ELF specific. */
     294#endif  /* __GNUC__ || __INTEL_COMPILER */
     295
     296#if 0 /* defined(__GNUC__) || defined(__INTEL_COMPILER) - ELF specific. */
    233297#define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"")
    234298#else
    235299/*
    236  * This doesn't work in header files. But it may be better than nothing.
    237  * The alternative is: #define __IDSTRING(name,string)  [nothing]
     300 * The following definition might not work well if used in header files,
     301 * but it should be better than nothing.  If you want a "do nothing"
     302 * version, then it should generate some harmless declaration, such as:
     303 *    #define __IDSTRING(name,string)   struct __hack
    238304 */
    239305#define __IDSTRING(name,string) static const char name[] __unused = string
     
    244310 * more recent ELF binutils, we use .ident allowing the ID to be stripped.
    245311 * Usage:
    246  *      __FBSDID("$FreeBSD: src/sys/sys/cdefs.h,v 1.69 2003/04/18 18:59:34 bde Exp $");
     312 *      __FBSDID("$FreeBSD: src/sys/sys/cdefs.h,v 1.81 2004/04/07 04:19:49 imp Exp $");
    247313 */
    248314#ifndef __FBSDID
     
    258324#define __RCSID(s)      __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
    259325#else
    260 #define __RCSID(s)
     326#define __RCSID(s)      struct __hack
    261327#endif
    262328#endif
     
    266332#define __RCSID_SOURCE(s)       __IDSTRING(__CONCAT(__rcsid_source_,__LINE__),s)
    267333#else
    268 #define __RCSID_SOURCE(s)
     334#define __RCSID_SOURCE(s)       struct __hack
    269335#endif
    270336#endif
     
    274340#define __SCCSID(s)     __IDSTRING(__CONCAT(__sccsid_,__LINE__),s)
    275341#else
    276 #define __SCCSID(s)
     342#define __SCCSID(s)     struct __hack
    277343#endif
    278344#endif
     
    282348#define __COPYRIGHT(s)  __IDSTRING(__CONCAT(__copyright_,__LINE__),s)
    283349#else
    284 #define __COPYRIGHT(s)
     350#define __COPYRIGHT(s)  struct __hack
    285351#endif
    286352#endif
     
    321387
    322388/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */
    323 #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1 /* bird: check if defined to avoid -Wundef message. */
     389#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1
    324390#undef _POSIX_C_SOURCE          /* Probably illegal, but beyond caring now. */
    325391#define _POSIX_C_SOURCE         199009
     
    327393
    328394/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */
    329 #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2 /* bird: check if defined to avoid -Wundef message. */
     395#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2
    330396#undef _POSIX_C_SOURCE
    331397#define _POSIX_C_SOURCE         199209
Note: See TracChangeset for help on using the changeset viewer.