odyssey/sources/macro.h

16 lines
336 B
C
Raw Normal View History

#ifndef ODYSSEY_MACRO_H
#define ODYSSEY_MACRO_H
/*
2018-03-12 14:03:15 +00:00
* Odyssey.
*
2018-04-04 13:19:58 +00:00
* Scalable PostgreSQL connection pooler.
*/
#define od_likely(EXPR) __builtin_expect(!!(EXPR), 1)
#define od_unlikely(EXPR) __builtin_expect(!!(EXPR), 0)
#define od_container_of(N, T, F) ((T *)((char *)(N) - __builtin_offsetof(T, F)))
#endif /* ODYSSEY_MACRO_H */