MIRA
Platform.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 by
3  * MetraLabs GmbH (MLAB), GERMANY
4  * and
5  * Neuroinformatics and Cognitive Robotics Labs (NICR) at TU Ilmenau, GERMANY
6  * All rights reserved.
7  *
8  * Contact: info@mira-project.org
9  *
10  * Commercial Usage:
11  * Licensees holding valid commercial licenses may use this file in
12  * accordance with the commercial license agreement provided with the
13  * software or, alternatively, in accordance with the terms contained in
14  * a written agreement between you and MLAB or NICR.
15  *
16  * GNU General Public License Usage:
17  * Alternatively, this file may be used under the terms of the GNU
18  * General Public License version 3.0 as published by the Free Software
19  * Foundation and appearing in the file LICENSE.GPL3 included in the
20  * packaging of this file. Please review the following information to
21  * ensure the GNU General Public License version 3.0 requirements will be
22  * met: http://www.gnu.org/copyleft/gpl.html.
23  * Alternatively you may (at your option) use any later version of the GNU
24  * General Public License if such license has been publicly approved by
25  * MLAB and NICR (or its successors, if any).
26  *
27  * IN NO EVENT SHALL "MLAB" OR "NICR" BE LIABLE TO ANY PARTY FOR DIRECT,
28  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
29  * THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF "MLAB" OR
30  * "NICR" HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  * "MLAB" AND "NICR" SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
33  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
34  * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
35  * ON AN "AS IS" BASIS, AND "MLAB" AND "NICR" HAVE NO OBLIGATION TO
36  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS.
37  */
38 
47 #ifndef _MIRA_PLATFORM_H_
48 #define _MIRA_PLATFORM_H_
49 
51 
57 namespace mira {}
58 
60 
61 #undef MIRA_LINUX
62 #undef MIRA_WINDOWS
63 
64 // POSIX standard for gcc
65 #ifdef __linux__
66 # define MIRA_LINUX
67 #else
68 # define MIRA_WINDOWS
69 #endif
70 
71 // Architecture type
72 #if defined(__x86_64__) || defined(_M_X64)
73 /* x86 64-bit ----------------------------------------------- */
74 # define MIRA_ARCH64
75 # define MIRA_ARCH_X86
76 # define MIRA_ARCH_X86_64
77 #elif defined(__i386) || defined(_M_IX86)
78 /* x86 32-bit ----------------------------------------------- */
79 # define MIRA_ARCH32
80 # define MIRA_ARCH_X86
81 # define MIRA_ARCH_X86_32
82 #elif defined(__aarch64__)
83 /* ARM 64-bit ----------------------------------------------- */
84 # define MIRA_ARCH64
85 # define MIRA_ARCH_ARM
86 # define MIRA_ARCH_ARM_64
87 #elif defined(__arm__) || defined(_M_ARM)
88 /* ARM 32-bit ----------------------------------------------- */
89 # define MIRA_ARCH32
90 # define MIRA_ARCH_ARM
91 # define MIRA_ARCH_ARM_32
92 #endif
93 
94 // defines for FUNCTION macro
95 #ifdef MIRA_LINUX
96 # define MIRA_FUNCTION __PRETTY_FUNCTION__
97 #else
98 # define MIRA_FUNCTION __FUNCTION__
99 #endif
100 
101 #ifdef MIRA_LINUX
102 # define MIRA_DEFAULT_CONSTRUCTOR =default;
103 #else
104 # define MIRA_DEFAULT_CONSTRUCTOR {}
105 #endif
106 
107 // Some Windows specific settings
108 #ifdef MIRA_WINDOWS
109 # ifdef _MSC_VER
110 # // Disable some warnings in context of DLL exports/imports
111 # pragma warning(disable : 4251)
112 # pragma warning(disable : 4275)
113 #
114 # // Disable some more warnings on Windows
115 # pragma warning(disable : 4355)
116 #
117 # // Disable "conversion from 'size_t' to 'int', possible loss of data"
118 # pragma warning(disable : 4267)
119 # // Disable "conversion from '__int64' to 'int', possible loss of data"
120 # pragma warning(disable : 4244)
121 # endif
122 #
123 # ifndef WIN32_LEAN_AND_MEAN
124 # // Avoid include old or unusual used Windows heads (like old Winsock.h)
125 # define WIN32_LEAN_AND_MEAN 1
126 # endif
127 # include <windows.h>
128 #
129 #
130 # ifdef ERROR
131 # undef ERROR
132 # endif
133 #
134 #
135 # ifdef RGB
136 # undef RGB
137 # endif
138 #
139 #
140 #
141 #
142 # ifdef interface
143 # undef interface
144 # endif
145 #endif
146 
148 
149 #ifdef MIRA_WINDOWS
150 # ifdef MIRA_BASE_EXPORTS
151 # define MIRA_BASE_EXPORT __declspec(dllexport)
152 # else
153 # define MIRA_BASE_EXPORT __declspec(dllimport)
154 # endif
155 #else
156 # define MIRA_BASE_EXPORT
157 #endif
158 
160 
167 #if defined(__GNUC__)
168 # if defined(__GNUC_PATCHLEVEL__)
169 # define MIRA_GNUC_VERSION (__GNUC__ * 10000 \
170  + __GNUC_MINOR__ * 100 \
171  + __GNUC_PATCHLEVEL__)
172 # else
173 # define MIRA_GNUC_VERSION (__GNUC__ * 10000 \
174  + __GNUC_MINOR__ * 100)
175 # endif
176 #endif
177 
179 
186 #ifdef MIRA_WINDOWS
187 # define MIRA_DEPRECATED(text, decl) __declspec(deprecated(text)) decl
188 # define MIRA_DEPRECATED_CLASS(text) __declspec(deprecated(text))
189 #else
190 # if MIRA_GNUC_VERSION < 40500
191 # define MIRA_DEPRECATED(text, decl) __attribute__ ((deprecated)) decl
192 # define MIRA_DEPRECATED_CLASS(text) __attribute__ ((deprecated))
193 # else
194 # define MIRA_DEPRECATED(text, decl) __attribute__ ((deprecated(text))) decl
195 # define MIRA_DEPRECATED_CLASS(text) __attribute__ ((deprecated(text)))
196 # endif
197 #endif
198 
200 
201 #endif
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67