Skip to content

Commit 0fbdcb1

Browse files
committed
Avoid unused variable warning on Windows about cpp11::preserved
1 parent 29cc833 commit 0fbdcb1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

cpp11test/src/test-protect.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
// Avoid unused variable warnings regarding `cpp11::preserved`
2+
// clang-format off
3+
#ifdef __clang__
4+
# pragma clang diagnostic push
5+
# pragma clang diagnostic ignored "-Wunused-variable"
6+
#endif
7+
8+
#ifdef __GNUC__
9+
# pragma GCC diagnostic push
10+
# pragma GCC diagnostic ignored "-Wunused-variable"
11+
#endif
12+
// clang-format on
13+
114
#define CPP11_USE_FMT
215
#include "cpp11/protect.hpp"
316
#include "testthat.h"

0 commit comments

Comments
 (0)