You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
413 B
16 lines
413 B
#ifndef _FUNCTIONS_H_
|
|
#define _FUNCTIONS_H_
|
|
|
|
#define ROUNDUP(a, b) ((((a)-1) / (b) + 1) * (b))
|
|
#define ROUNDDOWN(a, b) ((a) / (b) * (b))
|
|
|
|
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
|
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
|
#define likely(x) __builtin_expect((x), 1)
|
|
#define unlikely(x) __builtin_expect((x), 0)
|
|
|
|
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
|
|
|
char* safestrcpy(char*, const char*, int);
|
|
|
|
#endif |