Skip to content
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

Merged
merged 1 commit into from
Oct 5, 2020

Conversation

SylvainCorlay
Copy link
Contributor

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.

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) "
Copy link
Member

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.

Copy link
Contributor Author

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!

Copy link
Member

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?

Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes could work.

Copy link
Contributor Author

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?

Copy link
Member

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.

@SylvainCorlay
Copy link
Contributor Author

@gummif that worked with the proposed patch.

@sigiesec sigiesec merged commit 03243ad into zeromq:master Oct 5, 2020
@sigiesec
Copy link
Member

sigiesec commented Oct 5, 2020

Thanks! I just published 4.7.1 with the fix!

@SylvainCorlay SylvainCorlay deleted the vs2015-syntax-error branch October 5, 2020 13:36
@SylvainCorlay
Copy link
Contributor Author

Thanks so much for tagging the release so quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MSVC compilation errors with 4.7 release.
3 participants