FundamentalType.h.in 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /*============================================================================
  2. KWSys - Kitware System Library
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef @KWSYS_NAMESPACE@_FundamentalType_h
  11. #define @KWSYS_NAMESPACE@_FundamentalType_h
  12. #include <@KWSYS_NAMESPACE@/Configure.h>
  13. /* Redefine all public interface symbol names to be in the proper
  14. namespace. These macros are used internally to kwsys only, and are
  15. not visible to user code. Use kwsysHeaderDump.pl to reproduce
  16. these macros after making changes to the interface. */
  17. #if !defined(KWSYS_NAMESPACE)
  18. # define kwsys_ns(x) @KWSYS_NAMESPACE@##x
  19. # define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
  20. #endif
  21. #if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
  22. # define kwsysFundamentalType kwsys_ns(FundamentalType)
  23. # define kwsysFundamentalType_Int8 kwsys_ns(FundamentalType_Int8)
  24. # define kwsysFundamentalType_UInt8 kwsys_ns(FundamentalType_UInt8)
  25. # define kwsysFundamentalType_Int16 kwsys_ns(FundamentalType_Int16)
  26. # define kwsysFundamentalType_UInt16 kwsys_ns(FundamentalType_UInt16)
  27. # define kwsysFundamentalType_Int32 kwsys_ns(FundamentalType_Int32)
  28. # define kwsysFundamentalType_UInt32 kwsys_ns(FundamentalType_UInt32)
  29. # define kwsysFundamentalType_Int64 kwsys_ns(FundamentalType_Int64)
  30. # define kwsysFundamentalType_UInt64 kwsys_ns(FundamentalType_UInt64)
  31. #endif
  32. /* The size of fundamental types. Types that do not exist have size 0. */
  33. #define @KWSYS_NAMESPACE@_SIZEOF_CHAR @KWSYS_SIZEOF_CHAR@
  34. #define @KWSYS_NAMESPACE@_SIZEOF_SHORT @KWSYS_SIZEOF_SHORT@
  35. #define @KWSYS_NAMESPACE@_SIZEOF_INT @KWSYS_SIZEOF_INT@
  36. #define @KWSYS_NAMESPACE@_SIZEOF_LONG @KWSYS_SIZEOF_LONG@
  37. #define @KWSYS_NAMESPACE@_SIZEOF_LONG_LONG @KWSYS_SIZEOF_LONG_LONG@
  38. #define @KWSYS_NAMESPACE@_SIZEOF___INT64 @KWSYS_SIZEOF___INT64@
  39. /* Whether types "long long" and "__int64" are enabled. If a type is
  40. enabled then it is a unique fundamental type. */
  41. #define @KWSYS_NAMESPACE@_USE_LONG_LONG @KWSYS_USE_LONG_LONG@
  42. #define @KWSYS_NAMESPACE@_USE___INT64 @KWSYS_USE___INT64@
  43. /* Whether type "char" is signed (it may be signed or unsigned). */
  44. #define @KWSYS_NAMESPACE@_CHAR_IS_SIGNED @KWSYS_CHAR_IS_SIGNED@
  45. #if defined(__cplusplus)
  46. extern "C"
  47. {
  48. #endif
  49. /* Select an 8-bit integer type. */
  50. #if @KWSYS_NAMESPACE@_SIZEOF_CHAR == 1
  51. typedef signed char kwsysFundamentalType_Int8;
  52. typedef unsigned char kwsysFundamentalType_UInt8;
  53. #else
  54. # error "No native data type can represent an 8-bit integer."
  55. #endif
  56. /* Select a 16-bit integer type. */
  57. #if @KWSYS_NAMESPACE@_SIZEOF_SHORT == 2
  58. typedef short kwsysFundamentalType_Int16;
  59. typedef unsigned short kwsysFundamentalType_UInt16;
  60. #elif @KWSYS_NAMESPACE@_SIZEOF_INT == 2
  61. typedef int kwsysFundamentalType_Int16;
  62. typedef unsigned int kwsysFundamentalType_UInt16;
  63. #else
  64. # error "No native data type can represent a 16-bit integer."
  65. #endif
  66. /* Select a 32-bit integer type. */
  67. #if @KWSYS_NAMESPACE@_SIZEOF_INT == 4
  68. typedef int kwsysFundamentalType_Int32;
  69. typedef unsigned int kwsysFundamentalType_UInt32;
  70. #elif @KWSYS_NAMESPACE@_SIZEOF_LONG == 4
  71. typedef long kwsysFundamentalType_Int32;
  72. typedef unsigned long kwsysFundamentalType_UInt32;
  73. #else
  74. # error "No native data type can represent a 32-bit integer."
  75. #endif
  76. /* Select a 64-bit integer type. */
  77. #if @KWSYS_NAMESPACE@_SIZEOF_LONG == 8
  78. typedef signed long kwsysFundamentalType_Int64;
  79. typedef unsigned long kwsysFundamentalType_UInt64;
  80. /* Whether UInt64 can be converted to double. */
  81. # define @KWSYS_NAMESPACE@_CAN_CONVERT_UI64_TO_DOUBLE 1
  82. #elif @KWSYS_NAMESPACE@_USE_LONG_LONG && @KWSYS_NAMESPACE@_SIZEOF_LONG_LONG == 8
  83. typedef signed long long kwsysFundamentalType_Int64;
  84. typedef unsigned long long kwsysFundamentalType_UInt64;
  85. /* Whether UInt64 can be converted to double. */
  86. # define @KWSYS_NAMESPACE@_CAN_CONVERT_UI64_TO_DOUBLE 1
  87. #elif @KWSYS_NAMESPACE@_USE___INT64 && @KWSYS_NAMESPACE@_SIZEOF___INT64 == 8
  88. typedef signed __int64 kwsysFundamentalType_Int64;
  89. typedef unsigned __int64 kwsysFundamentalType_UInt64;
  90. /* Whether UInt64 can be converted to double. */
  91. # define @KWSYS_NAMESPACE@_CAN_CONVERT_UI64_TO_DOUBLE @KWSYS_CAN_CONVERT_UI64_TO_DOUBLE@
  92. #else
  93. # error "No native data type can represent a 64-bit integer."
  94. #endif
  95. #if defined(__cplusplus)
  96. } /* extern "C" */
  97. #endif
  98. /* If we are building a kwsys .c or .cxx file, let it use these macros.
  99. Otherwise, undefine them to keep the namespace clean. */
  100. #if !defined(KWSYS_NAMESPACE)
  101. # undef kwsys_ns
  102. # undef kwsysEXPORT
  103. # if !defined(KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
  104. # undef kwsysFundamentalType
  105. # undef kwsysFundamentalType_Int8
  106. # undef kwsysFundamentalType_UInt8
  107. # undef kwsysFundamentalType_Int16
  108. # undef kwsysFundamentalType_UInt16
  109. # undef kwsysFundamentalType_Int32
  110. # undef kwsysFundamentalType_UInt32
  111. # undef kwsysFundamentalType_Int64
  112. # undef kwsysFundamentalType_UInt64
  113. # endif
  114. #endif
  115. /* If building a C or C++ file in kwsys itself, give the source file
  116. access to the configured macros without a configured namespace. */
  117. #if defined(KWSYS_NAMESPACE)
  118. # define KWSYS_SIZEOF_CHAR @KWSYS_NAMESPACE@_SIZEOF_CHAR
  119. # define KWSYS_SIZEOF_SHORT @KWSYS_NAMESPACE@_SIZEOF_SHORT
  120. # define KWSYS_SIZEOF_INT @KWSYS_NAMESPACE@_SIZEOF_INT
  121. # define KWSYS_SIZEOF_LONG @KWSYS_NAMESPACE@_SIZEOF_LONG
  122. # define KWSYS_SIZEOF_LONG_LONG @KWSYS_NAMESPACE@_SIZEOF_LONG_LONG
  123. # define KWSYS_SIZEOF___INT64 @KWSYS_NAMESPACE@_SIZEOF___INT64
  124. # define KWSYS_USE_LONG_LONG @KWSYS_NAMESPACE@_USE_LONG_LONG
  125. # define KWSYS_USE___INT64 @KWSYS_NAMESPACE@_USE___INT64
  126. # define KWSYS_CHAR_IS_SIGNED @KWSYS_NAMESPACE@_CHAR_IS_SIGNED
  127. # define KWSYS_CAN_CONVERT_UI64_TO_DOUBLE @KWSYS_NAMESPACE@_CAN_CONVERT_UI64_TO_DOUBLE
  128. #endif
  129. #endif