Herb C Reference
Loading...
Searching...
No Matches
macros.h
Go to the documentation of this file.
1#ifndef HERB_MACROS_H
2#define HERB_MACROS_H
3
4#ifndef HERB_EXPORTED_FUNCTION
5# ifdef HERB_EXPORT_SYMBOLS
6# define HERB_EXPORTED_FUNCTION __attribute__((__visibility__("default"))) extern
7# else
8# define HERB_EXPORTED_FUNCTION
9# endif
10#endif
11
12#define MAX(a, b) ((a) > (b) ? (a) : (b))
13
14#define MIN(a, b) ((a) < (b) ? (a) : (b))
15
16#define KB(kb) (1024 * (kb))
17
18#define MB(mb) (1024 * KB(mb))
19
20#define unlikely(x) __builtin_expect(!!(x), 0)
21
22#endif