mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-01 16:13:23 +00:00
Merge pull request #1044 from joshslark/master
Some fixes to allow compilation on linux
This commit is contained in:
commit
0b4105915a
@ -27,6 +27,7 @@ __Windows__
|
||||
|
||||
__Linux__
|
||||
* Debian & Ubuntu: `sudo apt-get install libopenal-dev libwxgtk3.0-dev build-essential libglew-dev`
|
||||
* Arch: `sudo pacman -S glew openal wxgtk cmake llvm`
|
||||
|
||||
__Mac OSX__
|
||||
* Install with Homebrew: `brew install glew wxwidgets`
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <wx/file.h>
|
||||
#include <wx/filename.h>
|
||||
#include "rFile.h"
|
||||
#include "errno.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
@ -25,7 +26,7 @@ std::wstring ConvertUTF8ToWString(const std::string &source) {
|
||||
#ifdef _WIN32
|
||||
#define GET_API_ERROR GetLastError()
|
||||
#else
|
||||
#define GET_API_ERROR err
|
||||
#define GET_API_ERROR errno
|
||||
#endif
|
||||
|
||||
bool getFileInfo(const char *path, FileInfo *fileInfo) {
|
||||
@ -112,7 +113,7 @@ bool rRmdir(const std::string &dir)
|
||||
#ifdef _WIN32
|
||||
if (!RemoveDirectory(ConvertUTF8ToWString(dir).c_str()))
|
||||
#else
|
||||
if (int err = rmdir(dir.c_str()))
|
||||
if (rmdir(dir.c_str()))
|
||||
#endif
|
||||
{
|
||||
LOG_ERROR(GENERAL, "Error deleting directory %s: 0x%llx", dir.c_str(), (u64)GET_API_ERROR);
|
||||
@ -152,7 +153,7 @@ bool rRemoveFile(const std::string &file)
|
||||
#ifdef _WIN32
|
||||
if (!DeleteFile(ConvertUTF8ToWString(file).c_str()))
|
||||
#else
|
||||
if (int err = unlink(file.c_str()))
|
||||
if (unlink(file.c_str()))
|
||||
#endif
|
||||
{
|
||||
LOG_ERROR(GENERAL, "Error deleting file %s: 0x%llx", file.c_str(), (u64)GET_API_ERROR);
|
||||
|
@ -45,6 +45,7 @@ endif()
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
#on some Linux distros shm_unlink and similar functions are in librt only
|
||||
set(ADDITIONAL_LIBS "rt")
|
||||
set(ADDITIONAL_LIBS "X11")
|
||||
elseif(UNIX)
|
||||
#it seems like glibc includes the iconv functions we use but other libc
|
||||
#implementations like the one on OSX don't seem implement them
|
||||
|
Loading…
x
Reference in New Issue
Block a user