aboutsummaryrefslogtreecommitdiff
path: root/common/scummsys.h
diff options
context:
space:
mode:
authorAdrian Frühwirth2018-03-28 15:07:03 +0200
committerAdrian Frühwirth2018-04-04 20:56:41 +0000
commita0d7a99439a9d4d070c5847b489222913ec2c5ce (patch)
tree706119271f562643d1adee80005aeafc323625d8 /common/scummsys.h
parent4c5afcf7807ec9c6287be77109408a1cd9538a61 (diff)
downloadscummvm-rg350-a0d7a99439a9d4d070c5847b489222913ec2c5ce.tar.gz
scummvm-rg350-a0d7a99439a9d4d070c5847b489222913ec2c5ce.tar.bz2
scummvm-rg350-a0d7a99439a9d4d070c5847b489222913ec2c5ce.zip
COMMON: Add WARN_UNUSED_RESULT to scummsys.h
Diffstat (limited to 'common/scummsys.h')
-rw-r--r--common/scummsys.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/common/scummsys.h b/common/scummsys.h
index 5486ba27c6..ce54f3b50e 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