|
@@ -56,49 +56,49 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
|
|
// and on: http://stackoverflow.com/questions/5919996/how-to-detect-reliably-mac-os-x-ios-linux-windows-in-c-preprocessor
|
|
// 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)
|
|
// TODO?: Should be moved to vstd\os_detect.h (and then included by Global.h)
|
|
#ifdef _WIN16 // Defined for 16-bit environments
|
|
#ifdef _WIN16 // Defined for 16-bit environments
|
|
- #error "16-bit Windows isn't supported"
|
|
|
|
|
|
+# error "16-bit Windows isn't supported"
|
|
#elif defined(_WIN64) // Defined for 64-bit environments
|
|
#elif defined(_WIN64) // Defined for 64-bit environments
|
|
- #define VCMI_WINDOWS
|
|
|
|
- #define VCMI_WINDOWS_64
|
|
|
|
|
|
+# define VCMI_WINDOWS
|
|
|
|
+# define VCMI_WINDOWS_64
|
|
#elif defined(_WIN32) // Defined for both 32-bit and 64-bit environments
|
|
#elif defined(_WIN32) // Defined for both 32-bit and 64-bit environments
|
|
- #define VCMI_WINDOWS
|
|
|
|
- #define VCMI_WINDOWS_32
|
|
|
|
|
|
+# define VCMI_WINDOWS
|
|
|
|
+# define VCMI_WINDOWS_32
|
|
#elif defined(_WIN32_WCE)
|
|
#elif defined(_WIN32_WCE)
|
|
- #error "Windows CE isn't supported"
|
|
|
|
|
|
+# error "Windows CE isn't supported"
|
|
#elif defined(__linux__) || defined(__gnu_linux__) || defined(linux) || defined(__linux)
|
|
#elif defined(__linux__) || defined(__gnu_linux__) || defined(linux) || defined(__linux)
|
|
- #define VCMI_UNIX
|
|
|
|
- #define VCMI_LINUX
|
|
|
|
- #ifdef __ANDROID__
|
|
|
|
- #define VCMI_ANDROID
|
|
|
|
- #endif
|
|
|
|
|
|
+# define VCMI_UNIX
|
|
|
|
+# define VCMI_LINUX
|
|
|
|
+# ifdef __ANDROID__
|
|
|
|
+# define VCMI_ANDROID
|
|
|
|
+# endif
|
|
#elif defined(__APPLE__) && defined(__MACH__)
|
|
#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
|
|
|
|
|
|
+# 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
|
|
#else
|
|
- #error "VCMI supports only Windows, OSX, Linux and Android targets"
|
|
|
|
|
|
+# error "VCMI supports only Windows, OSX, Linux and Android targets"
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#ifdef VCMI_IOS
|
|
#ifdef VCMI_IOS
|
|
- #error "iOS system isn't yet supported."
|
|
|
|
|
|
+# error "iOS system isn't yet supported."
|
|
#endif
|
|
#endif
|
|
|
|
|
|
/* ---------------------------------------------------------------------------- */
|
|
/* ---------------------------------------------------------------------------- */
|
|
/* Commonly used C++, Boost headers */
|
|
/* Commonly used C++, Boost headers */
|
|
/* ---------------------------------------------------------------------------- */
|
|
/* ---------------------------------------------------------------------------- */
|
|
#ifdef VCMI_WINDOWS
|
|
#ifdef VCMI_WINDOWS
|
|
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
|
|
|
-#define NOMINMAX // Exclude min/max macros from <Windows.h>
|
|
|
|
|
|
+# define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - delete this line if something is missing.
|
|
|
|
+# define NOMINMAX // Exclude min/max macros from <Windows.h>. Use std::[min/max] from <algorithm> instead.
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#define _USE_MATH_DEFINES
|
|
#define _USE_MATH_DEFINES
|
|
@@ -134,7 +134,7 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
|
|
|
|
|
|
#define BOOST_FILESYSTEM_VERSION 3
|
|
#define BOOST_FILESYSTEM_VERSION 3
|
|
#if BOOST_VERSION > 105000
|
|
#if BOOST_VERSION > 105000
|
|
-#define BOOST_THREAD_VERSION 3
|
|
|
|
|
|
+# define BOOST_THREAD_VERSION 3
|
|
#endif
|
|
#endif
|
|
#define BOOST_THREAD_DONT_PROVIDE_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE 1
|
|
#define BOOST_THREAD_DONT_PROVIDE_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE 1
|
|
#define BOOST_BIND_NO_PLACEHOLDERS
|
|
#define BOOST_BIND_NO_PLACEHOLDERS
|
|
@@ -199,28 +199,18 @@ typedef boost::lock_guard<boost::recursive_mutex> TLockGuardRec;
|
|
// Import + Export macro declarations
|
|
// Import + Export macro declarations
|
|
#ifdef VCMI_WINDOWS
|
|
#ifdef VCMI_WINDOWS
|
|
# ifdef __GNUC__
|
|
# ifdef __GNUC__
|
|
|
|
+# define DLL_IMPORT __attribute__((dllimport))
|
|
# define DLL_EXPORT __attribute__((dllexport))
|
|
# define DLL_EXPORT __attribute__((dllexport))
|
|
# else
|
|
# else
|
|
|
|
+# define DLL_IMPORT __declspec(dllimport)
|
|
# define DLL_EXPORT __declspec(dllexport)
|
|
# define DLL_EXPORT __declspec(dllexport)
|
|
# endif
|
|
# endif
|
|
# define ELF_VISIBILITY
|
|
# define ELF_VISIBILITY
|
|
#else
|
|
#else
|
|
# ifdef __GNUC__
|
|
# ifdef __GNUC__
|
|
|
|
+# define DLL_IMPORT __attribute__ ((visibility("default")))
|
|
# define DLL_EXPORT __attribute__ ((visibility("default")))
|
|
# define DLL_EXPORT __attribute__ ((visibility("default")))
|
|
# define ELF_VISIBILITY __attribute__ ((visibility("default")))
|
|
# define ELF_VISIBILITY __attribute__ ((visibility("default")))
|
|
-# endif
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
-#ifdef VCMI_WINDOWS
|
|
|
|
-# ifdef __GNUC__
|
|
|
|
-# define DLL_IMPORT __attribute__((dllimport))
|
|
|
|
-# else
|
|
|
|
-# define DLL_IMPORT __declspec(dllimport)
|
|
|
|
-# endif
|
|
|
|
-# define ELF_VISIBILITY
|
|
|
|
-#else
|
|
|
|
-# ifdef __GNUC__
|
|
|
|
-# define DLL_IMPORT __attribute__ ((visibility("default")))
|
|
|
|
# define ELF_VISIBILITY __attribute__ ((visibility("default")))
|
|
# define ELF_VISIBILITY __attribute__ ((visibility("default")))
|
|
# endif
|
|
# endif
|
|
#endif
|
|
#endif
|