Commit f81d0c58 authored by Brad King's avatar Brad King
Browse files

ENH: Adding types "long long" and "__int64" as native types for platforms on...

ENH: Adding types "long long" and "__int64" as native types for platforms on which they are available and distinct.  At least one of these types seems to be available everywhere which should allow 64-bit integer data to be processed even when not using 64-bit ids.  The macros VTK_TYPE_USE_LONG_LONG and VTK_TYPE_USE___INT64 are defined to indicate that their corresponding types should be used.  The vtkTemplateMacro includes these types automatically.
parent 9a6fb046
......@@ -13,6 +13,8 @@
=========================================================================*/
#define TYPE_LONG_LONG long long
typedef VTK_TEST_COMPARE_TYPE_1 Type1;
typedef VTK_TEST_COMPARE_TYPE_2 Type2;
......
/*=========================================================================
Program: Visualization Toolkit
Module: vtkTestConvertTypes.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#define TYPE_UNSIGNED___INT64 unsigned __int64
typedef VTK_TEST_CONVERT_TYPE_TO TypeTo;
typedef VTK_TEST_CONVERT_TYPE_FROM TypeFrom;
void function(TypeTo& l, TypeFrom const& r)
{
l = static_cast<TypeTo>(r);
}
int main()
{
TypeTo tTo = TypeTo();
TypeFrom tFrom = TypeFrom();
function(tTo, tFrom);
return 0;
}
......@@ -312,6 +312,82 @@ IF(VTK_SIZEOF___INT64)
"${OUTPUT}\n" APPEND)
ENDIF(VTK_TYPE_SAME_LONG_AND___INT64)
ENDIF("VTK_TYPE_SAME_LONG_AND___INT64" MATCHES "^VTK_TYPE_SAME_LONG_AND___INT64$")
IF(VTK_SIZEOF_LONG_LONG)
IF("VTK_TYPE_SAME_LONG_LONG_AND___INT64" MATCHES "^VTK_TYPE_SAME_LONG_LONG_AND___INT64$")
MESSAGE(STATUS "Checking whether long long and __int64 are the same type")
TRY_COMPILE(VTK_TYPE_SAME_LONG_LONG_AND___INT64
${VTK_BINARY_DIR}/CMakeTmp
${VTK_SOURCE_DIR}/CMake/vtkTestCompareTypes.cxx
COMPILE_DEFINITIONS
-DVTK_TEST_COMPARE_TYPE_1=TYPE_LONG_LONG
-DVTK_TEST_COMPARE_TYPE_2=__int64
OUTPUT_VARIABLE OUTPUT)
IF(VTK_TYPE_SAME_LONG_LONG_AND___INT64)
MESSAGE(STATUS "Checking whether long long and __int64 are the same type -- yes")
SET(VTK_TYPE_SAME_LONG_LONG_AND___INT64 1 CACHE INTERNAL "Whether long long and __int64 are the same type")
WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeOutput.log
"Determining whether long long and __int64 are the same type "
"passed with the following output:\n"
"${OUTPUT}\n" APPEND)
ELSE(VTK_TYPE_SAME_LONG_LONG_AND___INT64)
MESSAGE(STATUS "Checking whether long long and __int64 are the same type -- no")
SET(VTK_TYPE_SAME_LONG_LONG_AND___INT64 0 CACHE INTERNAL "Whether long long and __int64 are the same type")
WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeError.log
"Determining whether long long and __int64 are the same type "
"failed with the following output:\n"
"${OUTPUT}\n" APPEND)
ENDIF(VTK_TYPE_SAME_LONG_LONG_AND___INT64)
ENDIF("VTK_TYPE_SAME_LONG_LONG_AND___INT64" MATCHES "^VTK_TYPE_SAME_LONG_LONG_AND___INT64$")
ENDIF(VTK_SIZEOF_LONG_LONG)
IF(NOT VTK_TYPE_SAME_LONG_AND___INT64)
IF(NOT VTK_TYPE_SAME_LONG_LONG_AND___INT64)
# VS 6 cannot convert unsigned __int64 to double unless the
# "Visual C++ Processor Pack" is installed.
IF("VTK_TYPE_CONVERT_UI64_TO_DOUBLE" MATCHES "^VTK_TYPE_CONVERT_UI64_TO_DOUBLE$")
MESSAGE(STATUS "Checking whether unsigned __int64 can convert to double")
TRY_COMPILE(VTK_TYPE_CONVERT_UI64_TO_DOUBLE
${VTK_BINARY_DIR}/CMakeTmp
${VTK_SOURCE_DIR}/CMake/vtkTestConvertTypes.cxx
COMPILE_DEFINITIONS
-DVTK_TEST_CONVERT_TYPE_FROM=TYPE_UNSIGNED___INT64
-DVTK_TEST_CONVERT_TYPE_TO=double
OUTPUT_VARIABLE OUTPUT)
IF(VTK_TYPE_CONVERT_UI64_TO_DOUBLE)
MESSAGE(STATUS "Checking whether unsigned __int64 can convert to double -- yes")
SET(VTK_TYPE_CONVERT_UI64_TO_DOUBLE 1 CACHE INTERNAL "Whether unsigned __int64 can convert to double")
WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeOutput.log
"Determining whether unsigned __int64 can convert to double "
"passed with the following output:\n"
"${OUTPUT}\n" APPEND)
ELSE(VTK_TYPE_CONVERT_UI64_TO_DOUBLE)
MESSAGE(STATUS "Checking whether unsigned __int64 can convert to double -- no")
SET(VTK_TYPE_CONVERT_UI64_TO_DOUBLE 0 CACHE INTERNAL "Whether unsigned __int64 can convert to double")
WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeError.log
"Determining whether unsigned __int64 can convert to double "
"failed with the following output:\n"
"${OUTPUT}\n" APPEND)
ENDIF(VTK_TYPE_CONVERT_UI64_TO_DOUBLE)
ENDIF("VTK_TYPE_CONVERT_UI64_TO_DOUBLE" MATCHES "^VTK_TYPE_CONVERT_UI64_TO_DOUBLE$")
ENDIF(NOT VTK_TYPE_SAME_LONG_LONG_AND___INT64)
ENDIF(NOT VTK_TYPE_SAME_LONG_AND___INT64)
ENDIF(VTK_SIZEOF___INT64)
# Enable the "long long" type if it is available. It is standard in
# C99 and C++03 but not in earlier standards.
SET(VTK_TYPE_USE_LONG_LONG)
IF(VTK_SIZEOF_LONG_LONG)
SET(VTK_TYPE_USE_LONG_LONG 1)
ENDIF(VTK_SIZEOF_LONG_LONG)
# Enable the "__int64" type if it is available and unique. It is not
# standard.
SET(VTK_TYPE_USE___INT64)
IF(VTK_SIZEOF___INT64)
IF(NOT VTK_TYPE_SAME_LONG_AND___INT64)
IF(NOT VTK_TYPE_SAME_LONG_LONG_AND___INT64)
SET(VTK_TYPE_USE___INT64 1)
ENDIF(NOT VTK_TYPE_SAME_LONG_LONG_AND___INT64)
ENDIF(NOT VTK_TYPE_SAME_LONG_AND___INT64)
ENDIF(VTK_SIZEOF___INT64)
IF("VTK_COMPILER_HAS_BOOL" MATCHES "^VTK_COMPILER_HAS_BOOL$")
......
......@@ -151,6 +151,26 @@ vtkWindowLevelLookupTable.cxx
vtkXMLFileOutputWindow.cxx
)
IF(VTK_TYPE_USE_LONG_LONG)
SET(Kit_SRCS ${Kit_SRCS}
vtkLongLongArray.cxx
vtkUnsignedLongLongArray.cxx
)
SET_SOURCE_FILES_PROPERTIES(
vtkLongLongArray.cxx
vtkUnsignedLongLongArray.cxx
WRAP_EXCLUDE
)
ENDIF(VTK_TYPE_USE_LONG_LONG)
IF(VTK_TYPE_USE___INT64)
SET(Kit_SRCS ${Kit_SRCS} vtk__Int64Array.cxx)
SET_SOURCE_FILES_PROPERTIES(vtk__Int64Array.cxx WRAP_EXCLUDE)
IF(VTK_TYPE_CONVERT_UI64_TO_DOUBLE)
SET(Kit_SRCS ${Kit_SRCS} vtkUnsigned__Int64Array.cxx)
SET_SOURCE_FILES_PROPERTIES(vtkUnsigned__Int64Array.cxx WRAP_EXCLUDE)
ENDIF(VTK_TYPE_CONVERT_UI64_TO_DOUBLE)
ENDIF(VTK_TYPE_USE___INT64)
SET_SOURCE_FILES_PROPERTIES(
# vtkObjectBase is marked ABSTRACT so that instantiators are happy.
vtkAbstractArray
......
......@@ -30,7 +30,19 @@
#include "vtkUnsignedLongArray.h"
#include "vtkUnsignedShortArray.h"
vtkCxxRevisionMacro(vtkDataArray, "1.65");
#if defined(VTK_TYPE_USE_LONG_LONG)
# include "vtkLongLongArray.h"
# include "vtkUnsignedLongLongArray.h"
#endif
#if defined(VTK_TYPE_USE___INT64)
# include "vtk__Int64Array.h"
# if defined(VTK_TYPE_CONVERT_UI64_TO_DOUBLE)
# include "vtkUnsigned__Int64Array.h"
# endif
#endif
vtkCxxRevisionMacro(vtkDataArray, "1.66");
//----------------------------------------------------------------------------
// Construct object with default tuple dimension (number of components) of 1.
......@@ -576,6 +588,28 @@ unsigned long vtkDataArray::GetDataTypeSize(int type)
return sizeof(unsigned long);
break;
#if defined(VTK_TYPE_USE_LONG_LONG)
case VTK_LONG_LONG:
return sizeof(long long);
break;
case VTK_UNSIGNED_LONG_LONG:
return sizeof(unsigned long long);
break;
#endif
#if defined(VTK_TYPE_USE___INT64)
case VTK___INT64:
return sizeof(__int64);
break;
# if defined(VTK_TYPE_CONVERT_UI64_TO_DOUBLE)
case VTK_UNSIGNED___INT64:
return sizeof(unsigned __int64);
break;
# endif
#endif
case VTK_FLOAT:
return sizeof(float);
break;
......@@ -641,6 +675,26 @@ vtkDataArray* vtkDataArray::CreateDataArray(int dataType)
case VTK_UNSIGNED_LONG:
return vtkUnsignedLongArray::New();
#if defined(VTK_TYPE_USE_LONG_LONG)
case VTK_LONG_LONG:
return vtkLongLongArray::New();
case VTK_UNSIGNED_LONG_LONG:
return vtkUnsignedLongLongArray::New();
#endif
#if defined(VTK_TYPE_USE___INT64)
case VTK___INT64:
return vtk__Int64Array::New();
break;
# if defined(VTK_TYPE_CONVERT_UI64_TO_DOUBLE)
case VTK_UNSIGNED___INT64:
return vtkUnsigned__Int64Array::New();
break;
# endif
#endif
case VTK_FLOAT:
return vtkFloatArray::New();
......@@ -937,6 +991,16 @@ double vtkDataArray::GetDataTypeMin()
case VTK_INT: return (double)VTK_INT_MIN;
case VTK_UNSIGNED_LONG: return (double)VTK_UNSIGNED_LONG_MIN;
case VTK_LONG: return (double)VTK_LONG_MIN;
#if defined(VTK_TYPE_USE_LONG_LONG)
case VTK_UNSIGNED_LONG_LONG: return (double)VTK_UNSIGNED_LONG_LONG_MIN;
case VTK_LONG_LONG: return (double)VTK_LONG_LONG_MIN;
#endif
#if defined(VTK_TYPE_USE___INT64)
case VTK___INT64: return (double)VTK___INT64_MIN;
# if defined(VTK_TYPE_CONVERT_UI64_TO_DOUBLE)
case VTK_UNSIGNED___INT64: return (double)VTK_UNSIGNED___INT64_MIN;
# endif
#endif
case VTK_FLOAT: return (double)VTK_FLOAT_MIN;
case VTK_DOUBLE: return (double)VTK_DOUBLE_MIN;
default: return 0;
......@@ -958,6 +1022,16 @@ double vtkDataArray::GetDataTypeMax()
case VTK_INT: return (double)VTK_INT_MAX;
case VTK_UNSIGNED_LONG: return (double)VTK_UNSIGNED_LONG_MAX;
case VTK_LONG: return (double)VTK_LONG_MAX;
#if defined(VTK_TYPE_USE_LONG_LONG)
case VTK_UNSIGNED_LONG_LONG: return (double)VTK_UNSIGNED_LONG_LONG_MAX;
case VTK_LONG_LONG: return (double)VTK_LONG_LONG_MAX;
#endif
#if defined(VTK_TYPE_USE___INT64)
case VTK___INT64: return (double)VTK___INT64_MAX;
# if defined(VTK_TYPE_CONVERT_UI64_TO_DOUBLE)
case VTK_UNSIGNED___INT64: return (double)VTK_UNSIGNED___INT64_MAX;
# endif
#endif
case VTK_FLOAT: return (double)VTK_FLOAT_MAX;
case VTK_DOUBLE: return (double)VTK_DOUBLE_MAX;
default: return 1;
......
......@@ -70,7 +70,7 @@ vtkLargeInteger::vtkLargeInteger(void)
this->Sig = 0;
}
#ifdef VTK_SIZEOF_LONG_LONG
#if defined(VTK_TYPE_USE_LONG_LONG)
vtkLargeInteger::vtkLargeInteger(long long n)
{
this->Negative = n < 0 ? 1 : 0;
......@@ -101,7 +101,7 @@ vtkLargeInteger::vtkLargeInteger(unsigned long long n)
}
#endif
#if defined( VTK_SIZEOF___INT64 ) && (!defined( VTK_SIZEOF_LONG_LONG ) || VTK_SIZEOF_LONG_LONG != VTK_SIZEOF___INT64)
#if defined(VTK_TYPE_USE___INT64)
vtkLargeInteger::vtkLargeInteger(__int64 n)
{
this->Negative = n < 0 ? 1 : 0;
......
......@@ -28,11 +28,11 @@ public:
vtkLargeInteger(int n);
vtkLargeInteger(unsigned int n);
vtkLargeInteger(const vtkLargeInteger& n);
#ifdef VTK_SIZEOF_LONG_LONG
#if defined(VTK_TYPE_USE_LONG_LONG)
vtkLargeInteger(long long n);
vtkLargeInteger(unsigned long long n);
#endif
#if defined( VTK_SIZEOF___INT64 ) && !defined( VTK_SIZEOF_LONG_LONG )
#if defined(VTK_TYPE_USE___INT64)
vtkLargeInteger(__int64 n);
vtkLargeInteger(unsigned __int64 n);
#endif
......
/*=========================================================================
Program: Visualization Toolkit
Module: vtkLongLongArray.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// Instantiate superclass first to give the template a DLL interface.
#include "vtkDataArrayTemplate.txx"
VTK_DATA_ARRAY_TEMPLATE_INSTANTIATE(long long);
#define __vtkLongLongArray_cxx
#include "vtkLongLongArray.h"
#include "vtkObjectFactory.h"
//----------------------------------------------------------------------------
vtkCxxRevisionMacro(vtkLongLongArray, "1.1");
vtkStandardNewMacro(vtkLongLongArray);
//----------------------------------------------------------------------------
vtkLongLongArray::vtkLongLongArray(vtkIdType numComp): RealSuperclass(numComp)
{
}
//----------------------------------------------------------------------------
vtkLongLongArray::~vtkLongLongArray()
{
}
//----------------------------------------------------------------------------
void vtkLongLongArray::PrintSelf(ostream& os, vtkIndent indent)
{
this->RealSuperclass::PrintSelf(os,indent);
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkLongLongArray.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkLongLongArray - dynamic, self-adjusting array of long long
// .SECTION Description
// vtkLongLongArray is an array of values of type long long.
// It provides methods for insertion and retrieval of values and will
// automatically resize itself to hold new data.
#ifndef __vtkLongLongArray_h
#define __vtkLongLongArray_h
// Tell the template header how to give our superclass a DLL interface.
#if !defined(__vtkLongLongArray_cxx)
# define VTK_DATA_ARRAY_TEMPLATE_TYPE long long
#endif
#include "vtkDataArray.h"
#include "vtkDataArrayTemplate.h" // Real Superclass
// Fake the superclass for the wrappers.
#define vtkDataArray vtkDataArrayTemplate<long long>
class VTK_COMMON_EXPORT vtkLongLongArray : public vtkDataArray
#undef vtkDataArray
{
public:
static vtkLongLongArray* New();
vtkTypeRevisionMacro(vtkLongLongArray,vtkDataArray);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Get the data type.
int GetDataType()
{ return VTK_LONG_LONG; }
// Description:
// Copy the tuple value into a user-provided array.
void GetTupleValue(vtkIdType i, long long* tuple)
{ this->RealSuperclass::GetTupleValue(i, tuple); }
// Description:
// Set the tuple value at the ith location in the array.
void SetTupleValue(vtkIdType i, const long long* tuple)
{ this->RealSuperclass::SetTupleValue(i, tuple); }
// Description:
// Insert (memory allocation performed) the tuple into the ith location
// in the array.
void InsertTupleValue(vtkIdType i, const long long* tuple)
{ this->RealSuperclass::InsertTupleValue(i, tuple); }
// Description:
// Insert (memory allocation performed) the tuple onto the end of the array.
vtkIdType InsertNextTupleValue(const long long* tuple)
{ return this->RealSuperclass::InsertNextTupleValue(tuple); }
// Description:
// Get the data at a particular index.
long long GetValue(vtkIdType id)
{ return this->RealSuperclass::GetValue(id); }
// Description:
// Set the data at a particular index. Does not do range checking. Make sure
// you use the method SetNumberOfValues() before inserting data.
void SetValue(vtkIdType id, long long value)
{ this->RealSuperclass::SetValue(id, value); }
// Description:
// Specify the number of values for this object to hold. Does an
// allocation as well as setting the MaxId ivar. Used in conjunction with
// SetValue() method for fast insertion.
void SetNumberOfValues(vtkIdType number)
{ this->RealSuperclass::SetNumberOfValues(number); }
// Description:
// Insert data at a specified position in the array.
void InsertValue(vtkIdType id, long long f)
{ this->RealSuperclass::InsertValue(id, f); }
// Description:
// Insert data at the end of the array. Return its location in the array.
vtkIdType InsertNextValue(long long f)
{ return this->RealSuperclass::InsertNextValue(f); }
// Description:
// Get the address of a particular data index. Make sure data is allocated
// for the number of items requested. Set MaxId according to the number of
// data values requested.
long long* WritePointer(vtkIdType id, vtkIdType number)
{ return this->RealSuperclass::WritePointer(id, number); }
// Description:
// Get the address of a particular data index. Performs no checks
// to verify that the memory has been allocated etc.
long long* GetPointer(vtkIdType id)
{ return this->RealSuperclass::GetPointer(id); }
// Description:
// This method lets the user specify data to be held by the array. The
// array argument is a pointer to the data. size is the size of
// the array supplied by the user. Set save to 1 to keep the class
// from deleting the array when it cleans up or reallocates memory.
// The class uses the actual array provided; it does not copy the data
// from the suppled array.
void SetArray(long long* array, vtkIdType size, int save)
{ this->RealSuperclass::SetArray(array, size, save); }
protected:
vtkLongLongArray(vtkIdType numComp=1);
~vtkLongLongArray();
private:
//BTX
typedef vtkDataArrayTemplate<long long> RealSuperclass;
//ETX
vtkLongLongArray(const vtkLongLongArray&); // Not implemented.
void operator=(const vtkLongLongArray&); // Not implemented.
};
#endif
......@@ -71,11 +71,11 @@ VTKOSTREAM_OPERATOR(double);
#ifdef VTK_COMPILER_HAS_BOOL
VTKOSTREAM_OPERATOR(bool);
#endif
#if defined(VTK_SIZEOF_LONG_LONG)
#if defined(VTK_TYPE_USE_LONG_LONG)
VTKOSTREAM_OPERATOR(long long);
VTKOSTREAM_OPERATOR(unsigned long long);
#endif
#if defined( VTK_SIZEOF___INT64 ) && !defined( VTK_SIZEOF_LONG_LONG )
#if defined(VTK_TYPE_USE___INT64)
VTKOSTREAM_OPERATOR(__int64);
VTKOSTREAM_OPERATOR(unsigned __int64);
#endif
......
......@@ -69,11 +69,11 @@ public:
vtkOStreamWrapper& operator << (unsigned long);
vtkOStreamWrapper& operator << (float);
vtkOStreamWrapper& operator << (double);
#if defined(VTK_SIZEOF_LONG_LONG)
#if defined(VTK_TYPE_USE_LONG_LONG)
vtkOStreamWrapper& operator << (long long);
vtkOStreamWrapper& operator << (unsigned long long);
#endif
#if defined( VTK_SIZEOF___INT64 ) && !defined( VTK_SIZEOF_LONG_LONG )
#if defined(VTK_TYPE_USE___INT64)
vtkOStreamWrapper& operator << (__int64);
vtkOStreamWrapper& operator << (unsigned __int64);
#endif
......
......@@ -40,10 +40,14 @@
(((type) == VTK_UNSIGNED_INT) ? "unsigned int" : \
(((type) == VTK_LONG) ? "long" : \
(((type) == VTK_UNSIGNED_LONG) ? "unsigned long" : \
(((type) == VTK_LONG_LONG) ? "long long" : \
(((type) == VTK_UNSIGNED_LONG_LONG) ? "unsigned long long" : \
(((type) == VTK___INT64) ? "__int64" : \
(((type) == VTK_UNSIGNED___INT64) ? "unsigned __int64" : \
(((type) == VTK_FLOAT) ? "float" : \
(((type) == VTK_DOUBLE) ? "double" : \
(((type) == VTK_ID_TYPE) ? "idtype" : \
"Undefined")))))))))))))
"Undefined")))))))))))))))))
//
// Set built-in type. Creates member Set"name"() (e.g., SetVisibility());
......@@ -634,18 +638,47 @@ virtual double *Get##name() \
// }
#define vtkTemplateMacroCase(typeN, type, call) \
case typeN: { typedef type VTK_TT; call; }; break
#define vtkTemplateMacro(call) \
vtkTemplateMacroCase(VTK_DOUBLE, double, call); \
vtkTemplateMacroCase(VTK_FLOAT, float, call); \
vtkTemplateMacroCase(VTK_LONG, long, call); \
vtkTemplateMacroCase(VTK_UNSIGNED_LONG, unsigned long, call); \
vtkTemplateMacroCase(VTK_INT, int, call); \
vtkTemplateMacroCase(VTK_UNSIGNED_INT, unsigned int, call); \
vtkTemplateMacroCase(VTK_SHORT, short, call); \
vtkTemplateMacroCase(VTK_UNSIGNED_SHORT, unsigned short, call); \
vtkTemplateMacroCase(VTK_CHAR, char, call); \
#define vtkTemplateMacro(call) \
vtkTemplateMacroCase(VTK_DOUBLE, double, call); \
vtkTemplateMacroCase(VTK_FLOAT, float, call); \
vtkTemplateMacroCase_ll(VTK_LONG_LONG, long long, call) \
vtkTemplateMacroCase_ll(VTK_UNSIGNED_LONG_LONG, unsigned long long, call) \
vtkTemplateMacroCase_si64(VTK___INT64, __int64, call) \
vtkTemplateMacroCase_ui64(VTK_UNSIGNED___INT64, unsigned __int64, call) \
vtkTemplateMacroCase(VTK_LONG, long, call); \
vtkTemplateMacroCase(VTK_UNSIGNED_LONG, unsigned long, call); \
vtkTemplateMacroCase(VTK_INT, int, call); \
vtkTemplateMacroCase(VTK_UNSIGNED_INT, unsigned int, call); \
vtkTemplateMacroCase(VTK_SHORT, short, call); \
vtkTemplateMacroCase(VTK_UNSIGNED_SHORT, unsigned short, call); \
vtkTemplateMacroCase(VTK_CHAR, char, call); \
vtkTemplateMacroCase(VTK_UNSIGNED_CHAR, unsigned char, call)
// Add "long long" to the template macro if it is enabled.
#if defined(VTK_TYPE_USE_LONG_LONG)
# define vtkTemplateMacroCase_ll(typeN, type, call) \
vtkTemplateMacroCase(typeN, type, call);
#else
# define vtkTemplateMacroCase_ll(typeN, type, call)
#endif
// Add "__int64" to the template macro if it is enabled.
#if defined(VTK_TYPE_USE___INT64)
# define vtkTemplateMacroCase_si64(typeN, type, call) \
vtkTemplateMacroCase(typeN, type, call);
#else
# define vtkTemplateMacroCase_si64(typeN, type, call)
#endif
// Add "unsigned __int64" to the template macro if it is enabled and
// can be converted to double.
#if defined(VTK_TYPE_USE___INT64) && defined(VTK_TYPE_CONVERT_UI64_TO_DOUBLE)
# define vtkTemplateMacroCase_ui64(typeN, type, call) \
vtkTemplateMacroCase(typeN, type, call);
#else
# define vtkTemplateMacroCase_ui64(typeN, type, call)
#endif
// Legacy versions of vtkTemplateMacro:
#define vtkTemplateMacro3(func, a1, a2, a3) \
vtkTemplateMacro(func (a1, a2, a3))
......
......@@ -49,20 +49,35 @@ typedef double vtkFloatingPointType;
// this should be removed at some point
#define VTK_USE_EXECUTIVES
// Some constants used throughout the code
#define VTK_LARGE_INTEGER VTK_INT_MAX
#define VTK_LARGE_FLOAT VTK_FLOAT_MAX
// Choose an implementation for vtkIdType.
#define VTK_HAS_ID_TYPE
#ifdef VTK_USE_64BIT_IDS
# define VTK_ID_TYPE_IS_NOT_BASIC_TYPE
# define VTK_SIZEOF_ID_TYPE 8
# ifdef _WIN32
typedef __int64 vtkIdType;
# else // _WIN32
# if defined(VTK_SIZEOF_LONG) && VTK_SIZEOF_LONG == 8
typedef long vtkIdType;
# define VTK_SIZEOF_ID_TYPE VTK_SIZEOF_LONG
# define VTK_LARGE_ID VTK_LONG_MAX
# elif defined(VTK_TYPE_USE_LONG_LONG) && VTK_SIZEOF_LONG_LONG == 8
typedef long long vtkIdType;
# endif // _WIN32
#else // VTK_USE_64BIT_IDS
# define VTK_SIZEOF_ID_TYPE VTK_SIZEOF_INT
# define VTK_ID_TYPE_IS_NOT_BASIC_TYPE
# define VTK_SIZEOF_ID_TYPE VTK_SIZEOF_LONG_LONG
# define VTK_LARGE_ID VTK_LONG_LONG_MAX
# elif defined(VTK_TYPE_USE___INT64) && VTK_SIZEOF___INT64 == 8
typedef __int64 vtkIdType;
# define VTK_ID_TYPE_IS_NOT_BASIC_TYPE
# define VTK_SIZEOF_ID_TYPE VTK_SIZEOF___INT64
# define VTK_LARGE_ID VTK___INT64_MAX
# else
# error "VTK_USE_64BIT_IDS is ON but no 64-bit integer type is available."
# endif
#else
typedef int vtkIdType;
#endif // VTK_USE_64BIT_IDS
# define VTK_SIZEOF_ID_TYPE VTK_SIZEOF_INT
# define VTK_LARGE_ID VTK_INT_MAX
#endif
#define __VTK_SYSTEM_INCLUDES__INSIDE