From a0d7a99439a9d4d070c5847b489222913ec2c5ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Fr=C3=BChwirth?= Date: Wed, 28 Mar 2018 15:07:03 +0200 Subject: [PATCH] COMMON: Add WARN_UNUSED_RESULT to scummsys.h --- common/scummsys.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/scummsys.h b/common/scummsys.h index 5486ba27c662..ce54f3b50e9c 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -398,6 +398,18 @@ #endif #endif +#ifndef WARN_UNUSED_RESULT + #if __cplusplus >= 201703L + #define WARN_UNUSED_RESULT [[nodiscard]] + #elif GCC_ATLEAST(3, 4) + #define WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) + #elif defined(_Check_return_) + #define WARN_UNUSED_RESULT _Check_return_ + #else + #define WARN_UNUSED_RESULT + #endif +#endif + #ifndef STRINGBUFLEN #if defined(__N64__) || defined(__DS__) || defined(__3DS__) #define STRINGBUFLEN 256