Android-cuttlefish cvd tool
Macros | Functions
macros.h File Reference
#include <stddef.h>
#include <unistd.h>
#include <utility>
Include dependency graph for macros.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TEMP_FAILURE_RETRY(exp)
 
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
 
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)
 
#define arraysize(array)   (sizeof(ArraySizeHelper(array)))
 
#define SIZEOF_MEMBER(t, f)   sizeof(std::declval<t>().f)
 
#define LIKELY(exp)   (__builtin_expect( (exp) != 0, true ))
 
#define UNLIKELY(exp)   (__builtin_expect( (exp) != 0, false ))
 
#define WARN_UNUSED   __attribute__((warn_unused_result))
 
#define ATTRIBUTE_UNUSED   __attribute__((__unused__))
 
#define FALLTHROUGH_INTENDED   [[clang::fallthrough]]
 

Functions

template<typename T , size_t N>
char(& ArraySizeHelper (T(&array)[N]))[N]
 
template<typename... T>
void UNUSED (const T &...)
 

Macro Definition Documentation

◆ arraysize

#define arraysize (   array)    (sizeof(ArraySizeHelper(array)))

◆ ATTRIBUTE_UNUSED

#define ATTRIBUTE_UNUSED   __attribute__((__unused__))

◆ DISALLOW_COPY_AND_ASSIGN

#define DISALLOW_COPY_AND_ASSIGN (   TypeName)
Value:
TypeName(const TypeName&) = delete; \
void operator=(const TypeName&) = delete
constexpr std::string_view TypeName()
Definition: type_name.h:61

◆ DISALLOW_IMPLICIT_CONSTRUCTORS

#define DISALLOW_IMPLICIT_CONSTRUCTORS (   TypeName)
Value:
TypeName() = delete; \
DISALLOW_COPY_AND_ASSIGN(TypeName)

◆ FALLTHROUGH_INTENDED

#define FALLTHROUGH_INTENDED   [[clang::fallthrough]]

◆ LIKELY

#define LIKELY (   exp)    (__builtin_expect( (exp) != 0, true ))

◆ SIZEOF_MEMBER

#define SIZEOF_MEMBER (   t,
 
)    sizeof(std::declval<t>().f)

◆ TEMP_FAILURE_RETRY

#define TEMP_FAILURE_RETRY (   exp)
Value:
({ \
decltype(exp) _rc; \
do { \
_rc = (exp); \
} while (_rc == -1 && errno == EINTR); \
_rc; \
})

◆ UNLIKELY

#define UNLIKELY (   exp)    (__builtin_expect( (exp) != 0, false ))

◆ WARN_UNUSED

#define WARN_UNUSED   __attribute__((warn_unused_result))

Function Documentation

◆ ArraySizeHelper()

template<typename T , size_t N>
char(& ArraySizeHelper ( T(&)  array[N]) )[N]

◆ UNUSED()

template<typename... T>
void UNUSED ( const T &  ...)