From 72c46aa15e50ef6391ab3fe6e230ed3abc9485b0 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 9 Nov 2020 09:00:41 +0000 Subject: Add support for Haiku, from David Carlier. GitHub issue 2453. --- compat.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compat.h') diff --git a/compat.h b/compat.h index b213336f..ec125ced 100644 --- a/compat.h +++ b/compat.h @@ -110,6 +110,10 @@ void warnx(const char *, ...); #define pledge(s, p) (0) #endif +#ifndef IMAXBEL +#define IMAXBEL 0 +#endif + #ifdef HAVE_STDINT_H #include #else -- cgit From 3eb1519bd784076f63fed6678b88f918317a2124 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 9 Nov 2020 16:41:55 +0000 Subject: Scaffold for oss-fuzz, from Sergey Nizovtsev. --- compat.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'compat.h') diff --git a/compat.h b/compat.h index ec125ced..6e26a02c 100644 --- a/compat.h +++ b/compat.h @@ -52,6 +52,9 @@ #ifndef __packed #define __packed __attribute__ ((__packed__)) #endif +#ifndef __weak +#define __weak __attribute__ ((__weak__)) +#endif #ifndef ECHOPRT #define ECHOPRT 0 @@ -395,6 +398,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; -- cgit From a3011be0d267a090c8bfa01a4ebe093bc203a1c4 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sun, 17 Jan 2021 17:21:51 +0000 Subject: Look for libevent2 differently from libevent for platforms with both. --- compat.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'compat.h') diff --git a/compat.h b/compat.h index 6e26a02c..828c956d 100644 --- a/compat.h +++ b/compat.h @@ -27,6 +27,19 @@ #include #include +#ifdef HAVE_EVENT2_EVENT_H +#include +#include +#include +#include +#include +#include +#include +#include +#else +#include +#endif + #ifdef HAVE_MALLOC_TRIM #include #endif -- cgit From e3d71d9bdfa31fb658794759f07af43d53253e5f Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 5 Feb 2021 11:00:45 +0000 Subject: Add compat clock_gettime for older macOS. GitHub issue 2555. --- compat.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'compat.h') diff --git a/compat.h b/compat.h index 828c956d..13334ad7 100644 --- a/compat.h +++ b/compat.h @@ -265,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 @@ -342,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 -- cgit