summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2011-04-22 16:17:14 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2011-05-03 14:44:11 +0200
commit48db4c2181d4918b0e2727d0bbe864b9e8019d85 (patch)
tree04e465349a780a410273aa4ad371b26ce5506c7e /common
parentf88dc6eecb56222688275893e2a891d8ec23d1d6 (diff)
common,server: use ASSERT from spice_common.h
spice_common.h provides an ASSERT macro, no need to duplicate it in many places. For now client/debug.h keeps its own copy since debug.h and spice_common.h have clashes on other macros which are trickier to unify.
Diffstat (limited to 'common')
-rw-r--r--common/canvas_base.c7
-rw-r--r--common/canvas_utils.c8
-rw-r--r--common/glc.c2
-rw-r--r--common/pixman_utils.c8
-rw-r--r--common/region.c5
-rw-r--r--common/rop3.c8
-rw-r--r--common/spice_common.h1
7 files changed, 3 insertions, 36 deletions
diff --git a/common/canvas_base.c b/common/canvas_base.c
index 272c7e86..a8db3672 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -50,13 +50,6 @@
}
#endif
-#ifndef ASSERT
-#define ASSERT(x) if (!(x)) { \
- printf("%s: ASSERT %s failed\n", __FUNCTION__, #x); \
- abort(); \
-}
-#endif
-
#ifndef WARN
#define WARN(x) printf("warning: %s\n", x)
#endif
diff --git a/common/canvas_utils.c b/common/canvas_utils.c
index 1b81d548..d861800a 100644
--- a/common/canvas_utils.c
+++ b/common/canvas_utils.c
@@ -33,14 +33,6 @@
extern int gdi_handlers;
#endif
-#ifndef ASSERT
-#define ASSERT(x) if (!(x)) { \
- printf("%s: ASSERT %s failed\n", __FUNCTION__, #x); \
- abort(); \
-}
-#endif
-
-
#ifndef CANVAS_ERROR
#define CANVAS_ERROR(format, ...) { \
printf("%s: " format "\n", __FUNCTION__, ## __VA_ARGS__); \
diff --git a/common/glc.c b/common/glc.c
index d90e3836..0396fc98 100644
--- a/common/glc.c
+++ b/common/glc.c
@@ -40,8 +40,6 @@
#include "glc.h"
#include "gl_utils.h"
-#define ASSERT(x) if (!(x)) {printf("%s: assert failed %s\n", __FUNCTION__, #x); abort();}
-
#define WARN_ONCE(x) { \
static int warn = TRUE; \
if (warn) { \
diff --git a/common/pixman_utils.c b/common/pixman_utils.c
index e876fe69..99a30050 100644
--- a/common/pixman_utils.c
+++ b/common/pixman_utils.c
@@ -20,6 +20,7 @@
#endif
#include "pixman_utils.h"
+#include "spice_common.h"
#include <spice/macros.h>
#include <stdlib.h>
@@ -27,13 +28,6 @@
#include <stdio.h>
#include "mem.h"
-#ifndef ASSERT
-#define ASSERT(x) if (!(x)) { \
- printf("%s: ASSERT %s failed\n", __FUNCTION__, #x); \
- abort(); \
-}
-#endif
-
#ifndef PANIC
#define PANIC(str) { \
printf("%s: panic: %s", __FUNCTION__, str); \
diff --git a/common/region.c b/common/region.c
index 0e1613c0..10a6e62e 100644
--- a/common/region.c
+++ b/common/region.c
@@ -28,11 +28,6 @@
#include "rect.h"
#include "mem.h"
-#define ASSERT(x) if (!(x)) { \
- printf("%s: ASSERT %s failed\n", __FUNCTION__, #x); \
- abort(); \
-}
-
/* true iff two Boxes overlap */
#define EXTENTCHECK(r1, r2) \
(!( ((r1)->x2 <= (r2)->x1) || \
diff --git a/common/rop3.c b/common/rop3.c
index 53e8a6da..1ce2cd25 100644
--- a/common/rop3.c
+++ b/common/rop3.c
@@ -22,13 +22,7 @@
#include <stdio.h>
#include "rop3.h"
-
-#ifndef ASSERT
-#define ASSERT(x) if (!(x)) { \
- printf("%s: ASSERT %s failed\n", __FUNCTION__, #x); \
- abort(); \
-}
-#endif
+#include "spice_common.h"
#ifndef WARN
#define WARN(x) printf("warning: %s\n", x)
diff --git a/common/spice_common.h b/common/spice_common.h
index 75ebda75..430c8aff 100644
--- a/common/spice_common.h
+++ b/common/spice_common.h
@@ -19,6 +19,7 @@
#define H_SPICE_COMMON
#include <stdio.h>
+#include <stdint.h>
#include <time.h>
#include <stdlib.h>