GCTypes.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 (c) 2004 by Basler Vision Technologies
00003 (c) 2005 STEMMER IMAGING
00004 
00005 //  License: This file is published under the license of the EMVA GenICam  Standard Group.
00006 //  A text file describing the legal terms is included in  your installation as 'GenICam_license.pdf'.
00007 //  If for some reason you are missing  this file please contact the EMVA or visit the website
00008 //  (http://www.genicam.org) for a full copy.
00009 //
00010 //  THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
00011 //  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00012 //  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00013 //  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD  GROUP
00014 //  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,  SPECIAL,
00015 //  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT  LIMITED TO,
00016 //  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,  DATA, OR PROFITS;
00017 //  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY  THEORY OF LIABILITY,
00018 //  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT  (INCLUDING NEGLIGENCE OR OTHERWISE)
00019 //  ARISING IN ANY WAY OUT OF THE USE  OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00020 //  POSSIBILITY OF SUCH DAMAGE.
00021 
00022 
00023 ****************************************************************************/
00024 
00028 
00029 
00030 #ifndef GENICAM_TYPES_H
00031 #define GENICAM_TYPES_H
00032 
00033 #include <Base/GCNamespace.h>
00034 
00035 // Make sure WIN32 is defined if the toolchain does not already do it.
00036 #if defined (_WIN32) && !defined(WIN32)
00037 #    define WIN32
00038 #endif
00039 
00040 #if !defined (_WIN32)
00041 
00042 #    ifndef __STDC_LIMIT_MACROS
00043 #       define  __STDC_LIMIT_MACROS
00044 #    endif
00045 
00046 #    ifndef __STDC_CONSTANT_MACROS
00047 #       define  __STDC_CONSTANT_MACROS
00048 #    endif
00049 
00050 #    include <stddef.h>
00051 #ifndef VXWORKS
00052 #    include <inttypes.h>
00053 #endif
00054 #    include <stdint.h>
00055 
00056 #elif defined (_WIN32)
00057 
00060 
00061 // tag to perform 64 compatibility warnings checks on a type
00062 #   if !defined(GC_W64)
00063 #       if defined(_M_IX86) && _MSC_VER >= 1300
00064 #           define GC_W64 __w64
00065 #       else
00066 #           define GC_W64
00067 #       endif
00068 #   endif
00069 
00070 #   if defined(_MSC_VER) && _MSC_VER >= 1600
00071         // VS2010 provides stdint.h
00072 #       include <stdint.h>
00073 #   else
00074 #       ifndef _STDINT // only define if not already done
00075 
00077             typedef char int8_t;
00079             typedef unsigned char uint8_t;
00080 
00082             typedef short int16_t;
00084             typedef unsigned short uint16_t;
00085 
00087             typedef __int32 int32_t;
00089             typedef unsigned __int32 uint32_t;
00090 
00092             typedef __int64 int64_t;
00094             typedef unsigned __int64 uint64_t;
00095 
00096 #       endif // _STDINT
00097 #    endif // _MSC_VER >= 1600
00098 
00099     // Deprecated, use int8_t instead
00100     // typedef char char8_t;
00101 
00102     // Deprecated, use uint8_t instead
00103     // typedef unsigned char uchar8_t;
00104 
00106     typedef __int64 int_t;
00108     typedef unsigned __int64 uint_t;
00109 
00110 #   ifndef _SIZE_T_DEFINED
00111 #       ifdef  _WIN64
00112 
00113             typedef unsigned __int64 size_t;
00114 #       else
00115 
00116             typedef GC_W64 unsigned int size_t;
00117 #       endif
00118 #       define _SIZE_T_DEFINED
00119 #   endif
00120 
00121 #   ifndef _INTPTR_T_DEFINED
00122 #       ifdef  _WIN64
00123 
00124             typedef __int64 intptr_t;
00125 #       else
00126 
00127             typedef GC_W64 int intptr_t;
00128 #       endif
00129 #       define _INTPTR_T_DEFINED
00130 #   endif
00131 
00132 #   ifndef _UINTPTR_T_DEFINED
00133 #       ifdef  _WIN64
00134 
00135             typedef unsigned __int64 uintptr_t;
00136 #       else
00137 
00138             typedef GC_W64 unsigned int uintptr_t;
00139 #       endif
00140 #       define _UINTPTR_T_DEFINED
00141 #   endif
00142 
00143 #else
00144 #   error No platform-specific type definitions
00145 #endif /* __unix__ */
00146 
00147 // \}
00148 
00149 
00150 #ifndef GC_INT64_MAX
00151 #ifdef INT64_MAX
00152 #   define GC_INT64_MAX   INT64_MAX
00153 #else
00154 #   define GC_INT64_MAX   static_cast<int64_t>(0x7fffffffffffffffLL)    /* maximum signed int64 value */
00155 #endif
00156 #endif // GC_INT64_MAX
00157 
00158 #ifndef GC_INT64_MIN
00159 #ifdef INT64_MIN
00160 #   define GC_INT64_MIN   INT64_MIN
00161 #else
00162 #   define GC_INT64_MIN   static_cast<int64_t>(0x8000000000000000LL)    /* minimum signed int64 value */
00163 #endif
00164 #endif // GC_INT64_MIN
00165 
00166 #ifndef GC_UINT64_MAX
00167 #ifdef UINT64_MAX
00168 #   define GC_UINT64_MAX  UINT64_MAX
00169 #else
00170 #   define GC_UINT64_MAX  static_cast<uint64_t>(0xffffffffffffffffULL)   /* maximum unsigned int64 value */
00171 #endif
00172 #endif // GC_UINT64_MAX
00173 
00174 #ifndef GC_INT32_MAX
00175 #ifdef INT32_MAX
00176 #   define GC_INT32_MAX   INT32_MAX
00177 #else
00178 #   define GC_INT32_MAX   static_cast<int64_t>(0x000000007fffffffLL)    /* maximum signed int32 value */
00179 #endif
00180 #endif // GC_INT32_MAX
00181 
00182 #ifndef GC_INT32_MIN
00183 #ifdef INT32_MIN
00184 #   define GC_INT32_MIN   INT32_MIN
00185 #else
00186 #   define GC_INT32_MIN   static_cast<int64_t>(0xffffffff80000000LL)    /* minimum signed int32 value */
00187 #endif
00188 #endif // GC_INT32_MIN
00189 
00190 #ifndef GC_UINT32_MAX
00191 #ifdef UINT32_MAX
00192 #   define GC_UINT32_MAX  UINT32_MAX
00193 #else
00194 #   define GC_UINT32_MAX  static_cast<uint64_t>(0x00000000ffffffffULL)   /* maximum unsigned int32 value */
00195 #endif
00196 #endif // GC_UINT32_MAX
00197 
00198 #ifndef GC_INT8_MAX
00199 #ifdef INT8_MAX
00200 #   define GC_INT8_MAX    INT8_MAX
00201 #else
00202 #   define GC_INT8_MAX    static_cast<int64_t>(0x000000000000007fLL)    /* maximum signed int8 value */
00203 #endif
00204 #endif // GC_INT8_MAX
00205 
00206 #ifndef GC_INT8_MIN
00207 #ifdef INT8_MIN
00208 #   define GC_INT8_MIN    INT8_MIN
00209 #else
00210 #   define GC_INT8_MIN    static_cast<int64_t>(0xffffffffffffff80LL)    /* minimum signed int8 value */
00211 #endif
00212 #endif // GC_INT8_MIN
00213 
00214 #ifndef GC_UINT8_MAX
00215 #ifdef UINT8_MAX
00216 #   define GC_UINT8_MAX   UINT8_MAX
00217 #else
00218 #   define GC_UINT8_MAX   static_cast<uint64_t>(0x00000000000000ffULL)   /* maximum unsigned int8 value */
00219 #endif
00220 #endif // GC_UINT8_MAX
00221 
00224 
00225 // Utility Types
00226 
00227 // Deprecated, use const uint8_t* instead
00228 // typedef const char *      pcchar8_t;
00229 
00230 // Deprecated, use uint8_t* instead
00231 // typedef char *            pchar8_t;
00232 
00234 typedef float             float32_t;
00235 
00237 typedef double            float64_t;
00238 
00240 
00241 // gc base import/export
00242 #if defined(_MSC_VER)
00243 #   ifdef GCBASE_EXPORTS
00244 #       define GCBASE_API __declspec( dllexport )
00245 #       define GCBASE_RTTI_CLASS_API __declspec( dllexport )
00246 #   else
00247 #       define GCBASE_API __declspec( dllimport )
00248 #       define GCBASE_RTTI_CLASS_API __declspec( dllimport )
00249 #   endif
00250 #elif defined (__GNUC__)
00251 #   ifdef GCBASE_EXPORTS
00252 #          define GCBASE_API __attribute__((visibility("default")))
00253 #          define GCBASE_RTTI_CLASS_API __attribute__((visibility("default")))
00254 #   else
00255 #      define GCBASE_API
00256        // Classes that need RTTI info across library boundaries (like Exception classes)
00257        // need to always use default visibility, even when symbols are being imported.
00258 #      define GCBASE_RTTI_CLASS_API __attribute__((visibility("default")))
00259 #   endif
00260 #else
00261 #   error Unsupported compiler or platform
00262 #endif
00263 
00264 namespace GENICAM_NAMESPACE
00265 {
00267     struct GCBASE_API Version_t
00268     {
00269         uint16_t Major;        
00270         uint16_t Minor;        
00271         uint16_t SubMinor;     
00272     };
00273 }
00274 
00275 using GENICAM_NAMESPACE::Version_t;
00276 
00277 // mark a variable as unused. This prevents unused parameter/ unused local variable warnings on warning level 4.
00278 #if defined(_MSC_VER)
00279 #   define GC_UNUSED(unused_var) (void)(unused_var)
00280 #elif defined(__GNUC__)
00281 #   define GC_UNUSED(unused_var) // no changes to unused params with GCC
00282 #else
00283 #   error Unsupported compiler or platform
00284 #endif
00285 
00286 
00287 #endif // GENICAM_TYPES_H


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Thu Jun 6 2019 18:42:47