Skip to content

Commit d1ea5c1

Browse files
Fix: malformed pragmas on MSVC
1 parent 4c3d2c4 commit d1ea5c1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/compiler.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#endif
3232
#elif defined(_MSC_VER)
3333
#undef bsoncxx_if_msvc
34-
#undef bsoncxx_if_msvc(...) __VA_ARGS__
34+
#define bsoncxx_if_msvc(...) __VA_ARGS__
3535
#endif
3636

3737
// clang-format on

src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/util.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#define bsoncxx_pragma(...) _bsoncxxPragma(__VA_ARGS__)
3030
#ifdef _MSC_VER
3131
// Old MSVC doesn't recognize C++11 _Pragma(), but it always recognized __pragma
32-
#define _bsoncxxPragma(...) __pragma(bsoncxx_stringify(__VA_ARGS__))
32+
#define _bsoncxxPragma(...) __pragma(__VA_ARGS__)
3333
#else
3434
#define _bsoncxxPragma(...) _Pragma(bsoncxx_stringify(__VA_ARGS__))
3535
#endif
@@ -122,4 +122,4 @@
122122
_bsoncxxDisableWarningImpl_for_Clang(__VA_ARGS__)
123123

124124
#define _bsoncxxDisableWarningImpl_for_MSVC(...) \
125-
bsoncxx_if_msvc(warning(disable : __VA_ARGS__))
125+
bsoncxx_if_msvc(bsoncxx_pragma(warning(disable : __VA_ARGS__)))

0 commit comments

Comments
 (0)