Skip to content

Commit 178532b

Browse files
committed
Fix GitHub Actions: Correct PCG_NODISCARD placement and improve macro support for pre-C++17 compilers.
1 parent a94acdf commit 178532b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

include/pcg_random.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@
113113

114114
#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
115115
#define PCG_NODISCARD [[nodiscard]]
116+
#elif defined(__GNUC__) || defined(__clang__)
117+
#define PCG_NODISCARD __attribute__((warn_unused_result))
116118
#else
117119
#define PCG_NODISCARD
118120
#endif
@@ -1310,7 +1312,7 @@ class PCG_EBO extended : public baseclass {
13101312
return baseclass::period_pow2() + table_size*extvalclass::period_pow2();
13111313
}
13121314

1313-
PCG_ALWAYS_INLINE PCG_NODISCARD result_type operator()()
1315+
PCG_NODISCARD PCG_ALWAYS_INLINE result_type operator()()
13141316
{
13151317
result_type rhs = get_extended_value();
13161318
result_type lhs = this->baseclass::operator()();

0 commit comments

Comments
 (0)