-
Notifications
You must be signed in to change notification settings - Fork 757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix VS 2015 syntax error with macro #447
Conversation
zmq.hpp
Outdated
@@ -436,8 +436,6 @@ class message_t | |||
class Char, | |||
size_t N, | |||
typename = typename std::enable_if<detail::is_char_type<Char>::value>::type> | |||
ZMQ_DEPRECATED("from 4.7.0, use constructors taking iterators, (pointer, size) " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a guard for C++14 around this instead (I'm assuming the failing version of VS does not support that version), since this function is deprecated should not be used anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming the failing version of VS does not support that version
it does!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, this is somwhat awkward. Would it work when defining ZMQ_DEPRECATED
using declspec
for that MSVC version? e.g. by changing the definition of that macro to
#if defined(ZMQ_CPP14) && !defined(_MSC_VER)
#define ZMQ_DEPRECATED(msg) [[deprecated(msg)]]
#elif defined(_MSC_VER)
#define ZMQ_DEPRECATED(msg) __declspec(deprecated(msg))
#elif defined(__GNUC__)
#define ZMQ_DEPRECATED(msg) __attribute__((deprecated(msg)))
#endif
and leaving the deprecation mark here unchanged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gummif Actually, both the VS2017 and VS2015 CI jobs were broken by #399, though I think they were fine on the PR: https://ci.appveyor.com/project/zeromq/cppzmq/builds/35485409
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes could work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we remove the deprecation warning which just breaks the library and release 4.7.1, and deprecate the API formally at the next patch release when we have a clean way of handling it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the suggested fix above work for you then that looks like a good fix to me.
8b058de
to
04b09ce
Compare
04b09ce
to
c34d8ea
Compare
@gummif that worked with the proposed patch. |
Thanks! I just published 4.7.1 with the fix! |
Thanks so much for tagging the release so quickly! |
Fixes #446
It turns out that the use of the deprecation macro before this constructor does not play well with vs2015.
This was introduced at the last commit before the release.