static void setdate (const TCHAR *src, __time64_t tm) { struct utimbuf ut; if (tm) { ut.actime = ut.modtime = tm; _wutime64 (src, &ut); } }
int flac_internal_utime_utf8(const char *filename, struct utimbuf *times) { if (!utf8_filenames) { return utime(filename, times); } else { wchar_t *wname; struct __utimbuf64 ut; int ret; if (!(wname = wchar_from_utf8(filename))) return -1; ut.actime = times->actime; ut.modtime = times->modtime; ret = _wutime64(wname, &ut); free(wname); return ret; } }
int utime_utf8(const char *filename, struct utimbuf *times) { wchar_t *wname; struct __utimbuf64 ut; int ret; if (sizeof(*times) == sizeof(ut)) { memcpy(&ut, times, sizeof(ut)); } else { ut.actime = times->actime; ut.modtime = times->modtime; } if (!(wname = wchar_from_utf8(filename))) return -1; ret = _wutime64(wname, &ut); free(wname); return ret; }