diff options
author | Alon Levy <alevy@redhat.com> | 2011-02-28 18:56:16 +0200 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2011-03-02 17:27:51 +0200 |
commit | 38e13ef1a87d1cd035d36f5ef0eb5f8f1359407f (patch) | |
tree | 097a4ef3b08f722ec5e424cec66d5f0114ba7e12 /server/red_common.h | |
parent | ce03dcfbb55d38d06e3014a6c489ea82131472fc (diff) | |
download | spice-38e13ef1a87d1cd035d36f5ef0eb5f8f1359407f.tar.gz spice-38e13ef1a87d1cd035d36f5ef0eb5f8f1359407f.tar.xz spice-38e13ef1a87d1cd035d36f5ef0eb5f8f1359407f.zip |
server/common: introduce common/spice_common.h
move all the ASSERT/PANIC/PANIC_ON/red_error/red_printf* macros
to a common file to be used with ring.h that is going to be used externally
(by spice-gtk).
Diffstat (limited to 'server/red_common.h')
-rw-r--r-- | server/red_common.h | 46 |
1 files changed, 1 insertions, 45 deletions
diff --git a/server/red_common.h b/server/red_common.h index c863922c..494ffed2 100644 --- a/server/red_common.h +++ b/server/red_common.h @@ -23,47 +23,10 @@ #include "spice.h" #include "mem.h" +#include "spice_common.h" #include <messages.h> #include <spice/macros.h> -#define ASSERT(x) if (!(x)) { \ - printf("%s: ASSERT %s failed\n", __FUNCTION__, #x); \ - abort(); \ -} - -#define PANIC(format, ...) { \ - printf("%s: panic: " format "\n", __FUNCTION__, ## __VA_ARGS__ ); \ - abort(); \ -} - -#define PANIC_ON(x) if ((x)) { \ - printf("%s: panic %s\n", __FUNCTION__, #x); \ - abort(); \ -} - -#define red_error(format, ...) { \ - printf("%s: " format "\n", __FUNCTION__, ## __VA_ARGS__ ); \ - abort(); \ -} - -#define red_printf(format, ...) \ - printf("%s: " format "\n", __FUNCTION__, ## __VA_ARGS__ ) - -#define red_printf_once(format, ...) { \ - static int do_print = TRUE; \ - if (do_print) { \ - do_print = FALSE; \ - printf("%s: " format "\n", __FUNCTION__, ## __VA_ARGS__ ); \ - } \ -} - -#define red_printf_some(every, format, ...) { \ - static int count = 0; \ - if (count++ % (every) == 0) { \ - printf("%s: " format "\n", __FUNCTION__, ## __VA_ARGS__ ); \ - } \ -} - enum { STREAM_VIDEO_INVALID, STREAM_VIDEO_OFF, @@ -71,12 +34,5 @@ enum { STREAM_VIDEO_FILTER }; -static inline uint64_t get_time_stamp() -{ - struct timespec time_space; - clock_gettime(CLOCK_MONOTONIC, &time_space); - return time_space.tv_sec * 1000 * 1000 * 1000 + time_space.tv_nsec; -} - #endif |