27 lines
478 B
C
27 lines
478 B
C
//---
|
|
// defs: Just generic definitions
|
|
//---
|
|
|
|
#ifndef DEFS_H
|
|
#define DEFS_H
|
|
|
|
/* uint type for bit fields */
|
|
typedef unsigned int uint;
|
|
|
|
/* min(), max(): But don't duplicate side-effects */
|
|
#define min(a, b) ({ \
|
|
__auto_type _a = (a); \
|
|
__auto_type _b = (b); \
|
|
_a < _b ? _a : _b; \
|
|
})
|
|
#define max(a, b) ({ \
|
|
__auto_type _a = (a); \
|
|
__auto_type _b = (b); \
|
|
_a > _b ? _a : _b; \
|
|
})
|
|
|
|
/* Attributes */
|
|
#define TEX_UNUSED __attribute__((unused))
|
|
|
|
#endif /* DEFS_H */
|