From f2d5c6fe8c15d187315f9dade9c181b010cfd6d1 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Mon, 4 Dec 2023 16:52:45 +0100 Subject: [PATCH] compat: add compat.h header to get forward declarations --- src/compat/asprintf.c | 1 + src/compat/daemon.c | 1 + src/compat/getline.c | 1 + src/compat/malloc.c | 1 + src/compat/realloc.c | 1 + src/compat/setproctitle.c | 2 ++ src/compat/strlcpy.c | 1 + src/compat/strndup.c | 1 + src/compat/strnlen.c | 1 + src/compat/strtonum.c | 1 + 10 files changed, 11 insertions(+) diff --git a/src/compat/asprintf.c b/src/compat/asprintf.c index e92e0e91..58c5daef 100644 --- a/src/compat/asprintf.c +++ b/src/compat/asprintf.c @@ -22,6 +22,7 @@ #include #include #include +#include "compat.h" #define INIT_SZ 128 diff --git a/src/compat/daemon.c b/src/compat/daemon.c index 4452fd96..5b7f9804 100644 --- a/src/compat/daemon.c +++ b/src/compat/daemon.c @@ -34,6 +34,7 @@ #include #include #include +#include "compat.h" int daemon(int nochdir, int noclose) diff --git a/src/compat/getline.c b/src/compat/getline.c index beb2d7df..a3e6047a 100644 --- a/src/compat/getline.c +++ b/src/compat/getline.c @@ -36,6 +36,7 @@ #include #include #include +#include "compat.h" #define MINBUF 128 diff --git a/src/compat/malloc.c b/src/compat/malloc.c index 7930282b..0c8bb2c8 100644 --- a/src/compat/malloc.c +++ b/src/compat/malloc.c @@ -4,6 +4,7 @@ #undef malloc #include #include +#include "compat.h" /* Allocate an N-byte block of memory from the heap. If N is zero, allocate a 1-byte block. */ diff --git a/src/compat/realloc.c b/src/compat/realloc.c index c6aa351c..4d74064b 100644 --- a/src/compat/realloc.c +++ b/src/compat/realloc.c @@ -4,6 +4,7 @@ #undef realloc #include #include +#include "compat.h" /* Reallocate an N-byte block of memory from the heap. If N is zero, allocate a 1-byte block. */ diff --git a/src/compat/setproctitle.c b/src/compat/setproctitle.c index cc8e6384..c5e40ecf 100644 --- a/src/compat/setproctitle.c +++ b/src/compat/setproctitle.c @@ -1,5 +1,7 @@ /* -*- mode: c; c-file-style: "openbsd" -*- */ +#include "compat.h" + void setproctitle(const char *fmt, ...) { diff --git a/src/compat/strlcpy.c b/src/compat/strlcpy.c index 669b90e1..dda982f8 100644 --- a/src/compat/strlcpy.c +++ b/src/compat/strlcpy.c @@ -19,6 +19,7 @@ #include #include +#include "compat.h" /* * Copy src to string dst of size siz. At most siz-1 characters diff --git a/src/compat/strndup.c b/src/compat/strndup.c index bc5b8213..1db7069b 100644 --- a/src/compat/strndup.c +++ b/src/compat/strndup.c @@ -2,6 +2,7 @@ #include #include +#include "compat.h" /* * Similar to `strdup()` but copies at most n bytes. diff --git a/src/compat/strnlen.c b/src/compat/strnlen.c index 9da0fe57..07db4a44 100644 --- a/src/compat/strnlen.c +++ b/src/compat/strnlen.c @@ -1,6 +1,7 @@ /* -*- mode: c; c-file-style: "openbsd" -*- */ #include +#include "compat.h" /* * Determine the length of a fixed-size string. This is really a diff --git a/src/compat/strtonum.c b/src/compat/strtonum.c index 78aa8051..aed36b9f 100644 --- a/src/compat/strtonum.c +++ b/src/compat/strtonum.c @@ -22,6 +22,7 @@ #include #include #include +#include "compat.h" #define INVALID 1 #define TOOSMALL 2 -- 2.39.5