summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonathan G Rennison <j.g.rennison@gmail.com>2016-09-08 18:38:53 +0100
committerCharles Pigott <charlespigott@googlemail.com>2020-12-27 10:30:55 +0000
commit0e017f62330c09bc8c5a69f3e8424645726de560 (patch)
treea92364ca358e6889d593862b2c3ca593fdd0e0cf /src
parentfc52d3df5010994083c858fef01fa2926de951ad (diff)
downloadopenttd-0e017f62330c09bc8c5a69f3e8424645726de560.tar.xz
Codechange: Enable FINAL, (un)likely, __attribute__ when building with clang
Diffstat (limited to 'src')
-rw-r--r--src/stdafx.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/stdafx.h b/src/stdafx.h
index 332f1a3ee..c99d7a277 100644
--- a/src/stdafx.h
+++ b/src/stdafx.h
@@ -111,7 +111,7 @@
#endif
/* Stuff for GCC */
-#if defined(__GNUC__)
+#if defined(__GNUC__) || defined(__clang__)
# define NORETURN __attribute__ ((noreturn))
# define CDECL
# define __int64 long long
@@ -134,7 +134,7 @@
# else
# define FALLTHROUGH
# endif
-#endif /* __GNUC__ */
+#endif /* __GNUC__ || __clang__ */
#if defined(__WATCOMC__)
# define NORETURN
@@ -417,13 +417,13 @@ assert_compile(SIZE_MAX >= UINT32_MAX);
# define CloseConnection OTTD_CloseConnection
#endif /* __APPLE__ */
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__clang__)
# define likely(x) __builtin_expect(!!(x), 1)
# define unlikely(x) __builtin_expect(!!(x), 0)
#else
# define likely(x) (x)
# define unlikely(x) (x)
-#endif
+#endif /* __GNUC__ || __clang__ */
void NORETURN CDECL usererror(const char *str, ...) WARN_FORMAT(1, 2);
void NORETURN CDECL error(const char *str, ...) WARN_FORMAT(1, 2);