28 #if !(_MSC_VER >= 1400) && !(_POSIX_C_SOURCE >= 200809L) \ 29 && !defined(__MINGW32__) 34 size_t size = strlen(s) + 1;
35 char *dup = malloc(size);
38 return memcpy(dup, s, size);
43 #if !(_POSIX_C_SOURCE >= 200809L) 46 strndup(
const char *s,
size_t size)
48 size = strnlen(s, size);
49 char *dup = malloc(size + 1);
53 return memcpy(dup, s, size);
58 #if !(_MSC_VER >= 1400) && !(_POSIX_C_SOURCE >= 200809L) \ 59 && !defined(__MINGW32__) 62 strnlen(
const char *s,
size_t maxlen)
65 while (size < maxlen && *s++)
This header file is part of the C11 and POSIX compatibility library; it includes <string.h> and defines any missing functionality.
This header file is part of the C11 and POSIX compatibility library; it includes <stdlib.h> and defines any missing functionality.
This is the internal header file of the C11 and POSIX compatibility library.