mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-10 08:00:05 +00:00
Codechange: Enable FINAL, (un)likely, __attribute__ when building with clang
This commit is contained in:
parent
fc52d3df50
commit
0e017f6233
@ -111,7 +111,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Stuff for GCC */
|
/* Stuff for GCC */
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__) || defined(__clang__)
|
||||||
# define NORETURN __attribute__ ((noreturn))
|
# define NORETURN __attribute__ ((noreturn))
|
||||||
# define CDECL
|
# define CDECL
|
||||||
# define __int64 long long
|
# define __int64 long long
|
||||||
@ -134,7 +134,7 @@
|
|||||||
# else
|
# else
|
||||||
# define FALLTHROUGH
|
# define FALLTHROUGH
|
||||||
# endif
|
# endif
|
||||||
#endif /* __GNUC__ */
|
#endif /* __GNUC__ || __clang__ */
|
||||||
|
|
||||||
#if defined(__WATCOMC__)
|
#if defined(__WATCOMC__)
|
||||||
# define NORETURN
|
# define NORETURN
|
||||||
@ -417,13 +417,13 @@ assert_compile(SIZE_MAX >= UINT32_MAX);
|
|||||||
# define CloseConnection OTTD_CloseConnection
|
# define CloseConnection OTTD_CloseConnection
|
||||||
#endif /* __APPLE__ */
|
#endif /* __APPLE__ */
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#if defined(__GNUC__) || defined(__clang__)
|
||||||
# define likely(x) __builtin_expect(!!(x), 1)
|
# define likely(x) __builtin_expect(!!(x), 1)
|
||||||
# define unlikely(x) __builtin_expect(!!(x), 0)
|
# define unlikely(x) __builtin_expect(!!(x), 0)
|
||||||
#else
|
#else
|
||||||
# define likely(x) (x)
|
# define likely(x) (x)
|
||||||
# define unlikely(x) (x)
|
# define unlikely(x) (x)
|
||||||
#endif
|
#endif /* __GNUC__ || __clang__ */
|
||||||
|
|
||||||
void NORETURN CDECL usererror(const char *str, ...) WARN_FORMAT(1, 2);
|
void NORETURN CDECL usererror(const char *str, ...) WARN_FORMAT(1, 2);
|
||||||
void NORETURN CDECL error(const char *str, ...) WARN_FORMAT(1, 2);
|
void NORETURN CDECL error(const char *str, ...) WARN_FORMAT(1, 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user