Pioneer
Loading...
Searching...
No Matches
Macros | Functions
macros.h File Reference
#include <cstddef>
#include <cassert>
#include <alloca.h>
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 __attribute(x)
 
#define RETURN_ZERO_NONGNU_ONLY   return 0;
 
#define ALIGN(x, a)   __ALIGN_MASK(x, (a - 1))
 
#define __ALIGN_MASK(x, mask)   (((x) + (mask)) & ~(mask))
 
#define PiVerify(x)   assert(x)
 
#define COUNTOF(array)   (sizeof(COUNTOF_Helper(array)))
 
#define stackalloc(T, n)   reinterpret_cast<T *>(alloca(sizeof(T) * n))
 

Functions

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

Macro Definition Documentation

◆ __ALIGN_MASK

#define __ALIGN_MASK (   x,
  mask 
)    (((x) + (mask)) & ~(mask))

◆ __attribute

#define __attribute (   x)

◆ ALIGN

#define ALIGN (   x,
 
)    __ALIGN_MASK(x, (a - 1))

◆ COUNTOF

#define COUNTOF (   array)    (sizeof(COUNTOF_Helper(array)))

◆ PiVerify

#define PiVerify (   x)    assert(x)

◆ RETURN_ZERO_NONGNU_ONLY

#define RETURN_ZERO_NONGNU_ONLY   return 0;

◆ stackalloc

#define stackalloc (   T,
 
)    reinterpret_cast<T *>(alloca(sizeof(T) * n))

Function Documentation

◆ COUNTOF_Helper()

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