dpkg 1.22.7-3-g89f48
Loading...
Searching...
No Matches
Macros
C language support macros
Collaboration diagram for C language support macros:

Macros

#define __has_include(x)   0
 
#define __has_warning(w)   (0)
 
#define DPKG_PRAGMA(x)   _Pragma(#x)
 
#define DPKG_PRAGMA_CC(x)
 
#define DPKG_IGNORE_WARNING(w)
 
#define DPKG_ACCEPT_WARNING()    DPKG_PRAGMA_CC(diagnostic pop)
 
#define DPKG_IGNORE_WARNING_ASSIGN_ENUM()
 
#define DPKG_ACCEPT_WARNING_ASSIGN_ENUM()
 
#define __has_attribute(x)   0
 
#define DPKG_GCC_VERSION   0
 
#define DPKG_ATTR_UNUSED
 
#define DPKG_ATTR_CONST
 
#define DPKG_ATTR_PURE
 
#define DPKG_ATTR_MALLOC
 
#define DPKG_ATTR_NORET
 
#define DPKG_ATTR_FMT(t, f, a)
 
#define DPKG_ATTR_PRINTF(n)
 
#define DPKG_ATTR_VPRINTF(n)
 
#define DPKG_ATTR_NONNULL(...)
 
#define DPKG_ATTR_REQRET
 
#define DPKG_ATTR_SENTINEL
 
#define DPKG_ATTR_NONSTRING
 
#define DPKG_ATTR_ENUM_FLAGS
 
#define DPKG_BEGIN_DECLS
 
#define DPKG_END_DECLS
 
#define DPKG_NULL   NULL
 A null pointer constant that works on C or C++.
 
#define DPKG_STATIC_CAST(type, expr)   (type)(expr)
 Cast an expression to a given type that works on C or C++.
 
#define DPKG_BIT(n)   (1UL << (n))
 Return the integer value of bit n.
 
#define array_count(a)   (sizeof(a) / sizeof((a)[0]))
 Returns the amount of items in an array.
 
#define min(a, b)   ((a) < (b) ? (a) : (b))
 
#define max(a, b)   ((a) > (b) ? (a) : (b))
 
#define clamp(v, l, h)   ((v) > (h) ? (h) : ((v) < (l) ? (l) : (v)))
 Returns a normalized value within the low and high limits.
 

Detailed Description

Macro Definition Documentation

◆ __has_attribute

#define __has_attribute (   x)    0

◆ __has_include

#define __has_include (   x)    0

◆ __has_warning

#define __has_warning (   w)    (0)

◆ array_count

#define array_count (   a)    (sizeof(a) / sizeof((a)[0]))

Returns the amount of items in an array.

◆ clamp

#define clamp (   v,
  l,
 
)    ((v) > (h) ? (h) : ((v) < (l) ? (l) : (v)))

Returns a normalized value within the low and high limits.

Parameters
vThe value to clamp.
lThe low limit.
hThe high limit.

◆ DPKG_ACCEPT_WARNING

#define DPKG_ACCEPT_WARNING ( )     DPKG_PRAGMA_CC(diagnostic pop)

◆ DPKG_ACCEPT_WARNING_ASSIGN_ENUM

#define DPKG_ACCEPT_WARNING_ASSIGN_ENUM ( )

◆ DPKG_ATTR_CONST

#define DPKG_ATTR_CONST

◆ DPKG_ATTR_ENUM_FLAGS

#define DPKG_ATTR_ENUM_FLAGS

◆ DPKG_ATTR_FMT

#define DPKG_ATTR_FMT (   t,
  f,
 
)

◆ DPKG_ATTR_MALLOC

#define DPKG_ATTR_MALLOC

◆ DPKG_ATTR_NONNULL

#define DPKG_ATTR_NONNULL (   ...)

◆ DPKG_ATTR_NONSTRING

#define DPKG_ATTR_NONSTRING

◆ DPKG_ATTR_NORET

#define DPKG_ATTR_NORET

◆ DPKG_ATTR_PRINTF

#define DPKG_ATTR_PRINTF (   n)

◆ DPKG_ATTR_PURE

#define DPKG_ATTR_PURE

◆ DPKG_ATTR_REQRET

#define DPKG_ATTR_REQRET

◆ DPKG_ATTR_SENTINEL

#define DPKG_ATTR_SENTINEL

◆ DPKG_ATTR_UNUSED

#define DPKG_ATTR_UNUSED

◆ DPKG_ATTR_VPRINTF

#define DPKG_ATTR_VPRINTF (   n)

◆ DPKG_BEGIN_DECLS

#define DPKG_BEGIN_DECLS

◆ DPKG_BIT

#define DPKG_BIT (   n)    (1UL << (n))

Return the integer value of bit n.

◆ DPKG_END_DECLS

#define DPKG_END_DECLS

◆ DPKG_GCC_VERSION

#define DPKG_GCC_VERSION   0

◆ DPKG_IGNORE_WARNING

#define DPKG_IGNORE_WARNING (   w)
Value:
DPKG_PRAGMA_CC(diagnostic push); \
DPKG_PRAGMA_CC(diagnostic ignored w)
#define DPKG_PRAGMA_CC(x)
Definition macros.h:52

◆ DPKG_IGNORE_WARNING_ASSIGN_ENUM

#define DPKG_IGNORE_WARNING_ASSIGN_ENUM ( )

◆ DPKG_NULL

#define DPKG_NULL   NULL

A null pointer constant that works on C or C++.

To be used only on header files, where having to conditionalize the code to use either NULL or nullptr would be too cumbersome. Non-header files should use the appropriate constant directly.

◆ DPKG_PRAGMA

#define DPKG_PRAGMA (   x)    _Pragma(#x)

◆ DPKG_PRAGMA_CC

#define DPKG_PRAGMA_CC (   x)

◆ DPKG_STATIC_CAST

#define DPKG_STATIC_CAST (   type,
  expr 
)    (type)(expr)

Cast an expression to a given type that works on C or C++.

To be used only on header files, where having to conditionalize the code to use either NULL or nullptr would be too cumbersome. Non-header files should use the appropriate constant directly.

◆ max

#define max (   a,
 
)    ((a) > (b) ? (a) : (b))

◆ min

#define min (   a,
 
)    ((a) < (b) ? (a) : (b))