摘自:https://developer.gnome.org/glib/stable/glib-Standard-Macros.html
#define G_IS_DIR_SEPARATOR(c) ((c) == G_DIR_SEPARATOR || (c) == '/')
Checks whether a character is a directory separator. It returns TRUE
for '/' on UNIX machines and for '\' or '/' under Windows.
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
Calculates the minimum of a
and b
.
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
Calculates the maximum of a
and b
.
#define ABS(a) (((a) < 0) ? -(a) : (a))
Calculates the absolute value of a
. The absolute value is simply the number with any negative sign taken away.
#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
Ensures that x
is between the limits set by low
and high
. If low
is greater than high
the result is undefined.
数据类型定义:[来自https://www.microchip.com/webdoc/AVRLibcReferenceManual/group__avr__stdint.html]
typedef signed char int8_t
typedef unsigned char uint8_t
typedef signed int int16_t
typedef unsigned int uint16_t
typedef signed long int int32_t
typedef unsigned long int uint32_t
typedef signed long long int int64_t
typedef unsigned long long int uint64_t