LibreOffice: sal/macros.h File Reference

LibreOffice LibreOffice 5.2 SDK C/C++ API Reference

Macros
macros.h File Reference
`#include <stddef.h>`

Go to the source code of this file.

## Macros
#define | SAL_N_ELEMENTS(arr) (sizeof (arr) / sizeof ((arr)[0]))
#define | SAL_BOUND(x, l, h) ((x) <= (l) ? (l) : ((x) >= (h) ? (h) : (x)))
#define | SAL_ABS(a) (((a) < 0) ? (-(a)) : (a))
#define | SAL_STRINGIFY_ARG(x) #x
#define | SAL_STRINGIFY(x) SAL_STRINGIFY_ARG(x)

## Macro Definition Documentation

## ◆ SAL_ABS

#define SAL_ABS | ( |  | a | ) | (((a) < 0) ? (-(a)) : (a))

## ◆ SAL_BOUND

#define SAL_BOUND | ( |  | x,
|  |  | l,
|  |  | h
| ) |  | ((x) <= (l) ? (l) : ((x) >= (h) ? (h) : (x)))

## ◆ SAL_N_ELEMENTS

#define SAL_N_ELEMENTS | ( |  | arr | ) | (sizeof (arr) / sizeof ((arr)[0]))

## ◆ SAL_STRINGIFY

#define SAL_STRINGIFY | ( |  | x | ) | SAL_STRINGIFY_ARG(x)

## ◆ SAL_STRINGIFY_ARG

#define SAL_STRINGIFY_ARG | ( |  | x | ) | #x