Miam-Player  0.8.0
A nice music player
Alignment Macros

Macros

#define DECLARE_ALIGNED(n, t, v)    t v
 
#define DECLARE_ASM_CONST(n, t, v)    static const t v
 

Detailed Description

Helper macros for declaring aligned variables.

Macro Definition Documentation

#define DECLARE_ALIGNED (   n,
  t,
 
)    t v

Declare a variable that is aligned in memory.

DECLARE_ALIGNED(16, uint16_t, aligned_int) = 42;
DECLARE_ALIGNED(32, uint8_t, aligned_array)[128];
// The default-alignment equivalent would be
uint16_t aligned_int = 42;
uint8_t aligned_array[128];
Parameters
nMinimum alignment in bytes
tType of the variable (or array element)
vName of the variable
#define DECLARE_ASM_CONST (   n,
  t,
 
)    static const t v

Declare a static constant aligned variable appropriate for use in inline assembly code.

DECLARE_ASM_CONST(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008);
Parameters
nMinimum alignment in bytes
tType of the variable (or array element)
vName of the variable