mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-10 07:12:03 +00:00
Rename HAVE_STRLCPY to SRB2_HAVE_STRLCPY, fix non-glibc compile
- Fix compile with msvcrt - Fix compile with SDL 2.28.2
This commit is contained in:
parent
c499a8387e
commit
0b55e8df7b
2 changed files with 9 additions and 5 deletions
|
@ -164,9 +164,13 @@ char *strcasestr(const char *in, const char *what);
|
||||||
#define HAVE_DOSSTR_FUNCS
|
#define HAVE_DOSSTR_FUNCS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// glibc 2.38: added strlcpy and strlcat to _DEFAULT_SOURCE
|
#if defined (__APPLE__)
|
||||||
#if defined (__APPLE__) || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 38)
|
#define SRB2_HAVE_STRLCPY
|
||||||
#define HAVE_STRLCPY
|
#elif defined (__GLIBC_PREREQ)
|
||||||
|
// glibc 2.38: added strlcpy and strlcat to _DEFAULT_SOURCE
|
||||||
|
#if __GLIBC_PREREQ(2, 38)
|
||||||
|
#define SRB2_HAVE_STRLCPY
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_DOSSTR_FUNCS
|
#ifndef HAVE_DOSSTR_FUNCS
|
||||||
|
@ -176,7 +180,7 @@ int strlwr(char *n); // from dosstr.c
|
||||||
|
|
||||||
#include <stddef.h> // for size_t
|
#include <stddef.h> // for size_t
|
||||||
|
|
||||||
#ifndef HAVE_STRLCPY
|
#ifndef SRB2_HAVE_STRLCPY
|
||||||
size_t strlcat(char *dst, const char *src, size_t siz);
|
size_t strlcat(char *dst, const char *src, size_t siz);
|
||||||
size_t strlcpy(char *dst, const char *src, size_t siz);
|
size_t strlcpy(char *dst, const char *src, size_t siz);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "doomdef.h"
|
#include "doomdef.h"
|
||||||
|
|
||||||
#ifndef HAVE_STRLCPY
|
#ifndef SRB2_HAVE_STRLCPY
|
||||||
|
|
||||||
// Like the OpenBSD version, but it doesn't check for src not being a valid
|
// Like the OpenBSD version, but it doesn't check for src not being a valid
|
||||||
// C string.
|
// C string.
|
||||||
|
|
Loading…
Reference in a new issue