Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00025
00026
00027 #ifndef INTEGERS_HPP
00028 #define INTEGERS_HPP
00029
00030 #include "../my_config.h"
00031 #include <string>
00032
00035
00036 #ifndef OS_BITS
00037
00038 #if HAVE_INTTYPES_H
00039 extern "C"
00040 {
00041 #if HAVE_INTTYPES_H
00042 #include <inttypes.h>
00043 #endif
00044 #if HAVE_LIMITS_H
00045 #include <limits.h>
00046 #endif
00047 }
00048
00049 namespace libdar
00050 {
00051 typedef unsigned char U_8;
00052 typedef uint16_t U_16;
00053 typedef uint32_t U_32;
00054 typedef uint64_t U_64;
00055 typedef size_t U_I;
00056
00057
00058 typedef signed char S_8;
00059 typedef int16_t S_16;
00060 typedef int32_t S_32;
00061 typedef int64_t S_64;
00062 typedef signed int S_I;
00063
00064 }
00065
00066 #else // HAVE_INTTYPES_H
00067 #error "Cannot determine interger types, use --enable-os-bits=... with the 'configure' script according to your system's CPU register size"
00068 #endif // HAVE_INTTYPES_H
00069
00070 #else // OS_BITS is defined
00071 #if OS_BITS == 32
00072
00073 namespace libdar
00074 {
00075 typedef unsigned char U_8;
00076 typedef unsigned short U_16;
00077 typedef unsigned long U_32;
00078 typedef unsigned long long U_64;
00079 typedef size_t U_I;
00080 typedef signed char S_8;
00081 typedef signed short S_16;
00082 typedef signed long S_32;
00083 typedef signed long long S_64;
00084 typedef signed int S_I;
00085
00086 }
00087
00088 #else // OS_BITS != 32
00089 #if OS_BITS == 64
00090
00091 namespace libdar
00092 {
00093 typedef unsigned char U_8;
00094 typedef unsigned short U_16;
00095 typedef unsigned int U_32;
00096 typedef unsigned long long U_64;
00097 typedef size_t U_I;
00098 typedef signed char S_8;
00099 typedef signed short S_16;
00100 typedef signed int S_32;
00101 typedef signed long long S_64;
00102 typedef signed int S_I;
00103
00104 }
00105
00106 #else // OS_BITS != 32 and OS_BITS != 64
00107 #error "unknown value given to --enable-os-bits=... check the 'configure' script arguments"
00108
00109
00110
00111
00112 #endif // OS_BITS == 64
00113 #endif // OS_BITS == 32
00114 #endif // OS_BITS not defined
00115
00116 namespace libdar
00117 {
00118
00119
00121
00123 void integer_check();
00124
00125
00127
00130 bool integers_system_is_big_endian();
00131
00132 }
00133
00135
00136
00137 #endif // header file multiple inclusion protection