aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/common/file_util.cpp
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner <yuriks@yuriks.net>2015-05-06 23:06:01 -0300
committerGravatar Yuri Kunde Schlesner <yuriks@yuriks.net>2015-05-07 15:45:20 -0300
commitf3c096951be57a02467bfda74ab539e69b2eff5e (patch)
tree831ce67740685915e075ef991b324d807987a055 /src/common/file_util.cpp
parentbf12f270b3c74f694c789a57cc69f414753ca080 (diff)
Common: Move IO-specific compatibility macros to file_util.cpp
Diffstat (limited to 'src/common/file_util.cpp')
-rw-r--r--src/common/file_util.cpp44
1 files changed, 26 insertions, 18 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index 25d7d4b9..946c4261 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -7,37 +7,45 @@
#include "common/file_util.h"
#ifdef _WIN32
-#include <windows.h>
-#include <shlobj.h> // for SHGetFolderPath
-#include <shellapi.h>
-#include <commdlg.h> // for GetSaveFileName
-#include <io.h>
-#include <direct.h> // getcwd
-#include <tchar.h>
+ #include <windows.h>
+ #include <shlobj.h> // for SHGetFolderPath
+ #include <shellapi.h>
+ #include <commdlg.h> // for GetSaveFileName
+ #include <io.h>
+ #include <direct.h> // getcwd
+ #include <tchar.h>
+
+ // 64 bit offsets for windows
+ #define fseeko _fseeki64
+ #define ftello _ftelli64
+ #define atoll _atoi64
+ #define stat64 _stat64
+ #define fstat64 _fstat64
+ #define fileno _fileno
#else
-#include <sys/param.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <pwd.h>
-#include <unistd.h>
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <dirent.h>
+ #include <pwd.h>
+ #include <unistd.h>
#endif
#if defined(__APPLE__)
-#include <CoreFoundation/CFString.h>
-#include <CoreFoundation/CFURL.h>
-#include <CoreFoundation/CFBundle.h>
+ #include <CoreFoundation/CFString.h>
+ #include <CoreFoundation/CFURL.h>
+ #include <CoreFoundation/CFBundle.h>
#endif
#include <algorithm>
#include <sys/stat.h>
#ifndef S_ISDIR
-#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
+ #define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
#endif
#ifdef BSD4_4
-#define stat64 stat
-#define fstat64 fstat
+ #define stat64 stat
+ #define fstat64 fstat
#endif
// This namespace has various generic functions related to files and paths.