odyssey/src/so_macro.h

19 lines
351 B
C
Raw Normal View History

2016-11-09 12:33:52 +00:00
#ifndef SO_MACRO_H_
#define SO_MACRO_H_
/*
2017-06-07 11:37:42 +00:00
* SHAPITO
2016-11-09 12:33:52 +00:00
*
2017-06-07 11:37:42 +00:00
* Protocol-level PostgreSQL client library
2016-11-09 12:33:52 +00:00
*/
#define so_likely(e) __builtin_expect(!! (e), 1)
#define so_unlikely(e) __builtin_expect(!! (e), 0)
#define so_packed __attribute__((packed))
#define so_container_of(ptr, t, f) \
((t*)((char*)(ptr) - __builtin_offsetof(t, f)))
#endif