Some handy macros

This commit is contained in:
Jack Andersen 2016-04-03 16:26:47 -10:00
parent 34d3bd6724
commit 50406520ba
1 changed files with 4 additions and 0 deletions

View File

@ -66,10 +66,14 @@ typedef struct stat64 stat64_t;
#define BLOCKSZ 512 #define BLOCKSZ 512
#endif #endif
#define ROUND_UP_256(val) (((val) + 255) & ~255)
#define ROUND_UP_32(val) (((val) + 31) & ~31) #define ROUND_UP_32(val) (((val) + 31) & ~31)
#define ROUND_UP_16(val) (((val) + 15) & ~15) #define ROUND_UP_16(val) (((val) + 15) & ~15)
#define ROUND_UP_4(val) (((val) + 3) & ~3) #define ROUND_UP_4(val) (((val) + 3) & ~3)
#define _XSTR(s) _STR(s)
#define _STR(s) #s
#ifndef ENABLE_BITWISE_ENUM #ifndef ENABLE_BITWISE_ENUM
#define ENABLE_BITWISE_ENUM(type)\ #define ENABLE_BITWISE_ENUM(type)\
inline type operator|(type a, type b)\ inline type operator|(type a, type b)\