Skip to content

Commit b9bbbd8

Browse files
committed
And guard <cuchar> too, why not... closes #16
I was trying to rely on only the named feature tests, but if adding this `__has_include` can unblock someone then let's do it. Also add a `(void)` cast to `~c_raii()` to silence a Clang warning
1 parent 2b96638 commit b9bbbd8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

include/cpp2util.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@
106106
#include <cctype>
107107
#include <charconv>
108108
#include <cstring>
109-
#include <cuchar>
109+
#if __has_include(<cuchar>)
110+
#include <cuchar>
111+
#endif
110112
#include <cwchar>
111113
#include <cwctype>
112114
#ifdef __cpp_lib_format
@@ -777,7 +779,7 @@ class c_raii {
777779
template<typename D>
778780
c_raii( T t_, D d )
779781
: t{ t_ }
780-
, dtor{ [](void* x) { (D)(x); } }
782+
, dtor{ [](void* x) { (void)(D)(x); } }
781783
{ }
782784

783785
~c_raii() { if (dtor) dtor(t); }

0 commit comments

Comments
 (0)