7 #define xglue(x, y) x ## y
8 #define glue(x, y) xglue(x, y)
9 #define stringify(s) tostring(s)
10 #define tostring(s) #s
15 #define __builtin_expect(x, n) (x)
18 #define likely(x) __builtin_expect(!!(x), 1)
19 #define unlikely(x) __builtin_expect(!!(x), 0)
23 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
26 #define MAX(a, b) (((a) > (b)) ? (a) : (b))
30 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
34 #if (__GNUC__ < 3) || defined(__APPLE__)
35 #define always_inline inline
37 #define always_inline __attribute__ (( always_inline )) __inline__
38 #define inline always_inline
41 #define inline always_inline
45 #define REGPARM __attribute((regparm(3)))
50 #define qemu_printf printf
52 void *qemu_memalign(size_t alignment
, size_t size
);
53 void *qemu_vmalloc(size_t size
);
54 void qemu_vfree(void *ptr
);
56 int qemu_create_pidfile(const char *filename
);
65 int qemu_gettimeofday(qemu_timeval
*tp
);
67 typedef struct timeval qemu_timeval
;
68 #define qemu_gettimeofday(tp) gettimeofday(tp, NULL);