aboutsummaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-01-22 17:00:56 +0000
committerOmar Polo <op@omarpolo.com>2021-01-22 17:00:56 +0000
commit7e262563948fcaeea143e6c7c23b6a300010eec5 (patch)
tree32d92af278b34baa1f2043ae71b7d07131edad27 /compat
parent3527b7a58a5f228a73f73ba74bc4ff86f7305a60 (diff)
fixing compat compilation
include headers if needed and include config.h
Diffstat (limited to 'compat')
-rw-r--r--compat/err.c4
-rw-r--r--compat/explicit_bzero.c2
-rw-r--r--compat/getprogname.c2
-rw-r--r--compat/recallocarray.c6
-rw-r--r--compat/strlcat.c2
-rw-r--r--compat/strlcpy.c2
-rw-r--r--compat/strtonum.c3
-rw-r--r--compat/vasprintf.c2
8 files changed, 15 insertions, 8 deletions
diff --git a/compat/err.c b/compat/err.c
index aab93b5..dd07cf9 100644
--- a/compat/err.c
+++ b/compat/err.c
@@ -18,9 +18,7 @@
#include <stdio.h>
#include <stdarg.h>
-/* cheat: if we don't have getprogname in libc, we will link against
- * compat/getprogname.c anyway. */
-const char *getprogname(void);
+#include "../config.h"
static void vwarn_impl(const char*, va_list);
static void vwarnx_impl(const char*, va_list);
diff --git a/compat/explicit_bzero.c b/compat/explicit_bzero.c
index 674b8e2..f502b4b 100644
--- a/compat/explicit_bzero.c
+++ b/compat/explicit_bzero.c
@@ -5,6 +5,8 @@
#include <string.h>
+#include "../config.h"
+
void
explicit_bzero(void *buf, size_t len)
{
diff --git a/compat/getprogname.c b/compat/getprogname.c
index f162268..ee178b7 100644
--- a/compat/getprogname.c
+++ b/compat/getprogname.c
@@ -14,6 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "../config.h"
+
const char *
getprogname(void)
{
diff --git a/compat/recallocarray.c b/compat/recallocarray.c
index 1baffbb..70ad582 100644
--- a/compat/recallocarray.c
+++ b/compat/recallocarray.c
@@ -20,6 +20,8 @@
#include <string.h>
#include <unistd.h>
+#include "../config.h"
+
/*
* This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
* if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
@@ -34,10 +36,6 @@
*/
#define getpagesize() (1UL << 12)
-/* cheat: provide a prototype for explicit_bzero: if libc doesn't
- * provide it, we will link to compat/explicit_bzero.c anyway. */
-void explicit_bzero(void*, size_t);
-
void *
recallocarray(void *ptr, size_t oldnmemb, size_t newnmemb, size_t size)
{
diff --git a/compat/strlcat.c b/compat/strlcat.c
index 1c19062..b4e969e 100644
--- a/compat/strlcat.c
+++ b/compat/strlcat.c
@@ -17,6 +17,8 @@
#include <sys/types.h>
#include <string.h>
+#include "../config.h"
+
/*
* Appends src to string dst of size dsize (unlike strncat, dsize is the
* full size of dst, not space left). At most dsize-1 characters
diff --git a/compat/strlcpy.c b/compat/strlcpy.c
index 177ff72..75636a0 100644
--- a/compat/strlcpy.c
+++ b/compat/strlcpy.c
@@ -17,6 +17,8 @@
#include <sys/types.h>
#include <string.h>
+#include "../config.h"
+
/*
* Copy string src to buffer dst of size dsize. At most dsize-1
* chars will be copied. Always NUL terminates (unless dsize == 0).
diff --git a/compat/strtonum.c b/compat/strtonum.c
index 6e6cb76..09c4fbe 100644
--- a/compat/strtonum.c
+++ b/compat/strtonum.c
@@ -14,12 +14,13 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include "config.h"
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
+#include "../config.h"
+
#define INVALID 1
#define TOOSMALL 2
#define TOOLARGE 3
diff --git a/compat/vasprintf.c b/compat/vasprintf.c
index d76f3ef..69586f0 100644
--- a/compat/vasprintf.c
+++ b/compat/vasprintf.c
@@ -25,6 +25,8 @@
#include <stdio.h>
#include <stdlib.h>
+#include "../config.h"
+
int
vasprintf(char **ret, const char *format, va_list ap)
{