Skip to content

Commit 0acb422

Browse files
authored
Silence MSVC warnings when including <bit> pre-C++20 (#1448)
1 parent 52ef3e3 commit 0acb422

File tree

1 file changed

+2
-2
lines changed
  • src/bsoncxx/include/bsoncxx/v1/detail

1 file changed

+2
-2
lines changed

src/bsoncxx/include/bsoncxx/v1/detail/bit.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
#include <bsoncxx/v1/config/config.hpp>
2020

2121
#if defined(__has_include)
22-
#if __has_include(<bit>)
22+
#if __has_include(<bit>) && (!defined(_MSVC_LANG) || _MSVC_LANG >= 202002L)
2323
// Prioritize using std::endian from C++20.
2424
#include <bit>
25-
#endif // __has_include(<bit>)
25+
#endif // __has_include(<bit>) && (!defined(_MSVC_LANG) || _MSVC_LANG >= 202002L)
2626
#elif defined(_WIN32)
2727
// Forward-compatibility with STL: https://github.com/microsoft/STL/blob/vs-2019-16.5/stl/inc/bit#L26
2828
#elif defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__)

0 commit comments

Comments
 (0)