First compile, Logger works

This commit is contained in:
Madthijs
2021-04-11 14:07:16 +02:00
parent 2234190f24
commit e6df94dac0
8 changed files with 122 additions and 9 deletions

View File

@@ -9,8 +9,13 @@
#include "PLDrivers.h"
#ifdef __MACOS__
#include <SDL.h>
#include <SDL_rwops.h>
#else
#include "SDL2/SDL.h"
#include "SDL2/SDL_rwops.h"
#endif
#include <string>
#include <vector>
@@ -22,7 +27,7 @@
#include "UTF8.h"
#ifdef __CYGWIN__
#if defined(__CYGWIN__) || defined(__MACOS__)
typedef off_t off64_t;
#define fstat64 fstat
#define fseek64 fseek
@@ -183,6 +188,9 @@ bool GpFileSystem_X::ResolvePath(PortabilityLayer::VirtualDirectory_t virtualDir
case PortabilityLayer::VirtualDirectories::kFontCache:
prefsAppend = "FontCache";
break;
case PortabilityLayer::VirtualDirectories::kLogs:
prefsAppend = "..";
break;
default:
return false;
};
@@ -289,6 +297,7 @@ GpIOStream *GpFileSystem_X::OpenFileNested(PortabilityLayer::VirtualDirectory_t
return nullptr;
std::string resolvedPath;
if (!ResolvePath(virtualDirectory, subPaths, numSubPaths, resolvedPath))
return nullptr;

View File

@@ -26,15 +26,17 @@ IGpDisplayDriver *GpDriver_CreateDisplayDriver_SDL_GL2(const GpDisplayDriverProp
IGpAudioDriver *GpDriver_CreateAudioDriver_SDL(const GpAudioDriverProperties &properties);
IGpInputDriver *GpDriver_CreateInputDriver_SDL2_Gamepad(const GpInputDriverProperties &properties);
#ifdef __MACOS__
int main(int argc, char *argv[])
#else
SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[])
#endif
{
GpLogDriver_X::Init();
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER) < 0)
return -1;
GpFileSystem_X::GetInstance()->Init();
GpLogDriver_X::Init();
IGpLogDriver *logger = GpLogDriver_X::GetInstance();
GpDriverCollection *drivers = GpAppInterface_Get()->PL_GetDriverCollection();

View File

@@ -2,7 +2,13 @@
#include "IGpClipboardContents.h"
#include "IGpThreadEvent.h"
#ifdef __MACOS__
#include <SDL.h>
#include <pthread.h>
#else
#include "SDL2/SDL.h"
#endif
#include <time.h>
#include <unistd.h>