osdep.h revision d373b9f3caa0c37406a1c68872c27237402a2705
#ifndef QEMU_OSDEP_H
#define QEMU_OSDEP_H
#ifdef VBOX
#ifndef RT_OS_WINDOWS
#endif
#include "config.h"
#define VBOX_ONLY(x) x
#ifndef _MSC_VER
#else
#define qemu_snprintf RTStrPrintf
#endif
#define qemu_printf RTLogPrintf
#ifndef NULL
# define NULL 0
#endif
/* If DEBUG_TMP_LOGGING - goes to QEMU log file */
#ifndef DEBUG_TMP_LOGGING
#endif
#else /* !VBOX */
#include <stdarg.h>
#define VBOX_ONLY(x)
#define qemu_printf printf
char *qemu_strdup(const char *str);
void qemu_vfree(void *ptr);
void *get_mmap_addr(unsigned long size);
#endif /* !VBOX */
#ifdef __OpenBSD__
#endif
#ifndef glue
#define xglue(x, y) x ## y
#define tostring(s) #s
#endif
#ifndef likely
#ifndef VBOX
#if __GNUC__ < 3
#define __builtin_expect(x, n) (x)
#endif
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* VBOX */
#endif
#endif /* !likely */
#ifndef offsetof
#endif
#ifndef container_of
#endif
#ifndef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef MAX
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#endif
#ifndef always_inline
#define always_inline inline
#else
#define inline always_inline
#endif
#else
#define inline always_inline
#endif
#ifdef __i386__
#ifdef _MSC_VER
/** @todo: maybe wrong, or slow */
#define REGPARM
#else
#endif
#else
#define REGPARM
#endif
#if defined (__GNUC__) && defined (__GNUC_MINOR_)
#else
#endif
#ifndef VBOX
void qemu_vfree(void *ptr);
int qemu_create_pidfile(const char *filename);
#ifdef _WIN32
int ffs(int i);
typedef struct {
long tv_sec;
long tv_usec;
} qemu_timeval;
#else
typedef struct timeval qemu_timeval;
#endif /* !_WIN32 */
#endif /* !VBOX */
#ifdef VBOX
#ifdef _MSC_VER
#define FORCE_RET() ;
#else /* ! _MSC_VER */
#define FORCE_RET() ;
#endif /* !_MSC_VER */
#endif /* VBOX */
#endif