30 #if !(_MSC_VER >= 1400) && !(_POSIX_C_SOURCE >= 200809L) \
31 && !defined(__MINGW32__)
35 size_t size = strlen(s) + 1;
36 char *dup = malloc(size);
39 return memcpy(dup, s, size);
43 #if !(_POSIX_C_SOURCE >= 200809L)
45 strndup(
const char *s,
size_t size)
47 size = strnlen(s, size);
48 char *dup = malloc(size + 1);
52 return memcpy(dup, s, size);
58 #if !(_MSC_VER >= 1400) && !(_POSIX_C_SOURCE >= 200809L) \
59 && !defined(__MINGW32__)
61 strnlen(
const char *s,
size_t maxlen)
64 while (size < maxlen && *s++)
This is the internal header file of the C11 and POSIX compatibility library.
This header file is part of the C11 and POSIX compatibility library; it includes <stdlib....
This header file is part of the C11 and POSIX compatibility library; it includes <string....