2020-10-27 08:47:25 +00:00
|
|
|
|
|
|
|
#ifndef ODYSSEY_C_H
|
|
|
|
#define ODYSSEY_C_H
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Odyssey.
|
|
|
|
*
|
|
|
|
* Scalable PostgreSQL connection pooler.
|
|
|
|
*/
|
2020-11-23 09:13:28 +00:00
|
|
|
|
2020-10-27 08:47:25 +00:00
|
|
|
#include <stdarg.h>
|
2020-11-23 09:13:28 +00:00
|
|
|
#include <stdbool.h>
|
2020-11-25 10:17:15 +00:00
|
|
|
#include <stdint.h>
|
2020-10-27 08:47:25 +00:00
|
|
|
#include <stdio.h>
|
2020-11-25 10:17:15 +00:00
|
|
|
#include <stdlib.h>
|
2020-11-03 08:12:06 +00:00
|
|
|
|
2020-11-25 10:17:15 +00:00
|
|
|
#include <assert.h>
|
2020-10-27 08:47:25 +00:00
|
|
|
#include <ctype.h>
|
|
|
|
#include <inttypes.h>
|
2020-11-25 10:17:15 +00:00
|
|
|
#include <string.h>
|
2020-10-27 08:47:25 +00:00
|
|
|
|
2020-11-03 08:12:06 +00:00
|
|
|
#include <errno.h>
|
2020-11-25 10:17:15 +00:00
|
|
|
#include <signal.h>
|
2020-11-03 08:12:06 +00:00
|
|
|
|
|
|
|
#include <sys/resource.h>
|
2020-11-25 10:17:15 +00:00
|
|
|
#include <sys/time.h>
|
2020-11-27 18:03:42 +00:00
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/file.h>
|
|
|
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <syslog.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#include <pid.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <math.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
#ifdef USE_SSL
|
2020-12-28 10:43:31 +00:00
|
|
|
#include <openssl/rand.h>
|
|
|
|
#include <openssl/sha.h>
|
2020-11-27 18:03:42 +00:00
|
|
|
#endif
|
2020-11-25 10:17:15 +00:00
|
|
|
|
|
|
|
/* only GCC supports the unused attribute */
|
|
|
|
#ifdef __GNUC__
|
2020-12-28 10:43:31 +00:00
|
|
|
#define od_attribute_unused() __attribute__((unused))
|
2020-11-25 10:17:15 +00:00
|
|
|
#else
|
2020-12-28 10:43:31 +00:00
|
|
|
#define od_attribute_unused()
|
2020-11-25 10:17:15 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* GCC support aligned, packed and noreturn */
|
|
|
|
#ifdef __GNUC__
|
2020-12-28 10:43:31 +00:00
|
|
|
#define od_attribute_aligned(a) __attribute__((aligned(a)))
|
|
|
|
#define od_attribute_noreturn() __attribute__((noreturn))
|
|
|
|
#define od_attribute_packed() __attribute__((packed))
|
2020-11-25 10:17:15 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define FLEXIBLE_ARRAY_MEMBER /* empty */
|
|
|
|
|
|
|
|
#if defined __has_builtin
|
2020-12-28 10:43:31 +00:00
|
|
|
#if __has_builtin(__builtin_unreachable) /* odyssey unreachable code */
|
|
|
|
#define od_unreachable() __builtin_unreachable()
|
|
|
|
#endif
|
2020-11-25 10:17:15 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef od_unreachable
|
2020-12-28 10:43:31 +00:00
|
|
|
#define od_unreachable() abort()
|
2020-11-25 10:17:15 +00:00
|
|
|
#endif
|
2020-11-03 08:12:06 +00:00
|
|
|
|
2020-10-27 08:47:25 +00:00
|
|
|
#endif // ODYSSEY_C_H
|