mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
mesa: Add unreachable() macro.
Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
This commit is contained in:
parent
b35ea09349
commit
3a5223c24c
1 changed files with 15 additions and 0 deletions
|
|
@ -248,6 +248,21 @@ static INLINE GLuint CPU_TO_LE32(GLuint x)
|
|||
(void) sizeof(char [1 - 2*!(COND)]); \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* Unreachable macro. Useful for suppressing "control reaches end of non-void
|
||||
* function" warnings.
|
||||
*/
|
||||
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 5
|
||||
#define unreachable() __builtin_unreachable()
|
||||
#elif (defined(__clang__) && defined(__has_builtin))
|
||||
# if __has_builtin(__builtin_unreachable)
|
||||
# define unreachable() __builtin_unreachable()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef unreachable
|
||||
#define unreachable()
|
||||
#endif
|
||||
|
||||
#if (__GNUC__ >= 3)
|
||||
#define PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a)))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue