Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/perseant-stdc-iso10646]: src/sys/sys 3233489



details:   https://anonhg.NetBSD.org/src/rev/983afe3bfcfd
branches:  perseant-stdc-iso10646
changeset: 850636:983afe3bfcfd
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jul 15 13:46:03 2017 +0000

description:
3233489

diffstat:

 sys/sys/cdefs.h |  650 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 650 insertions(+), 0 deletions(-)

diffs (truncated from 654 to 300 lines):

diff -r 3de6f672a51e -r 983afe3bfcfd sys/sys/cdefs.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/sys/cdefs.h   Sat Jul 15 13:46:03 2017 +0000
@@ -0,0 +1,650 @@
+/*     $NetBSD: cdefs.h,v 1.133.2.2 2017/07/15 13:46:03 christos Exp $ */
+
+/* * Copyright (c) 1991, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Berkeley Software Design, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)cdefs.h     8.8 (Berkeley) 1/9/95
+ */
+
+#ifndef        _SYS_CDEFS_H_
+#define        _SYS_CDEFS_H_
+
+#ifdef _KERNEL_OPT
+#include "opt_diagnostic.h"
+#endif
+
+/*
+ * Macro to test if we're using a GNU C compiler of a specific vintage
+ * or later, for e.g. features that appeared in a particular version
+ * of GNU C.  Usage:
+ *
+ *     #if __GNUC_PREREQ__(major, minor)
+ *     ...cool feature...
+ *     #else
+ *     ...delete feature...
+ *     #endif
+ */
+#ifdef __GNUC__
+#define        __GNUC_PREREQ__(x, y)                                           \
+       ((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) ||                  \
+        (__GNUC__ > (x)))
+#else
+#define        __GNUC_PREREQ__(x, y)   0
+#endif
+
+#include <machine/cdefs.h>
+#ifdef __ELF__
+#include <sys/cdefs_elf.h>
+#else
+#include <sys/cdefs_aout.h>
+#endif
+
+#ifdef __GNUC__
+#define        __strict_weak_alias(alias,sym)                                  \
+       __unused static __typeof__(alias) *__weak_alias_##alias = &sym; \
+       __weak_alias(alias,sym)
+#else
+#define        __strict_weak_alias(alias,sym) __weak_alias(alias,sym)
+#endif
+
+/*
+ * Optional marker for size-optimised MD calling convention.
+ */
+#ifndef __compactcall
+#define        __compactcall
+#endif
+
+/*
+ * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
+ * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
+ * The __CONCAT macro is a bit tricky -- make sure you don't put spaces
+ * in between its arguments.  __CONCAT can also concatenate double-quoted
+ * strings produced by the __STRING macro, but this only works with ANSI C.
+ */
+
+#define        ___STRING(x)    __STRING(x)
+#define        ___CONCAT(x,y)  __CONCAT(x,y)
+
+#if __STDC__ || defined(__cplusplus)
+#define        __P(protos)     protos          /* full-blown ANSI C */
+#define        __CONCAT(x,y)   x ## y
+#define        __STRING(x)     #x
+
+#define        __const         const           /* define reserved names to standard */
+#define        __signed        signed
+#define        __volatile      volatile
+#if defined(__cplusplus) || defined(__PCC__)
+#define        __inline        inline          /* convert to C++/C99 keyword */
+#else
+#if !defined(__GNUC__) && !defined(__lint__)
+#define        __inline                        /* delete GCC keyword */
+#endif /* !__GNUC__  && !__lint__ */
+#endif /* !__cplusplus */
+
+#else  /* !(__STDC__ || __cplusplus) */
+#define        __P(protos)     ()              /* traditional C preprocessor */
+#define        __CONCAT(x,y)   x/**/y
+#define        __STRING(x)     "x"
+
+#ifndef __GNUC__
+#define        __const                         /* delete pseudo-ANSI C keywords */
+#define        __inline
+#define        __signed
+#define        __volatile
+#endif /* !__GNUC__ */
+
+/*
+ * In non-ANSI C environments, new programs will want ANSI-only C keywords
+ * deleted from the program and old programs will want them left alone.
+ * Programs using the ANSI C keywords const, inline etc. as normal
+ * identifiers should define -DNO_ANSI_KEYWORDS.
+ */
+#ifndef        NO_ANSI_KEYWORDS
+#define        const           __const         /* convert ANSI C keywords */
+#define        inline          __inline
+#define        signed          __signed
+#define        volatile        __volatile
+#endif /* !NO_ANSI_KEYWORDS */
+#endif /* !(__STDC__ || __cplusplus) */
+
+/*
+ * Used for internal auditing of the NetBSD source tree.
+ */
+#ifdef __AUDIT__
+#define        __aconst        __const
+#else
+#define        __aconst
+#endif
+
+/*
+ * Compile Time Assertion.
+ */
+#ifdef __COUNTER__
+#define        __CTASSERT(x)           __CTASSERT0(x, __ctassert, __COUNTER__)
+#else
+#define        __CTASSERT(x)           __CTASSERT99(x, __INCLUDE_LEVEL__, __LINE__)
+#define        __CTASSERT99(x, a, b)   __CTASSERT0(x, __CONCAT(__ctassert,a), \
+                                              __CONCAT(_,b))
+#endif
+#define        __CTASSERT0(x, y, z)    __CTASSERT1(x, y, z) 
+#define        __CTASSERT1(x, y, z)    typedef char y ## z[/*CONSTCOND*/(x) ? 1 : -1] __unused
+
+/*
+ * The following macro is used to remove const cast-away warnings
+ * from gcc -Wcast-qual; it should be used with caution because it
+ * can hide valid errors; in particular most valid uses are in
+ * situations where the API requires it, not to cast away string
+ * constants. We don't use *intptr_t on purpose here and we are
+ * explicit about unsigned long so that we don't have additional
+ * dependencies.
+ */
+#define __UNCONST(a)   ((void *)(unsigned long)(const void *)(a))
+
+/*
+ * The following macro is used to remove the volatile cast-away warnings
+ * from gcc -Wcast-qual; as above it should be used with caution
+ * because it can hide valid errors or warnings.  Valid uses include
+ * making it possible to pass a volatile pointer to memset().
+ * For the same reasons as above, we use unsigned long and not intptr_t.
+ */
+#define __UNVOLATILE(a)        ((void *)(unsigned long)(volatile void *)(a))
+
+/*
+ * GCC2 provides __extension__ to suppress warnings for various GNU C
+ * language extensions under "-ansi -pedantic".
+ */
+#if !__GNUC_PREREQ__(2, 0)
+#define        __extension__           /* delete __extension__ if non-gcc or gcc1 */
+#endif
+
+/*
+ * GCC1 and some versions of GCC2 declare dead (non-returning) and
+ * pure (no side effects) functions using "volatile" and "const";
+ * unfortunately, these then cause warnings under "-ansi -pedantic".
+ * GCC2 uses a new, peculiar __attribute__((attrs)) style.  All of
+ * these work for GNU C++ (modulo a slight glitch in the C++ grammar
+ * in the distribution version of 2.5.5).
+ *
+ * GCC defines a pure function as depending only on its arguments and
+ * global variables.  Typical examples are strlen and sqrt.
+ *
+ * GCC defines a const function as depending only on its arguments.
+ * Therefore calling a const function again with identical arguments
+ * will always produce the same result.
+ *
+ * Rounding modes for floating point operations are considered global
+ * variables and prevent sqrt from being a const function.
+ *
+ * Calls to const functions can be optimised away and moved around
+ * without limitations.
+ */
+#if !__GNUC_PREREQ__(2, 0) && !defined(__lint__)
+#define __attribute__(x)
+#endif
+
+#if __GNUC_PREREQ__(2, 5)
+#define        __dead          __attribute__((__noreturn__))
+#elif defined(__GNUC__)
+#define        __dead          __volatile
+#else
+#define        __dead
+#endif
+
+#if __GNUC_PREREQ__(2, 96)
+#define        __pure          __attribute__((__pure__))
+#elif defined(__GNUC__)
+#define        __pure          __const
+#else
+#define        __pure
+#endif
+
+#if __GNUC_PREREQ__(2, 5)
+#define        __constfunc     __attribute__((__const__))
+#else
+#define        __constfunc
+#endif
+
+#if __GNUC_PREREQ__(3, 0)
+#define        __noinline      __attribute__((__noinline__))
+#else
+#define        __noinline      /* nothing */
+#endif
+
+#if __GNUC_PREREQ__(3, 0)
+#define        __always_inline __attribute__((__always_inline__))
+#else
+#define        __always_inline /* nothing */
+#endif
+
+#if __GNUC_PREREQ__(4, 1)
+#define        __returns_twice __attribute__((__returns_twice__))
+#else
+#define        __returns_twice /* nothing */
+#endif
+
+#if __GNUC_PREREQ__(4, 5)
+#define        __noclone       __attribute__((__noclone__))
+#else
+#define        __noclone       /* nothing */
+#endif
+
+/*
+ * __unused: Note that item or function might be unused.
+ */
+#if __GNUC_PREREQ__(2, 7) || defined(__lint__)
+#define        __unused        __attribute__((__unused__))
+#else
+#define        __unused        /* delete */
+#endif
+
+/*
+ * __used: Note that item is needed, even if it appears to be unused.
+ */
+#if __GNUC_PREREQ__(3, 1)
+#define        __used          __attribute__((__used__))
+#else
+#define        __used          __unused
+#endif
+
+/*
+ * __diagused: Note that item is used in diagnostic code, but may be
+ * unused in non-diagnostic code.
+ */
+#if (defined(_KERNEL) && defined(DIAGNOSTIC)) \
+ || (!defined(_KERNEL) && !defined(NDEBUG))
+#define        __diagused      /* empty */
+#else
+#define        __diagused      __unused
+#endif
+
+/*
+ * __debugused: Note that item is used in debug code, but may be
+ * unused in non-debug code.
+ */
+#if defined(DEBUG)
+#define        __debugused     /* empty */
+#else
+#define        __debugused     __unused
+#endif
+



Home | Main Index | Thread Index | Old Index