odyssey/shapito/macro.h

25 lines
459 B
C
Raw Normal View History

2017-07-06 11:41:06 +00:00
#ifndef SHAPITO_MACRO_H
#define SHAPITO_MACRO_H
2016-11-09 12:33:52 +00:00
/*
2017-07-06 11:44:19 +00:00
* Shapito.
2016-11-09 12:33:52 +00:00
*
2017-06-07 11:40:03 +00:00
* Protocol-level PostgreSQL client library.
2016-11-09 12:33:52 +00:00
*/
2017-07-10 13:59:38 +00:00
#define SHAPITO_API
#define shapito_likely(expr) \
__builtin_expect(!! (expr), 1)
#define shapito_unlikely(expr) \
__builtin_expect(!! (expr), 0)
#define shapito_packed \
__attribute__((packed))
#define shapito_container_of(ptr, type, field) \
((type*)((char*)(ptr) - __builtin_offsetof(type, field)))
2016-11-09 12:33:52 +00:00
2017-07-06 11:41:06 +00:00
#endif /* SHAPITO_MACRO_H */