Skip to content

Commit d1d35a7

Browse files
committed
Suppress MSVC warning C4127 (conditional expression is constant) in headers
1 parent c848010 commit d1d35a7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

include/pcg_extras.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555

5656
#ifdef __GNUC__
5757
#define PCG_NOINLINE __attribute__((noinline))
58+
#elif defined(_MSC_VER)
59+
#define PCG_NOINLINE __declspec(noinline)
60+
#pragma warning(disable:4127) // conditional expression is constant
5861
#else
5962
#define PCG_NOINLINE
6063
#endif

include/pcg_random.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090

9191
#ifdef _MSC_VER
9292
#pragma warning(disable:4146)
93+
#pragma warning(disable:4127) // conditional expression is constant
9394
#endif
9495

9596
#ifdef _MSC_VER

0 commit comments

Comments
 (0)