From 7ef816f50c558c51814114a2eeb9b04fa2db3ee4 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Tue, 16 Apr 2013 22:43:06 +0200 Subject: [PATCH] [DEV] base test for mac dev --- etk/os/FSNode.cpp | 66 +++++++++++++++++++++++++++++++---------------- etk/types.h | 5 +++- 2 files changed, 48 insertions(+), 23 deletions(-) diff --git a/etk/os/FSNode.cpp b/etk/os/FSNode.cpp index 486dc91..3ff0160 100644 --- a/etk/os/FSNode.cpp +++ b/etk/os/FSNode.cpp @@ -141,31 +141,53 @@ void etk::InitDefaultFolder(const char * applName) TK_DBG_MODE("Find Basic running PATH : \"" << baseRunPath << "\""); #ifndef __TARGET_OS__Android - - #ifdef MODE_RELEASE - baseFolderData = "/usr/share/"; + #ifdef __TARGET_OS__MacOs + #ifdef MODE_RELEASE + baseFolderData = "/usr/share/"; + #else + if (!getcwd(cCurrentPath, FILENAME_MAX)) { + baseFolderData = "."; + } else { + cCurrentPath[FILENAME_MAX - 1] = '\0'; + baseFolderData = cCurrentPath; + } + baseFolderData += "/out/MacOs/debug/staging/Resources/"; + #endif + + baseFolderDataUser = baseFolderHome; + baseFolderDataUser += "/.local/share/"; + baseFolderDataUser += baseApplName; + baseFolderDataUser += "/"; + + baseFolderCache = "/tmp/"; + baseFolderCache += baseApplName; + baseFolderCache += "/"; #else - if (!getcwd(cCurrentPath, FILENAME_MAX)) { - baseFolderData = "."; - } else { - cCurrentPath[FILENAME_MAX - 1] = '\0'; - baseFolderData = cCurrentPath; - } - baseFolderData += "/out/Linux/debug/staging/"; + #ifdef MODE_RELEASE + baseFolderData = "/usr/share/"; + #else + if (!getcwd(cCurrentPath, FILENAME_MAX)) { + baseFolderData = "."; + } else { + cCurrentPath[FILENAME_MAX - 1] = '\0'; + baseFolderData = cCurrentPath; + } + baseFolderData += "/out/Linux/debug/staging/"; + baseFolderData += baseApplName; + baseFolderData += "/usr/share/"; + #endif baseFolderData += baseApplName; - baseFolderData += "/usr/share/"; + baseFolderData += "/"; + + baseFolderDataUser = baseFolderHome; + baseFolderDataUser += "/.local/share/"; + baseFolderDataUser += baseApplName; + baseFolderDataUser += "/"; + + baseFolderCache = "/tmp/"; + baseFolderCache += baseApplName; + baseFolderCache += "/"; #endif - baseFolderData += baseApplName; - baseFolderData += "/"; - - baseFolderDataUser = baseFolderHome; - baseFolderDataUser += "/.local/share/"; - baseFolderDataUser += baseApplName; - baseFolderDataUser += "/"; - - baseFolderCache = "/tmp/"; - baseFolderCache += baseApplName; - baseFolderCache += "/"; #endif #ifdef MODE_RELEASE if (strncmp("ewolApplNoName",applName, 256) != 0) { diff --git a/etk/types.h b/etk/types.h index 0d022a0..af5bc62 100644 --- a/etk/types.h +++ b/etk/types.h @@ -15,7 +15,9 @@ #include #include - +#ifdef __TARGET_OS__MacOs +#include +#else #ifndef __int8_t_defined # define __int8_t_defined typedef signed char int8_t; @@ -35,6 +37,7 @@ typedef unsigned long long int uint64_t; # endif #endif +#endif typedef uint32_t uniChar_t;