[dia] tests: make test-sizeof compile with gcc/clang
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] tests: make test-sizeof compile with gcc/clang
- Date: Sat, 15 Nov 2014 17:10:48 +0000 (UTC)
commit 2a674aa417f26cf1401c47c5c611ea991775c65d
Author: Hans Breuer <hans breuer org>
Date: Sat Nov 15 17:29:40 2014 +0100
tests: make test-sizeof compile with gcc/clang
both their preprocessors choke on ##, which is not necessary for
the case at hand
tests/Makefile.am | 5 ++++-
tests/test-sizeof.c | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 962668d..b3da505 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -24,7 +24,6 @@ noinst_PROGRAMS = $(TEST_PROGS)
progs_ldadd = $(top_builddir)/lib/libdia.la $(GTK_LIBS)
-
TEST_PROGS = boundingbox
boundingbox_SOURCES = test-boundingbox.c
boundingbox_LDADD = $(progs_ldadd)
@@ -33,6 +32,10 @@ TEST_PROGS += objects
objects_SOURCES = test-objects.c
objects_LDADD = $(progs_ldadd)
+TEST_PROGS += sizeof
+sizeof_SOURCES = test-sizeof.c
+sizeof_LDADD = $(progs_ldadd)
+
TEST_PROGS += testsvg
testsvg_SOURCES = test-svg.c
testsvg_LDADD = $(progs_ldadd)
diff --git a/tests/test-sizeof.c b/tests/test-sizeof.c
index ab3a08c..cac63af 100644
--- a/tests/test-sizeof.c
+++ b/tests/test-sizeof.c
@@ -11,7 +11,7 @@
int
main (int argc, char** argv)
{
-#define DUMP(o) g_print ("%s: %d\n", #o, sizeof(##o))
+#define DUMP(o) g_print ("%s: %d\n", #o, (int)sizeof(o))
DUMP(DiaObject);
DUMP(Connection);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]