mirror of https://github.com/yandex/odyssey.git
30 lines
579 B
C
30 lines
579 B
C
#ifndef ODYSSEY_MACRO_H
|
|
#define ODYSSEY_MACRO_H
|
|
|
|
/*
|
|
* Odyssey.
|
|
*
|
|
* 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)))
|
|
|
|
#define OK_RESPONSE 0
|
|
#define NOT_OK_RESPONSE -1
|
|
|
|
#define _STRINGIFY(x) #x
|
|
#define STRINGIFY(x) _STRINGIFY(x)
|
|
#define CONCAT_(A, B) A##B
|
|
#define CONCAT(A, B) CONCAT_(A, B)
|
|
|
|
typedef int od_retcode_t;
|
|
|
|
/*misc*/
|
|
|
|
#define INVALID_COROUTINE_ID -1
|
|
|
|
#endif /* ODYSSEY_MACRO_H */
|