diff options
author | eray orçunus <erayorcunus@gmail.com> | 2020-05-11 19:10:01 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2020-05-11 19:10:01 +0200 |
commit | 36e2bc95d385c79075495d96e066d697727449d5 (patch) | |
tree | ea31257f477421dedf55decfd8bde8f478198d4a /src | |
parent | Linux build support (diff) | |
download | re3-36e2bc95d385c79075495d96e066d697727449d5.tar re3-36e2bc95d385c79075495d96e066d697727449d5.tar.gz re3-36e2bc95d385c79075495d96e066d697727449d5.tar.bz2 re3-36e2bc95d385c79075495d96e066d697727449d5.tar.lz re3-36e2bc95d385c79075495d96e066d697727449d5.tar.xz re3-36e2bc95d385c79075495d96e066d697727449d5.tar.zst re3-36e2bc95d385c79075495d96e066d697727449d5.zip |
Diffstat (limited to '')
-rw-r--r-- | src/save/GenericGameStorage.cpp | 1 | ||||
-rw-r--r-- | src/save/PCSave.cpp | 1 | ||||
-rw-r--r-- | src/skel/crossplatform.cpp | 5 | ||||
-rw-r--r-- | src/skel/crossplatform.h | 4 | ||||
-rw-r--r-- | src/skel/glfw/glfw.cpp | 2 | ||||
-rw-r--r-- | src/skel/win/win.cpp | 16 |
6 files changed, 18 insertions, 11 deletions
diff --git a/src/save/GenericGameStorage.cpp b/src/save/GenericGameStorage.cpp index d0cdb358..ba7bd216 100644 --- a/src/save/GenericGameStorage.cpp +++ b/src/save/GenericGameStorage.cpp @@ -1,3 +1,4 @@ +#define WITHWINDOWS #include "common.h" #include "crossplatform.h" #include "main.h" diff --git a/src/save/PCSave.cpp b/src/save/PCSave.cpp index 77d1ddce..3dc80f73 100644 --- a/src/save/PCSave.cpp +++ b/src/save/PCSave.cpp @@ -1,3 +1,4 @@ +#define WITHWINDOWS #include "common.h" #include "crossplatform.h" diff --git a/src/skel/crossplatform.cpp b/src/skel/crossplatform.cpp index 9971d2ae..40f4f053 100644 --- a/src/skel/crossplatform.cpp +++ b/src/skel/crossplatform.cpp @@ -1,6 +1,9 @@ #include "common.h" #include "crossplatform.h" +// Codes compatible with Windows and Linux +#ifndef _WIN32 + // For internal use // wMilliseconds is not needed void tmToSystemTime(const tm *tm, SYSTEMTIME *out) { @@ -18,6 +21,7 @@ void GetLocalTime_CP(SYSTEMTIME *out) { tm *localTm = localtime(×tamp); tmToSystemTime(localTm, out); } +#endif // Compatible with Linux/POSIX and MinGW on Windows #ifndef _WIN32 @@ -80,6 +84,7 @@ void FileTimeToSystemTime(time_t* writeTime, SYSTEMTIME* out) { } #endif +// Funcs/features from Windows that we need on other platforms #ifndef _WIN32 char *strupr(char *s) { char* tmp = s; diff --git a/src/skel/crossplatform.h b/src/skel/crossplatform.h index f6a3408b..a21877c1 100644 --- a/src/skel/crossplatform.h +++ b/src/skel/crossplatform.h @@ -82,7 +82,7 @@ RwBool IsForegroundApp(); #endif // Codes compatible with Windows and Linux -#if !defined _WIN32 +#ifndef _WIN32 #define DeleteFile unlink // Needed for save games @@ -103,7 +103,7 @@ void GetLocalTime_CP(SYSTEMTIME* out); #endif // Compatible with Linux/POSIX and MinGW on Windows -#if !defined _WIN32 +#ifndef _WIN32 #include <iostream> #include <dirent.h> #include <sys/types.h> diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp index b30bda7b..4a35adcf 100644 --- a/src/skel/glfw/glfw.cpp +++ b/src/skel/glfw/glfw.cpp @@ -66,7 +66,7 @@ static psGlobalType PsGlobal; #define JIF(x) if (FAILED(hr=(x))) \ {debug(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr); return;} -long _dwMemAvailPhys; +unsigned long _dwMemAvailPhys; RwUInt32 gGameState; #ifdef _WIN32 diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp index d20cc0bf..9a885818 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -100,10 +100,10 @@ IVideoWindow *pVW = nil; IMediaSeeking *pMS = nil; DWORD dwDXVersion; -DWORD _dwMemTotalPhys; -DWORD _dwMemAvailPhys; -DWORD _dwMemTotalVirtual; -DWORD _dwMemAvailVirtual; +SIZE_T _dwMemTotalPhys; +SIZE_T _dwMemAvailPhys; +SIZE_T _dwMemTotalVirtual; +SIZE_T _dwMemAvailVirtual; DWORD _dwMemTotalVideo; DWORD _dwMemAvailVideo; DWORD _dwOperatingSystemVersion; @@ -687,10 +687,10 @@ psInitialise(void) _GetVideoMemInfo(&_dwMemTotalVideo, &_dwMemAvailVideo); #ifdef FIX_BUGS - debug("Physical memory size %u\n", _dwMemTotalPhys); - debug("Available physical memory %u\n", _dwMemAvailPhys); - debug("Video memory size %u\n", _dwMemTotalVideo); - debug("Available video memory %u\n", _dwMemAvailVideo); + debug("Physical memory size %lu\n", _dwMemTotalPhys); + debug("Available physical memory %lu\n", _dwMemAvailPhys); + debug("Video memory size %lu\n", _dwMemTotalVideo); + debug("Available video memory %lu\n", _dwMemAvailVideo); #else debug("Physical memory size %d\n", _dwMemTotalPhys); debug("Available physical memory %d\n", _dwMemAvailPhys); |