defines.hh
Go to the documentation of this file.
1 /* -*- mia-c++ -*-
2  *
3  * This file is part of MIA - a toolbox for medical image analysis
4  * Copyright (c) Leipzig, Madrid 1999-2013 Gert Wollny
5  *
6  * MIA is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with MIA; if not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
27 #ifndef mia_core_defines_hh
28 #define mia_core_defines_hh
29 
30 #include <gsl++/gsldefines.hh>
31 #include <tbb/mutex.h>
32 
33 
35 typedef tbb::mutex CMutex;
36 
37 
39 typedef tbb::mutex::scoped_lock CScopedLock;
40 
41 
43 #define NS_MIA_BEGIN namespace mia {
44 
46 #define NS_MIA_END }
47 
49 #define NS_MIA_USE using namespace mia;
50 
52 #define NS_BEGIN(NS) namespace NS {
53 
55 #define NS_END }
56 
58 #define NS_USE(NS) using namespace NS
59 
60 
61 /*
62 
63  The mia namespace is the general namespace of this library.
64  Currently, only plug-ins have additional namespace to avoid name clashes
65  between dynamically loaded modules that might have been developed outside
66  this source package.
67 */
69 
82 };
83 
88 };
89 
91 
93 #define MIA_MODULE_SUFFIX "mia"
94 
95 #ifndef __GNUC__
96 // remove the __attribute__ syntax if the compiler is not GCC compatible
97 # define __attribute__(x)
98 # define MIA_PARAM_UNUSED(x) x
99 #endif
100 
101 #ifndef MIA_PARAM_UNUSED
102 #define MIA_PARAM_UNUSED(x) x __attribute__((unused))
103 #endif
104 
105 
106 #ifdef miacore_EXPORTS
107 # define EXPORT_CORE DO_EXPORT
109 #else
110 # define EXPORT_CORE DO_IMPORT
112 #endif
113 
115 #define EXPORT DO_EXPORT
116 
117 #ifdef WIN32
118 #ifdef _DEBUG
119 #define _CRTDBG_MAP_ALLOC
120 #include <stdlib.h>
121 #include <crtdbg.h>
122 #endif
123 
124 #ifdef _MSC_VER
125 #pragma warning(disable: 4251) // class needs to have dll interface to be used ...
126 #pragma warning(disable: 4231) // nonstandard extension used "extern" before explicit template instanciation
127 #pragma warning(disable: 4275) // non-dll class used as base
128 #pragma warning(disable: 4244) // warning about int->float conversion
129 #pragma warning(disable: 4305) // truncation from double to float
130 #pragma warning(disable: 4800) // performance warning about forcing value to true or false
131 #endif
132 #endif
133 
134 #ifdef miacore_EXPORTS
135 # ifdef VSTREAM
136 # undef VSTREAM
137 # endif
138 # define VSTREAM "MIA-CORE"
139 #endif
140 
141 #endif
142