ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkIntTypes.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkIntTypes_h
19 #define __itkIntTypes_h
20 
21 #include "itkConfigure.h"
22 
23 #if defined( ITK_HAVE_STDINT_H )
24 #include <stdint.h>
25 #else
26 // the system doesn't have the C or C++ version of stdint so lets use
27 // itksys's types for fixed widths
28 #include "itksys/FundamentalType.h"
29 
30 #ifdef ITK_HAVE_STDDEF_H
31 #include <stddef.h>
32 #endif //ITK_HAVE_STDDEF_H
33 
34 #endif // ITK_HAVE_CSTDINT
35 
36 #include <limits.h>
37 
38 namespace itk
39 {
40 #if defined( ITK_HAVE_STDINT_H )
41 
42 // Note: these types are technically optional in C99 stdint.h file. As
43 // such a try complile for their existence may be needed.
52 
53 // Note: these types are required for the C99 stdint.h file.
62 
63 // Note: these types are required for the C99 stdint.h file.
72 
75 
78 
79 #else // ITK_HAVE_STDINT_H
80 
82 typedef::itksysFundamentalType_Int8 int8_t;
83 typedef::itksysFundamentalType_UInt8 uint8_t;
84 typedef::itksysFundamentalType_Int16 int16_t;
85 typedef::itksysFundamentalType_UInt16 uint16_t;
86 typedef::itksysFundamentalType_Int32 int32_t;
87 typedef::itksysFundamentalType_UInt32 uint32_t;
88 typedef::itksysFundamentalType_Int64 int64_t;
89 typedef::itksysFundamentalType_UInt64 uint64_t;
90 
101 
112 
116 
117 typedef::ptrdiff_t intptr_t;
118 typedef::size_t uintptr_t;
119 
120 #endif // ITK_HAVE_STDINT_H
121 
122 #if !defined(ITKV3_COMPATIBILITY) && defined(ITK_USE_64BITS_IDS) && ((ULLONG_MAX != ULONG_MAX) || (LLONG_MAX != LONG_MAX))
123 
126 typedef uint64_t SizeValueType;
127 
131 
133 typedef int64_t IndexValueType;
134 
137 typedef int64_t OffsetValueType;
138 
139 #else
140 
143 typedef unsigned long SizeValueType;
144 
148 
150 typedef signed long IndexValueType;
151 
154 typedef signed long OffsetValueType;
155 
156 #endif
157 
159 typedef unsigned int ThreadIdType;
160 
161 }
162 
163 #endif /* __itkIntTypes_h */
164