Loading...
--- Libc/Libc-825.25/include/secure/_string.h
+++ Libc/Libc-583/include/secure/_string.h
@@ -33,22 +33,19 @@
#if _USE_FORTIFY_LEVEL > 0
-/* memcpy, mempcpy, memmove, memset, strcpy, stpcpy, strncpy, stpncpy,
- strcat, and strncat */
+/* memcpy, mempcpy, memmove, memset, strcpy, stpcpy, strncpy, strcat
+ and strncat */
#undef memcpy
#undef memmove
#undef memset
#undef strcpy
-#if __DARWIN_C_LEVEL >= 200809L
+#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#undef stpcpy
-#undef stpncpy
-#endif
+#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
#undef strncpy
#undef strcat
-#if ! (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 32000)
#undef strncat
-#endif
#define memcpy(dest, src, len) \
((__darwin_obsz0 (dest) != (size_t) -1) \
@@ -94,7 +91,7 @@
return __builtin___strcpy_chk (__dest, __src, __darwin_obsz(__dest));
}
-#if __DARWIN_C_LEVEL >= 200809L
+#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define stpcpy(dest, src) \
((__darwin_obsz0 (dest) != (size_t) -1) \
? __builtin___stpcpy_chk (dest, src, __darwin_obsz (dest)) \
@@ -105,19 +102,7 @@
{
return __builtin___stpcpy_chk (__dest, __src, __darwin_obsz(__dest));
}
-
-#define stpncpy(dest, src, len) \
- ((__darwin_obsz0 (dest) != (size_t) -1) \
- ? __builtin___stpncpy_chk (dest, src, len, __darwin_obsz (dest)) \
- : __inline_stpncpy_chk (dest, src, len))
-
-static __inline char *
-__inline_stpncpy_chk (char *__restrict __dest, const char *__restrict __src,
- size_t __len)
-{
- return __builtin___stpncpy_chk (__dest, __src, __len, __darwin_obsz(__dest));
-}
-#endif
+#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
#define strncpy(dest, src, len) \
((__darwin_obsz0 (dest) != (size_t) -1) \
@@ -142,7 +127,6 @@
return __builtin___strcat_chk (__dest, __src, __darwin_obsz(__dest));
}
-#if ! (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 32000)
#define strncat(dest, src, len) \
((__darwin_obsz0 (dest) != (size_t) -1) \
? __builtin___strncat_chk (dest, src, len, __darwin_obsz (dest)) \
@@ -154,7 +138,6 @@
{
return __builtin___strncat_chk (__dest, __src, __len, __darwin_obsz(__dest));
}
-#endif
#endif
#endif