@@ -20,10 +20,14 @@ #ifdef HAVE_DIRENT_H # include #endif #include "unistd_wrapper.h" + +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_PWD_H # include #endif #ifdef HAVE_GRP_H @@ -80,10 +84,18 @@ # define S_IWOTH 0 #endif #define DEFAULT_MODE S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH #define DIR_MODE DEFAULT_MODE | S_IXUSR | S_IXGRP | S_IXOTH + +#if defined(OF_WINDOWS) +typedef struct __stat64 of_stat_t; +#elif defined(OF_HAVE_OFF64_T) +typedef struct stat64 of_stat_t; +#else +typedef struct stat of_stat_t; +#endif static OFFileManager *defaultManager; #if defined(OF_HAVE_CHOWN) && defined(OF_HAVE_THREADS) static OFMutex *passwdMutex; @@ -94,11 +106,11 @@ #ifdef OF_WINDOWS static WINAPI BOOLEAN (*func_CreateSymbolicLinkW)(LPCWSTR, LPCWSTR, DWORD); #endif -int +static int of_stat(OFString *path, of_stat_t *buffer) { #if defined(OF_WINDOWS) return _wstat64([path UTF16String], buffer); #elif defined(OF_HAVE_OFF64_T) @@ -108,11 +120,11 @@ return stat([path cStringWithEncoding: [OFLocalization encoding]], buffer); #endif } -int +static int of_lstat(OFString *path, of_stat_t *buffer) { #if defined(OF_WINDOWS) return _wstat64([path UTF16String], buffer); #elif defined(HAVE_LSTAT)