diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index 725c01f77d..ded11525c1 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -757,16 +757,18 @@ private: #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection +struct QStdFreeDeleter { + void operator()(void *p) const Q_DECL_NOTHROW { return std::free(p); } +}; + #define Q_XCB_REPLY(call, ...) \ - std::unique_ptr<call##_reply_t, decltype(std::free) *>( \ - call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr), \ - std::free \ + std::unique_ptr<call##_reply_t, QStdFreeDeleter>( \ + call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call(__VA_ARGS__), nullptr) \ ) #define Q_XCB_REPLY_UNCHECKED(call, ...) \ - std::unique_ptr<call##_reply_t, decltype(std::free) *>( \ - call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr), \ - std::free \ + std::unique_ptr<call##_reply_t, QStdFreeDeleter>( \ + call##_reply(Q_XCB_REPLY_CONNECTION_ARG(__VA_ARGS__), call##_unchecked(__VA_ARGS__), nullptr) \ ) template <typename T> |