File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 56
56
#include < set>
57
57
#include < stack>
58
58
59
+ // ! Helper macro to omit unused warning
60
+ #if defined(__GNUC__)
61
+ // GCC / clang don't want the function
62
+ #define CEREAL_BIND_TO_ARCHIVES_UNUSED_FUNCTION
63
+ #else
64
+ #define CEREAL_BIND_TO_ARCHIVES_UNUSED_FUNCTION static void unused () { (void )b; }
65
+ #endif
66
+
59
67
// ! Binds a polymorhic type to all registered archives
60
68
/* ! This binds a polymorphic type to all compatible registered archives that
61
69
have been registered with CEREAL_REGISTER_ARCHIVE. This must be called
67
75
template <> \
68
76
struct init_binding <__VA_ARGS__> { \
69
77
static bind_to_archives<__VA_ARGS__> const & b; \
70
- static void unused () { ( void )b; } \
78
+ CEREAL_BIND_TO_ARCHIVES_UNUSED_FUNCTION \
71
79
}; \
72
80
bind_to_archives<__VA_ARGS__> const & init_binding<__VA_ARGS__>::b = \
73
81
::cereal::detail::StaticObject< \
You can’t perform that action at this time.
0 commit comments