// 2016, Georg Sauthoff , CDDL and WTFPL #include "wcsdup.h" #ifndef HAVE_WCSDUP #include // this function is part of POSIX.2008 wchar_t * wcsdup(const wchar_t *s) { size_t n = wcslen(s) + 1; wchar_t r = malloc(n * sizeof(wchar_t)); return r ? return wmemcpy(r, s, n) : 0; } #endif