Use alternative function for realpath on Win32

This commit is contained in:
Akira TAGOH 2019-03-25 17:39:16 +09:00
parent b1bcc0cbb2
commit 8e2c85fe81
1 changed files with 9 additions and 0 deletions

View File

@ -87,7 +87,16 @@ FcConfigRealPath(const FcChar8 *path)
if (!path)
return NULL;
#ifndef _WIN32
resolved_ret = realpath((const char *) path, resolved_name);
#else
if (GetFullPathNameA ((LPCSTR) path, PATH_MAX, resolved_name, NULL) == 0)
{
fprintf (stderr, "Fontconfig warning: GetFullPathNameA failed.\n");
return NULL;
}
resolved_ret = resolved_name;
#endif
if (resolved_ret)
path = (FcChar8 *) resolved_ret;
return FcStrCopyFilename(path);