Skip to content

Commit 49d22b7

Browse files
authored
Merge pull request #683 from redboltz/fix_658
Fixed #658.
2 parents bd18a36 + 96133c8 commit 49d22b7

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

include/msgpack/type.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,13 @@
4242
#include "adaptor/cpp11/unordered_map.hpp"
4343
#include "adaptor/cpp11/unordered_set.hpp"
4444

45-
#if __cplusplus >= 201703
46-
45+
#if MSGPACK_HAS_INCLUDE(<optional>)
4746
#include "adaptor/cpp17/optional.hpp"
48-
#include "adaptor/cpp17/string_view.hpp"
47+
#endif // MSGPACK_HAS_INCLUDE(<optional>)
4948

50-
#endif // __cplusplus >= 201703
49+
#if MSGPACK_HAS_INCLUDE(<string_view>)
50+
#include "adaptor/cpp17/string_view.hpp"
51+
#endif // MSGPACK_HAS_INCLUDE(<string_view>)
5152

5253
#endif // defined(MSGPACK_USE_CPP03)
5354

include/msgpack/v1/cpp_config_decl.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,10 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
128128

129129
#endif // MSGPACK_USE_CPP03
130130

131+
#if defined(__has_include)
132+
#define MSGPACK_HAS_INCLUDE __has_include
133+
#else // defined(__has_include)
134+
#define MSGPACK_HAS_INCLUDE(header) 0
135+
#endif // defined(__has_include)
136+
131137
#endif // MSGPACK_V1_CPP_CONFIG_DECL_HPP

0 commit comments

Comments
 (0)