mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 11:08:03 +02:00
std-aux: add _nm_unreachable_code() macro to wrap __builtin_unreachable()
This is a GCC-ism, but clang and all our current compiler support it.
This commit is contained in:
parent
fffdb14887
commit
5ac5d7f8c3
1 changed files with 8 additions and 0 deletions
|
|
@ -75,6 +75,14 @@
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* This is mainly used in case of failed assertions. Usually assert() itself
|
||||
* already ensures that the code path is marked as unreachable, however with
|
||||
* NDEBUG that might not be the case. We want to mark the code as unreachable
|
||||
* even with NDEBUG/G_DISABLE_ASSERT. */
|
||||
#define _nm_unreachable_code() __builtin_unreachable()
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#ifndef _NM_CC_SUPPORT_AUTO_TYPE
|
||||
#if (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)))
|
||||
#define _NM_CC_SUPPORT_AUTO_TYPE 1
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue