1 /*=========================================================================
3 Program: KWSys - Kitware System Library
4 Module: $RCSfile: FundamentalType.h.in,v $
6 Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved.
7 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notices for more information.
13 =========================================================================*/
14 #ifndef @KWSYS_NAMESPACE@_FundamentalType_h
15 #define @KWSYS_NAMESPACE@_FundamentalType_h
17 #include <@KWSYS_NAMESPACE@/Configure.h>
19 /* Redefine all public interface symbol names to be in the proper
20 namespace. These macros are used internally to kwsys only, and are
21 not visible to user code. Use kwsysHeaderDump.pl to reproduce
22 these macros after making changes to the interface. */
23 #if !defined(KWSYS_NAMESPACE)
24 # define kwsys_ns(x) @KWSYS_NAMESPACE@##x
25 # define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
27 #define kwsysFundamentalType kwsys_ns(FundamentalType)
28 #define kwsysFundamentalType_Int8 kwsys_ns(FundamentalType_Int8)
29 #define kwsysFundamentalType_UInt8 kwsys_ns(FundamentalType_UInt8)
30 #define kwsysFundamentalType_Int16 kwsys_ns(FundamentalType_Int16)
31 #define kwsysFundamentalType_UInt16 kwsys_ns(FundamentalType_UInt16)
32 #define kwsysFundamentalType_Int32 kwsys_ns(FundamentalType_Int32)
33 #define kwsysFundamentalType_UInt32 kwsys_ns(FundamentalType_UInt32)
34 #define kwsysFundamentalType_Int64 kwsys_ns(FundamentalType_Int64)
35 #define kwsysFundamentalType_UInt64 kwsys_ns(FundamentalType_UInt64)
37 /* The size of fundamental types. Types that do not exist have size 0. */
38 #define @KWSYS_NAMESPACE@_SIZEOF_CHAR @KWSYS_SIZEOF_CHAR@
39 #define @KWSYS_NAMESPACE@_SIZEOF_SHORT @KWSYS_SIZEOF_SHORT@
40 #define @KWSYS_NAMESPACE@_SIZEOF_INT @KWSYS_SIZEOF_INT@
41 #define @KWSYS_NAMESPACE@_SIZEOF_LONG @KWSYS_SIZEOF_LONG@
42 #define @KWSYS_NAMESPACE@_SIZEOF_LONG_LONG @KWSYS_SIZEOF_LONG_LONG@
43 #define @KWSYS_NAMESPACE@_SIZEOF___INT64 @KWSYS_SIZEOF___INT64@
45 /* Whether types "long long" and "__int64" are enabled. If a type is
46 enabled then it is a unique fundamental type. */
47 #define @KWSYS_NAMESPACE@_USE_LONG_LONG @KWSYS_USE_LONG_LONG@
48 #define @KWSYS_NAMESPACE@_USE___INT64 @KWSYS_USE___INT64@
50 /* Whether type "char" is signed (it may be signed or unsigned). */
51 #define @KWSYS_NAMESPACE@_CHAR_IS_SIGNED @KWSYS_CHAR_IS_SIGNED@
53 #if defined(__cplusplus)
58 /* Select an 8-bit integer type. */
59 #if @KWSYS_NAMESPACE@_SIZEOF_CHAR == 1
60 typedef signed char kwsysFundamentalType_Int8
;
61 typedef unsigned char kwsysFundamentalType_UInt8
;
63 # error "No native data type can represent an 8-bit integer."
66 /* Select a 16-bit integer type. */
67 #if @KWSYS_NAMESPACE@_SIZEOF_SHORT == 2
68 typedef short kwsysFundamentalType_Int16
;
69 typedef unsigned short kwsysFundamentalType_UInt16
;
70 #elif @KWSYS_NAMESPACE@_SIZEOF_INT == 2
71 typedef int kwsysFundamentalType_Int16
;
72 typedef unsigned int kwsysFundamentalType_UInt16
;
74 # error "No native data type can represent a 16-bit integer."
77 /* Select a 32-bit integer type. */
78 #if @KWSYS_NAMESPACE@_SIZEOF_INT == 4
79 typedef int kwsysFundamentalType_Int32
;
80 typedef unsigned int kwsysFundamentalType_UInt32
;
81 #elif @KWSYS_NAMESPACE@_SIZEOF_LONG == 4
82 typedef long kwsysFundamentalType_Int32
;
83 typedef unsigned long kwsysFundamentalType_UInt32
;
85 # error "No native data type can represent a 32-bit integer."
88 /* Select a 64-bit integer type. */
89 #if @KWSYS_NAMESPACE@_SIZEOF_LONG == 8
90 typedef signed long kwsysFundamentalType_Int64
;
91 typedef unsigned long kwsysFundamentalType_UInt64
;
92 /* Whether UInt64 can be converted to double. */
93 # define @KWSYS_NAMESPACE@_CAN_CONVERT_UI64_TO_DOUBLE 1
94 #elif @KWSYS_NAMESPACE@_USE_LONG_LONG && @KWSYS_NAMESPACE@_SIZEOF_LONG_LONG == 8
95 typedef signed long long kwsysFundamentalType_Int64
;
96 typedef unsigned long long kwsysFundamentalType_UInt64
;
97 /* Whether UInt64 can be converted to double. */
98 # define @KWSYS_NAMESPACE@_CAN_CONVERT_UI64_TO_DOUBLE 1
99 #elif @KWSYS_NAMESPACE@_USE___INT64 && @KWSYS_NAMESPACE@_SIZEOF___INT64 == 8
100 typedef signed __int64 kwsysFundamentalType_Int64
;
101 typedef unsigned __int64 kwsysFundamentalType_UInt64
;
102 /* Whether UInt64 can be converted to double. */
103 # define @KWSYS_NAMESPACE@_CAN_CONVERT_UI64_TO_DOUBLE @KWSYS_CAN_CONVERT_UI64_TO_DOUBLE@
105 # error "No native data type can represent a 64-bit integer."
108 #if defined(__cplusplus)
112 /* If we are building a kwsys .c or .cxx file, let it use these macros.
113 Otherwise, undefine them to keep the namespace clean. */
114 #if !defined(KWSYS_NAMESPACE)
117 # undef kwsysFundamentalType
118 # undef kwsysFundamentalType_Int8
119 # undef kwsysFundamentalType_UInt8
120 # undef kwsysFundamentalType_Int16
121 # undef kwsysFundamentalType_UInt16
122 # undef kwsysFundamentalType_Int32
123 # undef kwsysFundamentalType_UInt32
124 # undef kwsysFundamentalType_Int64
125 # undef kwsysFundamentalType_UInt64
128 /* If building a C or C++ file in kwsys itself, give the source file
129 access to the configured macros without a configured namespace. */
130 #if defined(KWSYS_NAMESPACE)
131 # define KWSYS_SIZEOF_CHAR @KWSYS_NAMESPACE@_SIZEOF_CHAR
132 # define KWSYS_SIZEOF_SHORT @KWSYS_NAMESPACE@_SIZEOF_SHORT
133 # define KWSYS_SIZEOF_INT @KWSYS_NAMESPACE@_SIZEOF_INT
134 # define KWSYS_SIZEOF_LONG @KWSYS_NAMESPACE@_SIZEOF_LONG
135 # define KWSYS_SIZEOF_LONG_LONG @KWSYS_NAMESPACE@_SIZEOF_LONG_LONG
136 # define KWSYS_SIZEOF___INT64 @KWSYS_NAMESPACE@_SIZEOF___INT64
137 # define KWSYS_USE_LONG_LONG @KWSYS_NAMESPACE@_USE_LONG_LONG
138 # define KWSYS_USE___INT64 @KWSYS_NAMESPACE@_USE___INT64
139 # define KWSYS_CHAR_IS_SIGNED @KWSYS_NAMESPACE@_CHAR_IS_SIGNED
140 # define KWSYS_CAN_CONVERT_UI64_TO_DOUBLE @KWSYS_NAMESPACE@_CAN_CONVERT_UI64_TO_DOUBLE