GS: fix unix compatibility

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2021-01-28 14:00:16 +01:00 committed by refractionpcsx2
parent 8bfe851446
commit 1cbd959ae8
3 changed files with 11 additions and 1 deletions

View File

@ -330,9 +330,9 @@ GSRendererType GSUtil::GetBestRenderer()
#endif
#ifdef _WIN32
void GSmkdir(const wchar_t* dir)
{
#ifdef _WIN32
if (!CreateDirectory(dir, nullptr)) {
DWORD errorID = ::GetLastError();
if (errorID != ERROR_ALREADY_EXISTS) {
@ -340,6 +340,8 @@ void GSmkdir(const wchar_t* dir)
}
}
#else
void GSmkdir(const char* dir)
{
int err = mkdir(dir, 0777);
if (!err && errno != EEXIST)
fprintf(stderr, "Failed to create directory: %s\n", dir);

View File

@ -52,7 +52,11 @@ public:
#endif
};
#ifdef _WIN32
void GSmkdir(const wchar_t* dir);
#else
void GSmkdir(const char* dir);
#endif
std::string GStempdir();
const char* psm_str(int psm);

View File

@ -49,7 +49,11 @@ public:
bool WriteIniString(const char* lpAppName, const char* lpKeyName, const char* pString, const char* lpFileName);
int GetIniInt(const char* lpAppName, const char* lpKeyName, int nDefault, const char* lpFileName);
#ifdef _WIN32
bool LoadResource(int id, std::vector<char>& buff, const wchar_t* type = nullptr);
#else
bool LoadResource(int id, std::vector<char>& buff, const char* type = nullptr);
#endif
void SetConfig(const char* entry, const char* value);
void SetConfig(const char* entry, int value);