#include <stdarg.h>
#include <float.h>
#include <time.h>
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__MINGW32__)
#include <sys/utime.h>
#else
#include <utime.h>
/* check to see if filename is a directory */
if (win32_stat(filename, &sbuf) < 0 || (sbuf.st_mode & S_IFDIR) == 0) {
- return NULL;
+ /* CRT is buggy on sharenames, so make sure it really isn't */
+ DWORD r = GetFileAttributes(filename);
+ if (r == 0xffffffff || !(r & FILE_ATTRIBUTE_DIRECTORY))
+ return NULL;
}
/* get the file system characteristics */
}
DllExport int
-win32_utime(const char *filename, const struct utimbuf *times)
+win32_utime(const char *filename, struct utimbuf *times)
{
HANDLE handle;
FILETIME ftCreate;
}
DllExport void
-win32_str_os_error(SV *sv, unsigned long dwErr)
+win32_str_os_error(void *sv, DWORD dwErr)
{
DWORD dwLen;
char *sMsg;
"Unknown error #0x%lX (lookup 0x%lX)",
dwErr, GetLastError());
}
- sv_setpvn(sv, sMsg, dwLen);
+ sv_setpvn((SV*)sv, sMsg, dwLen);
LocalFree(sMsg);
}