mirror of https://github.com/CGAL/cgal
Mark BOOST_STATIC_ASSERT with 'CGAL_UNUSED'
In order to fix such a warning from g++-4.8:
warning: typedef ‘boost_static_assert_typedef_241’ locally defined but
not used [-Wunused-local-typedefs]
then:
- create one macro CGAL_UNUSED that is "__attribute__ ((__unused__))"
with g++ or empty otherwise,
- use it after BOOST_STATIC_ASSERT in the definition of
CGAL_static_assertion.
This commit is contained in:
parent
551acd15bf
commit
29c05b900b
|
|
@ -292,13 +292,19 @@ using std::max;
|
|||
#endif
|
||||
|
||||
|
||||
// Macro to specify a noreturn attribute.
|
||||
// Macro to specify a 'noreturn' attribute.
|
||||
#ifdef __GNUG__
|
||||
# define CGAL_NORETURN __attribute__ ((__noreturn__))
|
||||
#else
|
||||
# define CGAL_NORETURN
|
||||
#endif
|
||||
|
||||
// Macro to specify a 'unused' attribute.
|
||||
#ifdef __GNUG__
|
||||
# define CGAL_UNUSED __attribute__ ((__unused__))
|
||||
#else
|
||||
# define CGAL_UNUSED
|
||||
#endif
|
||||
|
||||
// If CGAL_HAS_THREADS is not defined, then CGAL code assumes
|
||||
// it can do any thread-unsafe things (like using static variables).
|
||||
|
|
|
|||
|
|
@ -115,18 +115,18 @@ inline bool possibly(Uncertain<bool> c);
|
|||
# if defined(CGAL_NO_ASSERTIONS)
|
||||
|
||||
# define CGAL_static_assertion(EX) \
|
||||
BOOST_STATIC_ASSERT(true)
|
||||
BOOST_STATIC_ASSERT(true) CGAL_UNUSED
|
||||
|
||||
# define CGAL_static_assertion_msg(EX,MSG) \
|
||||
BOOST_STATIC_ASSERT(true)
|
||||
BOOST_STATIC_ASSERT(true) CGAL_UNUSED
|
||||
|
||||
# else // no CGAL_NO_ASSERTIONS
|
||||
|
||||
# define CGAL_static_assertion(EX) \
|
||||
BOOST_STATIC_ASSERT(EX)
|
||||
BOOST_STATIC_ASSERT(EX) CGAL_UNUSED
|
||||
|
||||
# define CGAL_static_assertion_msg(EX,MSG) \
|
||||
BOOST_STATIC_ASSERT(EX)
|
||||
BOOST_STATIC_ASSERT(EX) CGAL_UNUSED
|
||||
|
||||
# endif // no CGAL_NO_ASSERTIONS
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue