diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-07-23 22:19:15 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-07-23 22:19:15 +0200 |
commit | ba0bcf078a88b02c9ebe853cacb126fb45c2fe60 (patch) | |
tree | 791529386903b57bce55cc20e7da210cafa27773 | |
parent | 23ef7ba87faa6c63f30ab79a4850d540ca2c15e9 (diff) |
Provide different implementations for ODB_POTENTIALLY_UNUSED
The same approach does not work for VC++ and GCC.
-rw-r--r-- | odb/details/unused.hxx | 10 |
1 files changed, 9 insertions, 1 deletions
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 <odb/pre.hxx> -#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 <odb/post.hxx> |