From ba0bcf078a88b02c9ebe853cacb126fb45c2fe60 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 23 Jul 2011 22:19:15 +0200 Subject: Provide different implementations for ODB_POTENTIALLY_UNUSED The same approach does not work for VC++ and GCC. --- odb/details/unused.hxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/odb/details/unused.hxx b/odb/details/unused.hxx index bf1638f..31ceb52 100644 --- a/odb/details/unused.hxx +++ b/odb/details/unused.hxx @@ -8,7 +8,15 @@ #include -#define ODB_POTENTIALLY_UNUSED(x) (void*)&x +// VC++ doesn't like the (void)x expression if x is a reference to +// an incomplete type. On the other hand, GCC warns that (void*)&x +// doesn't have any effect. +// +#ifdef _MSC_VER +# define ODB_POTENTIALLY_UNUSED(x) (void*)&x +#else +# define ODB_POTENTIALLY_UNUSED(x) (void)x +#endif #include -- cgit v1.1