Skip to content

Commit 6144d52

Browse files
committed
Move UNUSED out of C++11-dependent #ifdef
1 parent b2dd7f6 commit 6144d52

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/portab.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,15 @@
5252
#endif
5353

5454

55-
// In C++11 UNUSED(x) is explicitly provided
55+
// http://stackoverflow.com/a/4030983/211160
56+
// Use to indicate a variable is being intentionally not referred to (which
57+
// usually generates a compiler warning)
58+
#ifndef UNUSED
59+
#define UNUSED(x) ((void)(true ? 0 : ((x), void(), 0)))
60+
#endif
61+
62+
5663
#if __cplusplus <= 199711L
57-
#if defined (_MSC_VER)
58-
#define UNUSED(x) (void) (x);
59-
#else
60-
#define UNUSED(x) (void) (sizeof((x), 0))
61-
#endif
6264
#ifndef __clang__
6365
#define nullptr NULL
6466
#endif

0 commit comments

Comments
 (0)