Prerequisites.h
Go to the documentation of this file.
1 /*
2 --------------------------------------------------------------------------------
3 This source file is part of SkyX.
4 Visit http://www.paradise-studios.net/products/skyx/
5 
6 Copyright (C) 2009-2012 Xavier Verguín González <xavyiy@gmail.com>
7 
8 This program is free software; you can redistribute it and/or modify it under
9 the terms of the GNU Lesser General Public License as published by the Free Software
10 Foundation; either version 2 of the License, or (at your option) any later
11 version.
12 
13 This program is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16 
17 You should have received a copy of the GNU Lesser General Public License along with
18 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20 http://www.gnu.org/copyleft/lesser.txt.
21 --------------------------------------------------------------------------------
22 */
23 
24 #ifndef _SkyX_Prerequisites_H_
25 #define _SkyX_Prerequisites_H_
26 #ifdef __clang__
27 #pragma clang diagnostic ignored "-W#warnings"
28 #endif // ifdef __clang__
29 
30 #ifdef _MSC_VER
31  // conversion from 'xxx' to 'yyy', possible loss of data
32  #pragma warning(disable:4244)
33  // 'this' : used in base member initializer list
34  #pragma warning(disable:4355)
35 #endif
36 
38 #include <OGRE/Ogre.h>
39 
41 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
42  #ifdef SKYX_LIB
43  #define DllExport __declspec (dllexport)
44  #else
45  #define DllExport __declspec (dllimport)
46  #endif
47 #else
48  #if __GNUC__ >= 4
49  #define DllExport __attribute__ ((visibility ("default")))
50  #else
51  #define DllExport
52  #endif
53 #endif
54 
56 #define SkyXLOG(msg) Ogre::LogManager::getSingleton().logMessage("[SkyX] " + \
57  Ogre::String(msg));
58 
60 #define SKYX_VERSION_MAJOR 0
61 #define SKYX_VERSION_MINOR 3
62 #define SKYX_VERSION_PATCH 1
63 
64 #define SKYX_RESOURCE_GROUP "SkyX"
65 
66 template<typename T>
67 inline bool equal(const T &_a, const T &_b, const T &_epsilon = 1e-3)
68 {
69  return std::fabs(_a - _b) <= _epsilon;
70 }
71 
72 #endif
bool equal(const T &_a, const T &_b, const T &_epsilon=1e-3)
Definition: Prerequisites.h:67