mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 18:08:53 +08:00
UAVCAN_LIKELY(), UAVCAN_UNLIKELY()
This commit is contained in:
@@ -167,6 +167,22 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef UAVCAN_LIKELY
|
||||
# if __GNUC__
|
||||
# define UAVCAN_LIKELY(x) __builtin_expect(!!(x), true)
|
||||
# else
|
||||
# define UAVCAN_LIKELY(x) (x)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef UAVCAN_UNLIKELY
|
||||
# if __GNUC__
|
||||
# define UAVCAN_UNLIKELY(x) __builtin_expect(!!(x), false)
|
||||
# else
|
||||
# define UAVCAN_UNLIKELY(x) (x)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
namespace uavcan
|
||||
{
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user