#include <limits.h>
#include "my_compiler.h"
#include "xcom/xcom.h"
#include <inttypes.h>
Go to the source code of this file.
◆ __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS |
◆ BSD_COMP
◆ idx_check_fail
#define idx_check_fail |
( |
|
x, |
|
|
|
limit |
|
) |
| |
Value: if (x < 0 || x >= limit) { \
g_critical("index out of range " #x " < 0 || " #x " >= " #limit " %s:%d", \
__FILE__, __LINE__); \
abort(); \
} else
◆ idx_check_ret
#define idx_check_ret |
( |
|
x, |
|
|
|
limit, |
|
|
|
ret |
|
) |
| |
Value: if (x < 0 || x >= limit) { \
g_critical("index out of range " #x " < 0 || " #x " >= " #limit " %s:%d", \
__FILE__, __LINE__); \
return ret; \
} else
◆ MAX
#define MAX |
( |
|
x, |
|
|
|
y |
|
) |
| ((x) > (y) ? (x) : (y)) |
◆ MIN
#define MIN |
( |
|
x, |
|
|
|
y |
|
) |
| ((x) < (y) ? (x) : (y)) |
◆ number_is_valid_port
#define number_is_valid_port |
( |
|
n | ) |
((n) > 0 && (n) <= (int)UINT16_MAX) |
◆ xcom_port