summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-01-08 15:25:44 +0100
committerGitHub <noreply@github.com>2021-01-08 15:25:44 +0100
commitfda1fbf61cbce0b857a14122fe8d6341c6411a98 (patch)
tree84e4e5110d82427bb358ef059cc50551aacf0073 /src
parent4059ccf863909a777932f6d8f2e937a2bf97b7bb (diff)
downloadopenttd-fda1fbf61cbce0b857a14122fe8d6341c6411a98.tar.xz
Revert c1fddb9, 639cfa4: "Codechange: Check if access __attribute__ is supported before trying to use it." (#8526)
This reverts commit c1fddb9a6ae5c3af6865461a7295788a341011a2 and 639cfa43d23aa142cabbf2f08ec20a2133b0503e. access_mode "none" is only supported by GCC11, but introduced after it branched. So there are GCC11.0s out there that do not support it. We will have to wait for GCC11.1 to hit before we can re-add this.
Diffstat (limited to 'src')
-rw-r--r--src/stdafx.h10
-rw-r--r--src/string_func.h16
2 files changed, 8 insertions, 18 deletions
diff --git a/src/stdafx.h b/src/stdafx.h
index 0244e567d..e5cb9205f 100644
--- a/src/stdafx.h
+++ b/src/stdafx.h
@@ -137,16 +137,6 @@
# endif
#endif /* __GNUC__ || __clang__ */
-#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
-
#if defined(__WATCOMC__)
# define NORETURN
# define CDECL
diff --git a/src/string_func.h b/src/string_func.h
index 7a53710c2..13e14f2d3 100644
--- a/src/string_func.h
+++ b/src/string_func.h
@@ -30,25 +30,25 @@
#include "core/bitmath_func.hpp"
#include "string_type.h"
-char *strecat(char *dst, const char *src, const char *last) NOACCESS(3);
-char *strecpy(char *dst, const char *src, const char *last) NOACCESS(3);
-char *stredup(const char *src, const char *last = nullptr) NOACCESS(2);
+char *strecat(char *dst, const char *src, const char *last);
+char *strecpy(char *dst, const char *src, const char *last);
+char *stredup(const char *src, const char *last = nullptr);
-int CDECL seprintf(char *str, const char *last, const char *format, ...) WARN_FORMAT(3, 4) NOACCESS(2);
-int CDECL vseprintf(char *str, const char *last, const char *format, va_list ap) WARN_FORMAT(3, 0) NOACCESS(2);
+int CDECL seprintf(char *str, const char *last, const char *format, ...) WARN_FORMAT(3, 4);
+int CDECL vseprintf(char *str, const char *last, const char *format, va_list ap) WARN_FORMAT(3, 0);
char *CDECL str_fmt(const char *str, ...) WARN_FORMAT(1, 2);
-void str_validate(char *str, const char *last, StringValidationSettings settings = SVS_REPLACE_WITH_QUESTION_MARK) NOACCESS(2);
+void str_validate(char *str, const char *last, StringValidationSettings settings = SVS_REPLACE_WITH_QUESTION_MARK);
std::string str_validate(const std::string &str, StringValidationSettings settings = SVS_REPLACE_WITH_QUESTION_MARK);
void ValidateString(const char *str);
-void str_fix_scc_encoded(char *str, const char *last) NOACCESS(2);
+void str_fix_scc_encoded(char *str, const char *last);
void str_strip_colours(char *str);
bool strtolower(char *str);
bool strtolower(std::string &str, std::string::size_type offs = 0);
-bool StrValid(const char *str, const char *last) NOACCESS(2);
+bool StrValid(const char *str, const char *last);
/**
* Check if a string buffer is empty.