mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
VCMIDirs update #3
bfs = boost::filesystem; - Updateting filenames (std::string -> bfs::path) #1 - Added platform detection, and some specyfic boost::filesystem includes to Global.h - Updated CBasicLogConfigurator. Now class uses bfs::path pathes.
This commit is contained in:
53
Global.h
53
Global.h
@@ -49,6 +49,50 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
|
||||
# pragma warning (disable : 4800 ) /* disable conversion to bool warning -- I think it's intended in all places */
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/* System detection. */
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
// Based on: http://sourceforge.net/p/predef/wiki/OperatingSystems/
|
||||
// and on: http://stackoverflow.com/questions/5919996/how-to-detect-reliably-mac-os-x-ios-linux-windows-in-c-preprocessor
|
||||
// TODO?: Should be moved to vstd\os_detect.h (and then included by Global.h)
|
||||
#ifdef _WIN16 // Defined for 16-bit environments
|
||||
#error "16-bit Windows isn't supported"
|
||||
#elif defined(_WIN64) // Defined for 64-bit environments
|
||||
#define VCMI_WINDOWS
|
||||
#define VCMI_WINDOWS_64
|
||||
#elif defined(_WIN32) // Defined for both 32-bit and 64-bit environments
|
||||
#define VCMI_WINDOWS
|
||||
#define VCMI_WINDOWS_32
|
||||
#elif defined(_WIN32_WCE)
|
||||
#error "Windows CE isn't supported"
|
||||
#elif defined(__linux__) || defined(__gnu_linux__) || defined(linux) || defined(__linux)
|
||||
#define VCMI_UNIX
|
||||
#define VCMI_LINUX
|
||||
#ifdef __ANDROID__
|
||||
#define VCMI_ANDROID
|
||||
#endif
|
||||
#elif defined(__APPLE__) && defined(__MACH__)
|
||||
#define VCMI_UNIX
|
||||
#define VCMI_APPLE
|
||||
#include "TargetConditionals.h"
|
||||
#if TARGET_IPHONE_SIMULATOR
|
||||
#define VCMI_IOS
|
||||
#define VCMI_IOS_SIM
|
||||
#elif TARGET_OS_IPHONE
|
||||
#define VCMI_IOS
|
||||
#elif TARGET_OS_MAC
|
||||
#define VCMI_MAC
|
||||
#else
|
||||
//#warning "Unknown Apple target."?
|
||||
#endif
|
||||
#else
|
||||
#error "VCMI supports only Windows, OSX, Linux and Android targets"
|
||||
#endif
|
||||
|
||||
#ifdef VCMI_IOS
|
||||
#error "iOS system isn't yet supported."
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/* Commonly used C++, Boost headers */
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
@@ -99,6 +143,8 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#include <boost/date_time/posix_time/posix_time_io.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <boost/filesystem/fstream.hpp>
|
||||
#include <boost/format.hpp>
|
||||
#include <boost/functional/hash.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
@@ -112,13 +158,12 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
|
||||
#include <boost/variant.hpp>
|
||||
#include <boost/math/special_functions/round.hpp>
|
||||
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <android/log.h>
|
||||
#ifdef VCMI_ANDROID
|
||||
#include <android/log.h>
|
||||
#endif
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user