diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-01-01 17:14:26 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-01-01 17:14:26 +0000 |
commit | 73aca81b50073109b137bba659d38af11d7194ac (patch) | |
tree | db3b28024b3493b57e793eb072a69c9da331b8da /compat.c | |
parent | 9702d475f59435139db2b0794a26dd69937fab7c (diff) | |
download | mandoc-73aca81b50073109b137bba659d38af11d7194ac.tar.gz mandoc-73aca81b50073109b137bba659d38af11d7194ac.tar.zst mandoc-73aca81b50073109b137bba659d38af11d7194ac.zip |
Big check-in of compatibility layer. This should work on most major architectures. Thanks to Joerg Sonnenberger.
Diffstat (limited to 'compat.c')
-rw-r--r-- | compat.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -15,12 +15,16 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include <sys/types.h> #include <string.h> -#ifdef __linux__ +int dummy; /* To prevent an empty object file */ +#ifndef HAVE_STRLCAT /* * Appends src to string dst of size siz (unlike strncat, siz is the * full size of dst, not space left). At most siz-1 characters @@ -55,7 +59,9 @@ strlcat(char *dst, const char *src, size_t siz) return(dlen + (s - src)); /* count does not include NUL */ } +#endif +#ifndef HAVE_STRLCPY /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). @@ -86,5 +92,4 @@ strlcpy(char *dst, const char *src, size_t siz) return(s - src - 1); /* count does not include NUL */ } - #endif |