Base.h
1 //##################################################################################################
2 //
3 // Ceetron 3D Components
4 // Component: Core
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2011, Ceetron AS
8 // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
9 // not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
10 // without the prior written permission of Ceetron AS.
11 //##################################################################################################
12 
13 #pragma once
14 
15 
16 // Disable some annoying warnings so we can compile with warning level Wall
17 #ifdef WIN32
18 // 4512 'class' : assignment operator could not be generated : Due to problems with classes with reference member variables (e.g. VertexCompactor)
19 // 4514 unreferenced inline/local function has been removed
20 // 4625 copy constructor could not be generated because a base class copy constructor is inaccessible
21 // 4626 assignment operator could not be generated because a base class assignment operator is inaccessible
22 // 4640 'staticInstance' : construction of local static object is not thread-safe -> used by singletons. To be revisited.
23 // 4710 function 'func_name' not inlined
24 // 4711 function 'func_name' selected for automatic inline expansion
25 // 4738 storing 32-bit float result in memory, possible loss of performance
26 // 4820 'bytes' bytes padding added after construct 'member_name'
27 // 4986 'operator new[]': exception specification does not match previous declaration
28 #pragma warning (disable: 4512 4514 4625 4626 4640 4710 4711 4738 4820 4986)
29 #endif
30 
31 
32 #if !defined(WIN32)
33 // Used by int64_t on *nix below
34 #include <stdint.h>
35 #endif
36 
37 // Brings in size_t and definition of NULL
38 #include <cstddef>
39 
40 
41 // Define CEE_STATIC_LIBS when using of Ceetron 3D Components (DLL versions static linking is the default)
42 // To build a static linking version of this component, both CEE_STATIC_LIBS and CEE_CORE_BUILD_DLL_EXPORT must be defined.
43 #ifdef WIN32
44  #ifdef CEE_STATIC_LIBS
45  #define CEE_CORE_EXPORT
46  #else
47  #ifdef CEE_CORE_BUILD_DLL_EXPORT
48  #define CEE_CORE_EXPORT __declspec(dllexport)
49  #else
50  #define CEE_CORE_EXPORT __declspec(dllimport)
51  #endif
52  #endif // CEE_STATIC_LIBS
53 #else // WIN32
54  #define CEE_CORE_EXPORT
55 #endif //WIN32
56 
57 
58 
59 // Get rid of the the macros MIN and MAX which are specified in the windows headers
60 #if defined WIN32 && !defined NOMINMAX
61 #define NOMINMAX
62 #endif
63 
64 
65 // Macro to disallow copy constructor and assignment operator functions
66 // Should be placed in the class' private: section
67 #define CEE_DISALLOW_COPY_AND_ASSIGN(Class) \
68  Class(const Class&); \
69  void operator=(const Class&)
70 
71 // Macro for avoiding "unused parameter" warnings
72 // The bottom one is the best alternative, but unfortunately doesn't work on VS2010
73 #ifdef WIN32
74 #define CEE_UNUSED(EXPR) (void)(EXPR);
75 #else
76 #define CEE_UNUSED(EXPR) (void)sizeof(EXPR);
77 #endif
78 
79 // Makes it easier to check on the current GCC version
80 #ifdef __GNUC__
81 // 40302 means version 4.3.2.
82  # define CEE_GCC_VER (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
83 #endif
84 
85 // Introduce types and constants in the Ceetron 3D Components cee namespace
86 namespace cee {
87 
89 const int UNDEFINED_INT = 2147483647;
91 const size_t UNDEFINED_SIZE_T = static_cast<size_t>(-1); // 18446744073709551615u
93 const double UNDEFINED_DOUBLE = 1.7976931348623158e+308;
95 const double UNDEFINED_DOUBLE_THRESHOLD = 1.00e+308;
97 const float UNDEFINED_FLOAT = 3.402823466e+38f;
99 const double UNDEFINED_FLOAT_THRESHOLD = 2.99e+38f;
100 
101 } // namespace cee
102 
103 
104 
105 #include "CeeCore/Pimpl.h"
106 
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppLogging.cpp:20
const float UNDEFINED_FLOAT
Undefined value for float.
Definition: Base.h:97
const double UNDEFINED_FLOAT_THRESHOLD
Undefined threshold for float.
Definition: Base.h:99
const double UNDEFINED_DOUBLE_THRESHOLD
Undefined threshold for double.
Definition: Base.h:95
const size_t UNDEFINED_SIZE_T
Undefined value for size_t.
Definition: Base.h:91
const double UNDEFINED_DOUBLE
Undefined value for double.
Definition: Base.h:93
const int UNDEFINED_INT
Undefined value for int.
Definition: Base.h:89