summaryrefslogtreecommitdiff
path: root/src/common/file_util.cpp
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2015-05-06 23:06:01 -0300
committerGravatar Yuri Kunde Schlesner2015-05-07 15:45:20 -0300
commitf3c096951be57a02467bfda74ab539e69b2eff5e (patch)
tree831ce67740685915e075ef991b324d807987a055 /src/common/file_util.cpp
parentCommon: Remove many unnecessary cross-platform compatibility macros (diff)
downloadyuzu-f3c096951be57a02467bfda74ab539e69b2eff5e.tar.gz
yuzu-f3c096951be57a02467bfda74ab539e69b2eff5e.tar.xz
yuzu-f3c096951be57a02467bfda74ab539e69b2eff5e.zip
Common: Move IO-specific compatibility macros to file_util.cpp
Diffstat (limited to '')
-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 25d7d4b9f..946c4261a 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -7,37 +7,45 @@
7#include "common/file_util.h" 7#include "common/file_util.h"
8 8
9#ifdef _WIN32 9#ifdef _WIN32
10#include <windows.h> 10 #include <windows.h>
11#include <shlobj.h> // for SHGetFolderPath 11 #include <shlobj.h> // for SHGetFolderPath
12#include <shellapi.h> 12 #include <shellapi.h>
13#include <commdlg.h> // for GetSaveFileName 13 #include <commdlg.h> // for GetSaveFileName
14#include <io.h> 14 #include <io.h>
15#include <direct.h> // getcwd 15 #include <direct.h> // getcwd
16#include <tchar.h> 16 #include <tchar.h>
17
18 // 64 bit offsets for windows
19 #define fseeko _fseeki64
20 #define ftello _ftelli64
21 #define atoll _atoi64
22 #define stat64 _stat64
23 #define fstat64 _fstat64
24 #define fileno _fileno
17#else 25#else
18#include <sys/param.h> 26 #include <sys/param.h>
19#include <sys/types.h> 27 #include <sys/types.h>
20#include <dirent.h> 28 #include <dirent.h>
21#include <pwd.h> 29 #include <pwd.h>
22#include <unistd.h> 30 #include <unistd.h>
23#endif 31#endif
24 32
25#if defined(__APPLE__) 33#if defined(__APPLE__)
26#include <CoreFoundation/CFString.h> 34 #include <CoreFoundation/CFString.h>
27#include <CoreFoundation/CFURL.h> 35 #include <CoreFoundation/CFURL.h>
28#include <CoreFoundation/CFBundle.h> 36 #include <CoreFoundation/CFBundle.h>
29#endif 37#endif
30 38
31#include <algorithm> 39#include <algorithm>
32#include <sys/stat.h> 40#include <sys/stat.h>
33 41
34#ifndef S_ISDIR 42#ifndef S_ISDIR
35#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) 43 #define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
36#endif 44#endif
37 45
38#ifdef BSD4_4 46#ifdef BSD4_4
39#define stat64 stat 47 #define stat64 stat
40#define fstat64 fstat 48 #define fstat64 fstat
41#endif 49#endif
42 50
43// This namespace has various generic functions related to files and paths. 51// This namespace has various generic functions related to files and paths.