aboutsummaryrefslogtreecommitdiff
path: root/compat.h
diff options
context:
space:
mode:
Diffstat (limited to 'compat.h')
-rw-r--r--compat.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/compat.h b/compat.h
index b213336f..13334ad7 100644
--- a/compat.h
+++ b/compat.h
@@ -27,6 +27,19 @@
#include <termios.h>
#include <wchar.h>
+#ifdef HAVE_EVENT2_EVENT_H
+#include <event2/event.h>
+#include <event2/event_compat.h>
+#include <event2/event_struct.h>
+#include <event2/buffer.h>
+#include <event2/buffer_compat.h>
+#include <event2/bufferevent.h>
+#include <event2/bufferevent_struct.h>
+#include <event2/bufferevent_compat.h>
+#else
+#include <event.h>
+#endif
+
#ifdef HAVE_MALLOC_TRIM
#include <malloc.h>
#endif
@@ -52,6 +65,9 @@
#ifndef __packed
#define __packed __attribute__ ((__packed__))
#endif
+#ifndef __weak
+#define __weak __attribute__ ((__weak__))
+#endif
#ifndef ECHOPRT
#define ECHOPRT 0
@@ -110,6 +126,10 @@ void warnx(const char *, ...);
#define pledge(s, p) (0)
#endif
+#ifndef IMAXBEL
+#define IMAXBEL 0
+#endif
+
#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
@@ -245,6 +265,13 @@ void warnx(const char *, ...);
#define HOST_NAME_MAX 255
#endif
+#ifndef CLOCK_REALTIME
+#define CLOCK_REALTIME 0
+#endif
+#ifndef CLOCK_MONOTONIC
+#define CLOCK_MONOTONIC CLOCK_REALTIME
+#endif
+
#ifndef HAVE_FLOCK
#define LOCK_SH 0
#define LOCK_EX 0
@@ -322,6 +349,11 @@ const char *getprogname(void);
void setproctitle(const char *, ...);
#endif
+#ifndef HAVE_CLOCK_GETTIME
+/* clock_gettime.c */
+int clock_gettime(int, struct timespec *);
+#endif
+
#ifndef HAVE_B64_NTOP
/* base64.c */
#undef b64_ntop
@@ -391,6 +423,11 @@ int utf8proc_mbtowc(wchar_t *, const char *, size_t);
int utf8proc_wctomb(char *, wchar_t);
#endif
+#ifdef NEED_FUZZING
+/* tmux.c */
+#define main __weak main
+#endif
+
/* getopt.c */
extern int BSDopterr;
extern int BSDoptind;