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


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Thu Jun 6 2019 19:10:54