GenApi  3.5.1
GCTypes.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // (c) 2004 by Basler Vision Technologies
3 //
4 // License: This file is published under the license of the EMVA GenICam Standard Group.
5 // A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'.
6 // If for some reason you are missing this file please contact the EMVA or visit the website
7 // (http://www.genicam.org) for a full copy.
8 //
9 // THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
10 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
11 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
12 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP
13 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
14 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
15 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
16 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
17 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
18 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
19 // POSSIBILITY OF SUCH DAMAGE.
20 //
21 //
22 // Contributors:
23 //
24 // Copyright(C) 2005: STEMMER IMAGING
25 //
26 //-----------------------------------------------------------------------------
30 
31 
32 #ifndef GENICAM_TYPES_H
33 #define GENICAM_TYPES_H
34 
35 #include <Base/GCNamespace.h>
36 
37 // Make sure WIN32 is defined if the toolchain does not already do it.
38 #if defined (_WIN32) && !defined(WIN32)
39 # define WIN32
40 #endif
41 
42 #if !defined (_WIN32)
43 
44 # ifndef __STDC_LIMIT_MACROS
45 # define __STDC_LIMIT_MACROS
46 # endif
47 
48 # ifndef __STDC_CONSTANT_MACROS
49 # define __STDC_CONSTANT_MACROS
50 # endif
51 
52 # include <stddef.h>
53 #ifndef VXWORKS
54 # include <inttypes.h>
55 #endif
56 # include <stdint.h>
57 
58 #elif defined (_WIN32)
59 
62 
63 // tag to perform 64 compatibility warnings checks on a type
64 # if !defined(GC_W64)
65 # if defined(_M_IX86) && _MSC_VER >= 1300
66 # define GC_W64 __w64
67 # else
68 # define GC_W64
69 # endif
70 # endif
71 
72 # if defined(_MSC_VER) && _MSC_VER >= 1600
73  // VS2010 provides stdint.h
74 # include <stdint.h>
75 # else
76 # ifndef _STDINT // only define if not already done
77 
79  typedef char int8_t;
81  typedef unsigned char uint8_t;
82 
84  typedef short int16_t;
86  typedef unsigned short uint16_t;
87 
89  typedef __int32 int32_t;
91  typedef unsigned __int32 uint32_t;
92 
94  typedef __int64 int64_t;
96  typedef unsigned __int64 uint64_t;
97 
98 # endif // _STDINT
99 # endif // _MSC_VER >= 1600
100 
101  // Deprecated, use int8_t instead
102  // typedef char char8_t;
103 
104  // Deprecated, use uint8_t instead
105  // typedef unsigned char uchar8_t;
106 
108  typedef __int64 int_t;
110  typedef unsigned __int64 uint_t;
111 
112 # ifndef _SIZE_T_DEFINED
113 # ifdef _WIN64
114  typedef unsigned __int64 size_t;
116 # else
117  typedef GC_W64 unsigned int size_t;
119 # endif
120 # define _SIZE_T_DEFINED
121 # endif
122 
123 # ifndef _INTPTR_T_DEFINED
124 # ifdef _WIN64
125  typedef __int64 intptr_t;
127 # else
128  typedef GC_W64 int intptr_t;
130 # endif
131 # define _INTPTR_T_DEFINED
132 # endif
133 
134 # ifndef _UINTPTR_T_DEFINED
135 # ifdef _WIN64
136  typedef unsigned __int64 uintptr_t;
138 # else
139  typedef GC_W64 unsigned int uintptr_t;
141 # endif
142 # define _UINTPTR_T_DEFINED
143 # endif
144 
145 #else
146 # error No platform-specific type definitions
147 #endif /* __unix__ */
148 
149 // \}
150 
151 
152 #ifndef GC_INT64_MAX
153 #ifdef INT64_MAX
154 # define GC_INT64_MAX INT64_MAX
155 #else
156 # define GC_INT64_MAX static_cast<int64_t>(0x7fffffffffffffffLL) /* maximum signed int64 value */
157 #endif
158 #endif // GC_INT64_MAX
159 
160 #ifndef GC_INT64_MIN
161 #ifdef INT64_MIN
162 # define GC_INT64_MIN INT64_MIN
163 #else
164 # define GC_INT64_MIN static_cast<int64_t>(0x8000000000000000LL) /* minimum signed int64 value */
165 #endif
166 #endif // GC_INT64_MIN
167 
168 #ifndef GC_UINT64_MAX
169 #ifdef UINT64_MAX
170 # define GC_UINT64_MAX UINT64_MAX
171 #else
172 # define GC_UINT64_MAX static_cast<uint64_t>(0xffffffffffffffffULL) /* maximum unsigned int64 value */
173 #endif
174 #endif // GC_UINT64_MAX
175 
176 #ifndef GC_INT32_MAX
177 #ifdef INT32_MAX
178 # define GC_INT32_MAX INT32_MAX
179 #else
180 # define GC_INT32_MAX static_cast<int64_t>(0x000000007fffffffLL) /* maximum signed int32 value */
181 #endif
182 #endif // GC_INT32_MAX
183 
184 #ifndef GC_INT32_MIN
185 #ifdef INT32_MIN
186 # define GC_INT32_MIN INT32_MIN
187 #else
188 # define GC_INT32_MIN static_cast<int64_t>(0xffffffff80000000LL) /* minimum signed int32 value */
189 #endif
190 #endif // GC_INT32_MIN
191 
192 #ifndef GC_UINT32_MAX
193 #ifdef UINT32_MAX
194 # define GC_UINT32_MAX UINT32_MAX
195 #else
196 # define GC_UINT32_MAX static_cast<uint64_t>(0x00000000ffffffffULL) /* maximum unsigned int32 value */
197 #endif
198 #endif // GC_UINT32_MAX
199 
200 #ifndef GC_INT8_MAX
201 #ifdef INT8_MAX
202 # define GC_INT8_MAX INT8_MAX
203 #else
204 # define GC_INT8_MAX static_cast<int64_t>(0x000000000000007fLL) /* maximum signed int8 value */
205 #endif
206 #endif // GC_INT8_MAX
207 
208 #ifndef GC_INT8_MIN
209 #ifdef INT8_MIN
210 # define GC_INT8_MIN INT8_MIN
211 #else
212 # define GC_INT8_MIN static_cast<int64_t>(0xffffffffffffff80LL) /* minimum signed int8 value */
213 #endif
214 #endif // GC_INT8_MIN
215 
216 #ifndef GC_UINT8_MAX
217 #ifdef UINT8_MAX
218 # define GC_UINT8_MAX UINT8_MAX
219 #else
220 # define GC_UINT8_MAX static_cast<uint64_t>(0x00000000000000ffULL) /* maximum unsigned int8 value */
221 #endif
222 #endif // GC_UINT8_MAX
223 
226 
227 // Utility Types
228 
229 // Deprecated, use const uint8_t* instead
230 // typedef const char * pcchar8_t;
231 
232 // Deprecated, use uint8_t* instead
233 // typedef char * pchar8_t;
234 
236 typedef float float32_t;
237 
239 typedef double float64_t;
240 
242 
243 // GCBase import/export and static/shared
244 #if defined(GENAPI_STATIC)
245 # define GCBASE_API
246 # define GCBASE_RTTI_CLASS_API
247 #elif defined(_MSC_VER)
248 # ifdef GCBASE_EXPORTS
249 # define GCBASE_API __declspec(dllexport)
250 # define GCBASE_RTTI_CLASS_API __declspec(dllexport)
251 # else
252 # define GCBASE_API __declspec(dllimport)
253 # define GCBASE_RTTI_CLASS_API __declspec(dllimport)
254 # endif
255 #elif defined(__GNUC__)
256 # ifdef GCBASE_EXPORTS
257 # define GCBASE_API __attribute__((visibility("default")))
258 # define GCBASE_RTTI_CLASS_API __attribute__((visibility("default")))
259 # else
260 # define GCBASE_API
261  // Classes that need RTTI info across library boundaries (like Exception classes)
262  // need to always use default visibility, even when symbols are being imported.
263 # define GCBASE_RTTI_CLASS_API __attribute__((visibility("default")))
264 # endif
265 #else
266 # error Unsupported compiler or platform!
267 #endif
268 
269 namespace GENICAM_NAMESPACE
270 {
272  struct GCBASE_API Version_t
273  {
274  uint16_t Major;
275  uint16_t Minor;
276  uint16_t SubMinor;
277  };
278 }
279 
281 
282 // mark a variable as unused. This prevents unused parameter/ unused local variable warnings on warning level 4.
283 #if defined(_MSC_VER) || defined(__GNUC__)
284 # define GC_UNUSED(unused_var) (void)(unused_var)
285 #else
286 # error Unsupported compiler or platform
287 #endif
288 
289 
290 #endif // GENICAM_TYPES_H
version
Definition: GCTypes.h:272
double float64_t
64 bit floating point
Definition: GCTypes.h:239
GenICam versioned namespace.
Definition: GCArray.h:33
float float32_t
32 bit floating point
Definition: GCTypes.h:236
uint16_t SubMinor
a is incompatible b a > b
Definition: GCTypes.h:276
uint16_t Minor
a is incompatible with b if a != b
Definition: GCTypes.h:275