1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-01 19:25:12 +01:00

Synchronise definition guards with declarations for str utils

This commit is contained in:
Michał Janiszewski
2018-03-21 21:56:16 +01:00
committed by Michał Janiszewski
parent 9219f0b851
commit 7d67291910
2 changed files with 3 additions and 3 deletions

View File

@@ -49,7 +49,7 @@
static mach_timebase_info_data_t _mach_base_info = { 0 };
#endif
#if !((defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200809L) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 700))
#if !((defined (_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200809L) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 700) || (defined(__APPLE__) && defined(__MACH__)))
char * strndup(const char * src, size_t size)
{
size_t len = strnlen(src, size);
@@ -64,7 +64,7 @@ char * strndup(const char * src, size_t size)
dst[len] = '\0';
return dst;
}
#endif // !((defined (_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200809L) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 700))
#endif // !((defined (_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200809L) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 700) || (defined(__APPLE__) && defined(__MACH__)))
#ifdef _WIN32
static uint32 _frequency = 0;

View File

@@ -448,7 +448,7 @@ char *safe_strtrimleft(char *destination, const char *source, size_t size)
return safe_strcpy(destination, source, size);
}
#if !defined(_GNU_SOURCE)
#if !(defined(_GNU_SOURCE) || (defined(__DARWIN_C_LEVEL) && __DARWIN_C_LEVEL >= 200809L))
char * strcasestr(const char * haystack, const char * needle)
{
const char * p1 = haystack;