diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-02-25 14:46:00 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-02-25 14:46:00 +0900 |
commit | 5b5eb135be40449a6a63eb9872787bec1ecd0fc2 (patch) | |
tree | 94a17c1eb56d60503dbe679b06be672ba65fea35 /lib/util.h | |
parent | 2213080a13a4eb472c8ac2267efcebc6f0936eb1 (diff) | |
download | libquotient-5b5eb135be40449a6a63eb9872787bec1ecd0fc2.tar.gz libquotient-5b5eb135be40449a6a63eb9872787bec1ecd0fc2.zip |
Have a build-wide macro for compilers that don't handle init-lists right
WORKAROUND_EXTENDED_INITIALIZER_LIST -> BROKEN_INITIALIZER_LISTS is
available from util.h now.
Diffstat (limited to 'lib/util.h')
-rw-r--r-- | lib/util.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -52,6 +52,14 @@ template <typename T> static void qAsConst(const T &&) Q_DECL_EQ_DELETE; #endif +// MSVC 2015 and older GCC's don't handle initialisation from initializer lists +// right in the absense of a constructor; MSVC 2015, notably, fails with +// "error C2440: 'return': cannot convert from 'initializer list' to '<type>'" +#if (defined(_MSC_VER) && _MSC_VER < 1910) || \ + (defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 4) +# define BROKEN_INITIALIZER_LISTS +#endif + namespace QMatrixClient { // The below enables pretty-printing of enums in logs |