Skip to content

Commit 84ba0c7

Browse files
authored
Merge pull request #704 from owent-contrib/master
Fix MSGPACK_DEPRECATED for MSVC 1914 with /Zc:__cplusplus
2 parents f79606d + 7340f1e commit 84ba0c7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/msgpack/v1/cpp_config.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,11 @@ template<class T> struct is_pointer : detail::is_pointer_helper<typename remove_
127127
#endif // MSGPACK_USE_CPP03
128128

129129
#if __cplusplus >= 201402L
130+
#if defined(_MSC_VER)
131+
#define MSGPACK_DEPRECATED(msg) __declspec(deprecated(msg))
132+
#else // _MSC_VER 1914+ with /Zc:__cplusplus, @see https://docs.microsoft.com/cpp/build/reference/zc-cplusplus
130133
#define MSGPACK_DEPRECATED(msg) [[deprecated(msg)]]
134+
#endif
131135
#else // __cplusplus >= 201402L
132136
#define MSGPACK_DEPRECATED(msg)
133137
#endif // __cplusplus >= 201402L

0 commit comments

Comments
 (0)