diff --git a/calmwm.h b/calmwm.h index c2e0b90..e5fa2c8 100644 --- a/calmwm.h +++ b/calmwm.h @@ -21,11 +21,24 @@ #ifndef _CALMWM_H_ #define _CALMWM_H_ +#include +#include +#include "queue.h" + /* prototypes for portable-included functions */ char *fgetln(FILE *, size_t *); long long strtonum(const char *, long long, long long, const char **); -size_t strlcpy(char *, const char *, size_t); + +#ifdef strlcat +#define HAVE_STRLCAT +#else size_t strlcat(char *, const char *, size_t); +#endif +#ifdef strlcpy +#define HAVE_STRLCPY +#else +size_t strlcpy(char *, const char *, size_t); +#endif #include #include diff --git a/strlcat.c b/strlcat.c index 3702ead..6e28e87 100644 --- a/strlcat.c +++ b/strlcat.c @@ -18,10 +18,11 @@ /* OPENBSD ORIGINAL: lib/libc/string/strlcat.c */ -#ifndef HAVE_STRLCAT - #include #include +#include "calmwm.h" + +#ifndef HAVE_STRLCAT /* * Appends src to string dst of size siz (unlike strncat, siz is the diff --git a/strlcpy.c b/strlcpy.c index 9fef621..30a260c 100644 --- a/strlcpy.c +++ b/strlcpy.c @@ -18,10 +18,11 @@ /* OPENBSD ORIGINAL: lib/libc/string/strlcpy.c */ -#ifndef HAVE_STRLCPY - #include #include +#include "calmwm.h" + +#ifndef HAVE_STRLCPY /* * Copy src to string dst of size siz. At most siz-1 characters