diff --git a/examples/server_demo_libevent/server_demo_libevent.cpp b/examples/server_demo_libevent/server_demo_libevent.cpp index 7b9fee10e1b6b23eba9813473902ad00c61189f2..48f245ee477bf9cbaf0cd565b218b3e593755f0a 100644 --- a/examples/server_demo_libevent/server_demo_libevent.cpp +++ b/examples/server_demo_libevent/server_demo_libevent.cpp @@ -68,15 +68,7 @@ using namespace ademco; using namespace hb; using namespace hb::common; -// fix gcc cry -#ifdef __GNUG__ -constexpr Char com::A1::data[]; -constexpr Char com::A2::data[]; -constexpr Char com::AC::data[]; -constexpr Char com::AD::data[]; -constexpr Char com::A5::data[]; -constexpr Char com::B0::data[]; -#endif +DECLARE_HB_COMMON_COM_CONSTEXPR_MEMBERS; enum class QueryStage { diff --git a/include/hb_detail.h b/include/hb_detail.h index d4eeaee036b541c395609732c9ff18306e0aab21..9a33a5ee46b892fb3f7aba58a5766996a4ebdad4 100644 --- a/include/hb_detail.h +++ b/include/hb_detail.h @@ -1043,6 +1043,19 @@ struct ResponseParser { } }; +// fix gcc cry +#ifdef __GNUG__ +#define DECLARE_HB_COMMON_COM_CONSTEXPR_MEMBERS \ +constexpr hb::Char hb::common::com::A1::data[]; \ +constexpr hb::Char hb::common::com::A2::data[]; \ +constexpr hb::Char hb::common::com::AC::data[]; \ +constexpr hb::Char hb::common::com::AD::data[]; \ +constexpr hb::Char hb::common::com::A5::data[]; \ +constexpr hb::Char hb::common::com::B0::data[]; +#else +#define DECLARE_HB_COMMON_COM_CONSTEXPR_MEMBERS +#endif + } // namespace com } // namespace common