From 29f640e2cfe4d7da114482fd8de257a27274288d Mon Sep 17 00:00:00 2001 From: j_mayer Date: Sat, 29 Sep 2007 12:17:25 +0000 Subject: [PATCH] always_inline gcc directive can be useful. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3259 c046a42c-6fe2-441c-8c8c-71466251a162 --- exec-all.h | 8 ++++++++ vl.h | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/exec-all.h b/exec-all.h index f58aea5..3151bb5 100644 --- a/exec-all.h +++ b/exec-all.h @@ -37,6 +37,14 @@ #define unlikely(x) __builtin_expect(!!(x), 0) #endif +#ifndef always_inline +#if __GNUC__ < 3 +#define always_inline inline +#else +#define always_inline __attribute__ (( always_inline )) inline +#endif +#endif + #ifdef __i386__ #define REGPARM(n) __attribute((regparm(n))) #else diff --git a/vl.h b/vl.h index b2dde5d..378ed27 100644 --- a/vl.h +++ b/vl.h @@ -109,6 +109,14 @@ static inline char *realpath(const char *path, char *resolved_path) #define MAX(a, b) (((a) > (b)) ? (a) : (b)) #endif +#ifndef always_inline +#if __GNUC__ < 3 +#define always_inline inline +#else +#define always_inline __attribute__ (( always_inline )) inline +#endif +#endif + /* cutils.c */ void pstrcpy(char *buf, int buf_size, const char *str); char *pstrcat(char *buf, int buf_size, const char *s); -- 2.7.4