procps/proc/procps.h

39 lines
945 B
C
Raw Normal View History

2002-11-25 10:16:33 +00:00
#ifndef PROCPS_PROC_PROCPS_H
#define PROCPS_PROC_PROCPS_H
2002-12-09 07:00:07 +00:00
#ifdef __cplusplus
#define EXTERN_C_BEGIN extern "C" {
#define EXTERN_C_END }
#else
#define EXTERN_C_BEGIN
#define EXTERN_C_END
#endif
2002-02-01 22:47:29 +00:00
2002-11-25 05:05:52 +00:00
#if !defined(restrict) && __STDC_VERSION__ < 199901
#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91 // maybe 92 or 95 ?
#define restrict __restrict__
#else
#warning No restrict keyword?
#define restrict
#endif
#endif
2002-12-09 07:53:09 +00:00
// since gcc-2.5
#define NORETURN __attribute__((__noreturn__))
2002-11-25 10:16:33 +00:00
#if __GNUC__ > 2 || __GNUC_MINOR__ >= 96
2002-12-02 21:05:22 +00:00
// won't alias anything, and aligned enough for anything
2002-11-25 10:16:33 +00:00
#define MALLOC __attribute__ ((__malloc__))
2002-12-02 21:05:22 +00:00
// tell gcc what to expect: if(unlikely(err)) die(err);
2002-12-04 04:04:19 +00:00
#define likely(x) __builtin_expect(!!(x),1)
#define unlikely(x) __builtin_expect(!!(x),0)
2002-12-09 07:00:07 +00:00
#define expected(x,y) __builtin_expect((x),(y))
2002-11-25 10:16:33 +00:00
#else
#define MALLOC
2002-12-02 21:05:22 +00:00
#define likely(x) (x)
#define unlikely(x) (x)
2002-12-09 07:00:07 +00:00
#define expected(x,y) (x)
2002-11-25 10:16:33 +00:00
#endif
#endif