Commit 29f640e2cfe4d7da114482fd8de257a27274288d

Authored by j_mayer
1 parent f1548daa

always_inline gcc directive can be useful.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3259 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 16 additions and 0 deletions
exec-all.h
... ... @@ -37,6 +37,14 @@
37 37 #define unlikely(x) __builtin_expect(!!(x), 0)
38 38 #endif
39 39  
  40 +#ifndef always_inline
  41 +#if __GNUC__ < 3
  42 +#define always_inline inline
  43 +#else
  44 +#define always_inline __attribute__ (( always_inline )) inline
  45 +#endif
  46 +#endif
  47 +
40 48 #ifdef __i386__
41 49 #define REGPARM(n) __attribute((regparm(n)))
42 50 #else
... ...
... ... @@ -109,6 +109,14 @@ static inline char *realpath(const char *path, char *resolved_path)
109 109 #define MAX(a, b) (((a) > (b)) ? (a) : (b))
110 110 #endif
111 111  
  112 +#ifndef always_inline
  113 +#if __GNUC__ < 3
  114 +#define always_inline inline
  115 +#else
  116 +#define always_inline __attribute__ (( always_inline )) inline
  117 +#endif
  118 +#endif
  119 +
112 120 /* cutils.c */
113 121 void pstrcpy(char *buf, int buf_size, const char *str);
114 122 char *pstrcat(char *buf, int buf_size, const char *s);
... ...