Serious-Engine/Sources/Engine/Base/Base.h

88 lines
2.6 KiB
C
Raw Normal View History

2016-03-12 01:20:51 +01:00
/* Copyright (c) 2002-2012 Croteam Ltd.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as published by
the Free Software Foundation
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
2016-03-11 14:57:17 +01:00
#ifndef SE_INCL_ENGINE_BASE_BASE_H
#define SE_INCL_ENGINE_BASE_BASE_H
2016-03-11 14:57:17 +01:00
/*
* rcg10042001 In case these don't get defined in the project file, try to
* catch them here...
*/
// be a little more discerning, using these macros will ensure that if someone
// wants to use MINGW then they can
#if (defined _WIN32) || (defined _WIN64)
2016-03-11 14:57:17 +01:00
#ifndef PLATFORM_WIN32
#define PLATFORM_WIN32 1
2016-03-11 14:57:17 +01:00
#endif
#ifndef PRAGMA_ONCE
#define PRAGMA_ONCE
#endif
// disable problematic warnings
#pragma warning(disable: 4251) // dll interfacing problems
#pragma warning(disable: 4275) // dll interfacing problems
#pragma warning(disable: 4018) // signed/unsigned mismatch
#pragma warning(disable: 4244) // type conversion warnings
#pragma warning(disable: 4284) // using -> for UDT
#pragma warning(disable: 4355) // 'this' : used in base member initializer list
#pragma warning(disable: 4660) // template-class specialization is already instantiated
#pragma warning(disable: 4723) // potential divide by 0
// define engine api exporting declaration specifiers
#ifdef ENGINE_EXPORTS
#define ENGINE_API __declspec(dllexport)
#else
#define ENGINE_API __declspec(dllimport)
#ifdef NDEBUG
#pragma comment(lib, "Engine.lib")
#else
#pragma comment(lib, "EngineD.lib")
#endif
#endif
#elif (defined __linux__)
#if (defined __ANDROID__) || (defined __android__)
#error "Android current isn't supported"
#else
#define PLATFORM_LINUX 1
#endif
#elif (defined __APPLE__)
#include "TargetConditionals.h"
#if TARGET_OS_MAC
#define PLATFORM_MACOSX 1
#else
#error "Unsupported apple platform"
#endif
#else
#warning "UNKNOWN PLATFORM IDENTIFIED!!!!"
#define PLATFORM_UNKNOWN 1
#warning "USING PORTABLE C!!!"
#define USE_PORTABLE_C
#endif
2016-03-11 14:57:17 +01:00
#if PLATFORM_LINUX || PLATFORM_MACOSX
#ifndef PLATFORM_UNIX
#define PLATFORM_UNIX 1
#endif
#endif
2016-03-11 14:57:17 +01:00
#ifdef PLATFORM_UNIX /* rcg10042001 */
#define ENGINE_API
#endif
#endif