summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormilek7 <me@milek7.pl>2021-01-08 01:57:58 +0100
committerCharles Pigott <charlespigott@googlemail.com>2021-01-08 09:12:37 +0000
commitc1fddb9a6ae5c3af6865461a7295788a341011a2 (patch)
treeafb071af0ef60ed7c01a0cea3f5b3e5ec4749cee
parent639cfa43d23aa142cabbf2f08ec20a2133b0503e (diff)
downloadopenttd-c1fddb9a6ae5c3af6865461a7295788a341011a2.tar.xz
Codechange: Check if access __attribute__ is supported before trying to use it.
-rw-r--r--src/stdafx.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/stdafx.h b/src/stdafx.h
index 9e2eb2aef..7d5a8754f 100644
--- a/src/stdafx.h
+++ b/src/stdafx.h
@@ -136,8 +136,12 @@
# endif
#endif /* __GNUC__ || __clang__ */
-#if defined(__GNUC__)
-# define NOACCESS(args) __attribute__ ((access (none, args)))
+#if defined __has_attribute
+# if __has_attribute (access)
+# define NOACCESS(args) __attribute__ ((access (none, args)))
+# else
+# define NOACCESS(args)
+# endif
#else
# define NOACCESS(args)
#endif