Fix glibc 2.38 compile

glibc 2.38 added strlcpy and strlcat.
This commit is contained in:
James R committed 2023-08-03 16:45:34 -07:00
1 parent 20a5adde02
commit c499a8387e
2 files changed
+7 -2

No files matched your search

+6 -1
View File
@@ -164,6 +164,11 @@ char *strcasestr(const char *in, const char *what);
#define HAVE_DOSSTR_FUNCS
#endif
// glibc 2.38: added strlcpy and strlcat to _DEFAULT_SOURCE
#if defined (__APPLE__) || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 38)
#define HAVE_STRLCPY
#endif
#ifndef HAVE_DOSSTR_FUNCS
int strupr(char *n); // from dosstr.c
int strlwr(char *n); // from dosstr.c
@@ -171,7 +176,7 @@ int strlwr(char *n); // from dosstr.c
#include <stddef.h> // for size_t
#ifndef __APPLE__
#ifndef HAVE_STRLCPY
size_t strlcat(char *dst, const char *src, size_t siz);
size_t strlcpy(char *dst, const char *src, size_t siz);
#endif
+1 -1
View File
@@ -16,7 +16,7 @@
#include <string.h>
#include "doomdef.h"
#if !defined (__APPLE__)
#ifndef HAVE_STRLCPY
// Like the OpenBSD version, but it doesn't check for src not being a valid
// C string.