IT++ Logo

ittypes.h

Go to the documentation of this file.
00001 
00030 #ifndef ITTYPES_H
00031 #define ITTYPES_H
00032 
00033 #ifndef _MSC_VER
00034 #  include <itpp/config.h>
00035 #else
00036 #  include <itpp/config_msvc.h>
00037 #endif
00038 
00039 #ifndef NO_INT_SIZE_CHECK
00040 #if (SIZEOF_SHORT != 2) || (SIZEOF_UNSIGNED_SHORT != 2) \
00041   || (SIZEOF_INT != 4) || (SIZEOF_UNSIGNED_INT != 4)
00042 #  error        \
00043   This platform uses different sizes for "short" and "int" standard \
00044   types than expected 2 and 4 bytes, respectively. This causes  \
00045   incompatibilities of some parts of IT++ with most of 32- and 64-bit \
00046   platforms. Especially binary I/O operations will be incompatible. \
00047   Please report this problem to IT++ developers. If you are OK with it \
00048   you can add "-DNO_INT_SIZE_CHECK" to your CPPFLAGS and recompile the \
00049   library.
00050 #endif
00051 #endif // ifndef NO_INT_SIZE_CHECK
00052 
00053 #if defined(HAVE_STDINT_H)
00054 #  include <stdint.h>
00055 #elif defined(HAVE_INTTYPES_H)
00056 #  include <inttypes.h>
00057 #else
00058 
00059 // Common typedefs for most 32- and 64-bit architectures
00060 typedef signed char             int8_t;     
00061 typedef unsigned char           uint8_t;    
00062 typedef signed short            int16_t;    
00063 typedef unsigned short          uint16_t;   
00064 typedef signed int              int32_t;    
00065 typedef unsigned int            uint32_t;   
00066 
00067 #if defined(_MSC_VER)
00068 typedef __int64                 int64_t;    
00069 typedef unsigned __int64        uint64_t;   
00070 #elif (SIZEOF_LONG == 8) && (SIZEOF_UNSIGNED_LONG == 8)
00071 typedef signed long             int64_t;    
00072 typedef unsigned long           uint64_t;   
00073 #elif (SIZEOF_LONG_LONG == 8) && (SIZEOF_UNSIGNED_LONG_LONG == 8)
00074 typedef signed long long        int64_t;    
00075 typedef unsigned long long      uint64_t;   
00076 #else
00077 #  error      \
00078   64-bit integer type not detected on this platform. \
00079   Please report the problem to IT++ developers.
00080 #endif // defined(_MSC_VER)
00081 
00082 #endif // defined(HAVE_STDINT_H)
00083 
00084 #endif /* ITTYPES_H */
SourceForge Logo

Generated on Sun Jul 26 08:36:50 2009 for IT++ by Doxygen 1.5.9