main netmisc / compat / sys / cdefs.h
  1#ifndef _SYS_CDEFS_H_
  2#define _SYS_CDEFS_H_
  3
  4#if defined(__has_include_next)
  5# if __has_include_next(<sys/cdefs.h>)
  6#  include_next <sys/cdefs.h>
  7# endif
  8#endif
  9
 10#ifdef __cplusplus
 11# ifndef __BEGIN_DECLS
 12#  define __BEGIN_DECLS extern "C" {
 13# endif
 14# ifndef __END_DECLS
 15#  define __END_DECLS }
 16# endif
 17#else
 18# ifndef __BEGIN_DECLS
 19#  define __BEGIN_DECLS
 20# endif
 21# ifndef __END_DECLS
 22#  define __END_DECLS
 23# endif
 24#endif
 25
 26#ifndef __CONCAT
 27#define __CONCAT1(x, y) x ## y
 28#define __CONCAT(x, y) __CONCAT1(x, y)
 29#endif
 30
 31#ifndef __STRING
 32#define __STRING(x) #x
 33#endif
 34
 35#ifndef __UNCONST
 36#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
 37#endif
 38
 39#ifndef __THROW
 40#define __THROW
 41#endif
 42
 43#ifndef __P
 44#define __P(x) x
 45#endif
 46
 47#ifndef __RENAME
 48#define __RENAME(x)
 49#endif
 50
 51#ifndef __packed
 52#if defined(__GNUC__) || defined(__clang__)
 53#define __packed __attribute__((__packed__))
 54#else
 55#define __packed
 56#endif
 57#endif
 58
 59#ifndef __constfunc
 60#if defined(__GNUC__) || defined(__clang__)
 61#define __constfunc __attribute__((__const__))
 62#else
 63#define __constfunc
 64#endif
 65#endif
 66
 67#ifndef __RCSID
 68#define __RCSID(x)
 69#endif
 70
 71#ifndef __COPYRIGHT
 72#define __COPYRIGHT(x)
 73#endif
 74
 75#ifndef __dead
 76#if defined(__GNUC__) || defined(__clang__)
 77#define __dead __attribute__((__noreturn__))
 78#else
 79#define __dead
 80#endif
 81#endif
 82
 83#ifndef __printflike
 84#if defined(__GNUC__) || defined(__clang__)
 85#define __printflike(fmtarg, firstvararg) \
 86	__attribute__((__format__(__printf__, fmtarg, firstvararg)))
 87#else
 88#define __printflike(fmtarg, firstvararg)
 89#endif
 90#endif
 91
 92#ifndef __predict_false
 93#define __predict_false(exp) (exp)
 94#endif
 95
 96#ifndef __predict_true
 97#define __predict_true(exp) (exp)
 98#endif
 99
100#ifndef _DIAGASSERT
101#define _DIAGASSERT(exp) ((void)0)
102#endif
103
104#endif