Changeset 3717


Ignore:
Timestamp:
Mar 17, 2011, 7:09:55 PM (14 years ago)
Author:
bird
Message:

sys/cdefs.h: Updated to FreeBSD 9.0 (?) rev 1.114. References #207, #212.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libc/include/sys/cdefs.h

    r3715 r3717  
    1 /*
     1/* $Id: $ */
     2/** @file
     3 * FreeBSD 9.0
     4 *
     5 * @changed bird: Toolkit compatibility (_CDEFS_H_ and __TCPROTO()).
     6 * @changed bird: Check if stuff is defined before accessing it in #if. Stops -Wundef
     7 *                from bitching.
     8 */
     9 
     10/*-
    211 * Copyright (c) 1991, 1993
    312 *      The Regents of the University of California.  All rights reserved.
     
    3140 *
    3241 *      @(#)cdefs.h     8.8 (Berkeley) 1/9/95
    33  * $FreeBSD: src/sys/sys/cdefs.h,v 1.84 2004/08/13 00:53:40 julian Exp $
    34  */
    35 
    36 /** @file
    37  * FreeBSD 5.2
    38  *
    39  * @changed bird: Toolkit compatibility (_CDEFS_H_ and __TCPROTO()).
    40  * @changed zap:  _System definition for older GCC compilers.
    41  * @changed bird: Check if stuff is defined before accessing it in #if. Stops -Wundef
    42  *                from bitching.
    43  * @changed bird: added __GNUCLIKE_XXX from FreeBSD 8.0 (releng/8.0/sys/sys/cdefs.h 193734)
    44  */
    45 
     42 * $FreeBSD: src/sys/sys/cdefs.h,v 1.114 2011/02/18 21:44:53 nwhitehorn Exp $
     43 */
    4644
    4745#ifndef _SYS_CDEFS_H_
     
    7472#define __GNUCLIKE___OFFSETOF 1
    7573#define __GNUCLIKE___SECTION 1
    76 
    77 #define __GNUCLIKE_ATTRIBUTE_MODE_DI 1
    7874
    7975#ifndef __INTEL_COMPILER
     
    153149#define __inline        inline          /* convert to C++ keyword */
    154150#else
    155 #if !(defined(__GNUC__) || defined(__INTEL_COMPILER))
     151#if !(defined(__CC_SUPPORTS___INLINE))
    156152#define __inline                        /* delete GCC keyword */
    157 #endif /* !(__GNUC__ || __INTEL_COMPILER) */
     153#endif /* ! __CC_SUPPORTS___INLINE */
    158154#endif /* !__cplusplus */
    159155
     
    163159#define __STRING(x)     "x"
    164160
    165 #if !(defined(__GNUC__) || defined(__INTEL_COMPILER))
     161#if !defined(__CC_SUPPORTS___INLINE)
    166162#define __const                         /* delete pseudo-ANSI C keywords */
    167163#define __inline
     
    182178#define volatile
    183179#endif  /* !NO_ANSI_KEYWORDS */
    184 #endif  /* !(__GNUC__ || __INTEL_COMPILER) */
     180#endif  /* !__CC_SUPPORTS___INLINE */
    185181#endif  /* !(__STDC__ || __cplusplus) */
    186182
     
    234230
    235231#if __GNUC_PREREQ__(2, 96)
     232#define __malloc_like   __attribute__((__malloc__))
    236233#define __pure          __attribute__((__pure__))
    237234#else
     235#define __malloc_like
    238236#define __pure
    239237#endif
     
    243241#else
    244242#define __always_inline
     243#endif
     244
     245#if __GNUC_PREREQ__(3, 1)
     246#define __noinline      __attribute__ ((__noinline__))
     247#else
     248#define __noinline
    245249#endif
    246250
     
    267271 */
    268272#if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95)
    269 #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901
     273#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 || defined(lint)
    270274#define __restrict
    271275#else
     
    310314#endif
    311315
     316#if __GNUC_PREREQ__(4, 2)
     317#define __hidden        __attribute__((__visibility__("hidden")))
     318#define __exported      __attribute__((__visibility__("default")))
     319#else
     320#define __hidden
     321#define __exported
     322#endif
     323
    312324/*
    313325 * We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h>
    314326 * require it.
    315327 */
     328#if __GNUC_PREREQ__(4, 1)
     329#define __offsetof(type, field)  __builtin_offsetof(type, field)
     330#else
     331#ifndef __cplusplus
    316332#define __offsetof(type, field) ((size_t)(&((type *)0)->field))
     333#else
     334#define __offsetof(type, field)                                 \
     335  (__offsetof__ (reinterpret_cast <size_t>                      \
     336                 (&reinterpret_cast <const volatile char &>     \
     337                  (static_cast<type *> (0)->field))))
     338#endif
     339#endif
    317340#define __rangeof(type, start, end) \
    318341        (__offsetof(type, end) - __offsetof(type, start))
     
    327350#define __printflike(fmtarg, firstvararg)
    328351#define __scanflike(fmtarg, firstvararg)
     352#define __format_arg(fmtarg)
    329353#else
    330354#define __printflike(fmtarg, firstvararg) \
     
    332356#define __scanflike(fmtarg, firstvararg) \
    333357            __attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
     358#define __format_arg(fmtarg)    __attribute__((__format_arg__ (fmtarg)))
    334359#endif
    335360
    336361/* Compiler-dependent macros that rely on FreeBSD-specific extensions. */
    337 #if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && defined(__GNUC__) && !defined(__INTEL_COMPILER) /* bird: check if defined to avoid -Wundef messages */
     362#ifdef __FreeBSD_cc_version                 /* bird */
     363#if __FreeBSD_cc_version >= 300001 && defined(__GNUC__) && !defined(__INTEL_COMPILER)
    338364#define __printf0like(fmtarg, firstvararg) \
    339365            __attribute__((__format__ (__printf0__, fmtarg, firstvararg)))
     
    341367#define __printf0like(fmtarg, firstvararg)
    342368#endif
    343 
    344 #if 0 /* defined(__GNUC__) || defined(__INTEL_COMPILER) - bird: ELF specific, so skip everything */
     369#else                                       /* bird */
     370#define __printf0like(fmtarg, firstvararg)  /* bird */
     371#endif                                      /* bird */
     372
     373#if 0 /* bird - mostly ELF specific, so skip it. */
     374#if defined(__GNUC__) || defined(__INTEL_COMPILER)
    345375#ifndef __INTEL_COMPILER
    346376#define __strong_reference(sym,aliassym)        \
    347         extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)));
     377        extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)))
    348378#endif
    349379#ifdef __STDC__
     
    355385        __asm__(".asciz \"" msg "\"");  \
    356386        __asm__(".previous")
     387#define __sym_compat(sym,impl,verid)    \
     388        __asm__(".symver " #impl ", " #sym "@" #verid)
     389#define __sym_default(sym,impl,verid)   \
     390        __asm__(".symver " #impl ", " #sym "@@" #verid)
    357391#else
    358392#define __weak_reference(sym,alias)     \
     
    363397        __asm__(".asciz \"msg\"");      \
    364398        __asm__(".previous")
     399#define __sym_compat(sym,impl,verid)    \
     400        __asm__(".symver impl, sym@verid")
     401#define __sym_default(impl,sym,verid)   \
     402        __asm__(".symver impl, sym@@verid")
    365403#endif  /* __STDC__ */
    366 #else
     404#endif  /* __GNUC__ || __INTEL_COMPILER */
     405#else                                                                       /* bird */
    367406#define __strong_reference(sym,aliassym)        \
    368         extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)));
    369 #endif  /* __GNUC__ || __INTEL_COMPILER */
    370 
    371 #if 0 /* defined(__GNUC__) || defined(__INTEL_COMPILER) - ELF specific. */
     407        extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)));  /* bird */
     408#endif                                                                      /* bird */
     409
     410#define __GLOBL1(sym)   __asm__(".globl " #sym)
     411#define __GLOBL(sym)    __GLOBL1(sym)
     412
     413#if 0 /* defined(__GNUC__) || defined(__INTEL_COMPILER) - bird: ELF specific. */
    372414#define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"")
    373415#else
     
    385427 * more recent ELF binutils, we use .ident allowing the ID to be stripped.
    386428 * Usage:
    387  *      __FBSDID("$FreeBSD: src/sys/sys/cdefs.h,v 1.84 2004/08/13 00:53:40 julian Exp $");
     429 *      __FBSDID("$FreeBSD: src/sys/sys/cdefs.h,v 1.114 2011/02/18 21:44:53 nwhitehorn Exp $");
    388430 */
    389431#ifndef __FBSDID
     
    453495 *                                      and the omnibus ISO/IEC 9945-1: 1996
    454496 *  _POSIX_C_SOURCE == 200112           1003.1-2001
     497 *  _POSIX_C_SOURCE == 200809           1003.1-2008
    455498 *
    456499 * In addition, the X/Open Portability Guide, which is now the Single UNIX
     
    475518/* Deal with various X/Open Portability Guides and Single UNIX Spec. */
    476519#ifdef _XOPEN_SOURCE
    477 #if _XOPEN_SOURCE - 0 >= 600
     520#if _XOPEN_SOURCE - 0 >= 700
     521#define __XSI_VISIBLE           700
     522#undef _POSIX_C_SOURCE
     523#define _POSIX_C_SOURCE         200809
     524#elif _XOPEN_SOURCE - 0 >= 600
    478525#define __XSI_VISIBLE           600
    479526#undef _POSIX_C_SOURCE
     
    494541#endif
    495542#ifdef _POSIX_C_SOURCE
    496 #if _POSIX_C_SOURCE >= 200112
     543#if _POSIX_C_SOURCE >= 200809
     544#define __POSIX_VISIBLE         200809
     545#define __ISO_C_VISIBLE         1999
     546#elif _POSIX_C_SOURCE >= 200112
    497547#define __POSIX_VISIBLE         200112
    498548#define __ISO_C_VISIBLE         1999
     
    537587#define __ISO_C_VISIBLE         1999
    538588#else                           /* Default environment: show everything. */
    539 #define __POSIX_VISIBLE         200112
    540 #define __XSI_VISIBLE           600
     589#define __POSIX_VISIBLE         200809
     590#define __XSI_VISIBLE           700
    541591#define __BSD_VISIBLE           1
    542592#define __ISO_C_VISIBLE         1999
     
    556606 */
    557607#if !defined(__USE_LIBC_TCPIP) && !defined(TCPV40HDRS) && !defined(TCPV41HDRS)
    558 #define __USE_LIBC_TCPIP
     608# define __USE_LIBC_TCPIP
    559609#endif
    560610#if defined(TCPV40HDRS) && defined(TCPV41HDRS)
    561 #error Cannot define both TCPV40HDRS and TCPV41HDRS. Make up your mind!
     611# error Cannot define both TCPV40HDRS and TCPV41HDRS. Make up your mind!
    562612#endif
    563613
     
    572622#endif
    573623
    574 /* zap: For backward compatibility with GCC/EMX */
    575 #ifndef _System
    576 #define _System
    577 #endif
    578 
    579624/* bird: include the GNU sys/cdefs.h (which fortunately have another
    580625         blocker, _SYS_CDEFS_H). */
Note: See TracChangeset for help on using the changeset viewer.