vtkConfigure.h.in 5.86 KB
Newer Older
1
/*=========================================================================
Ken Martin's avatar
Ken Martin committed
2

3 4
  Program:   Visualization Toolkit
  Module:    vtkConfigure.h.in
Ken Martin's avatar
Ken Martin committed
5

6
  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 8
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
Ken Martin's avatar
Ken Martin committed
9

10 11
     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12
     PURPOSE.  See the above copyright notice for more information.
Ken Martin's avatar
Ken Martin committed
13

14
=========================================================================*/
15 16
#ifndef vtkConfigure_h
#define vtkConfigure_h
17

18
/* This header is configured by VTK's build process.  */
19

20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
/*--------------------------------------------------------------------------*/
/* Compiler backend                                                         */
/* Be careful modifying this -- order is important.                         */
#if defined(_MSC_VER)
/* MSVC 2015+ can use a clang frontend, so we want to label it only as MSVC
 * and not MSVC and clang. */
#define VTK_COMPILER_MSVC

#elif defined(__INTEL_COMPILER)
/* Intel 14+ on OSX uses a clang frontend, so again we want to label them as
 * intel only, and not intel and clang. */
#define VTK_COMPILER_ICC

#elif defined(__PGI)
/* PGI reports as GNUC as it generates the same ABI, so we need to check for
 * it before gcc. */
#define VTK_COMPILER_PGI

#elif defined(__clang__)
/* Check for clang before GCC, as clang says it is GNUC since it has ABI
 * compliance. */
#define VTK_COMPILER_CLANG

#elif defined(__GNUC__)
/* Several compilers pretend to be GCC but have minor differences. Try to
 * compensate for that, by checking for those compilers first. */
#define VTK_COMPILER_GCC
#define VTK_COMPILER_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + \
                                  __GNUC_PATCHLEVEL__)
#endif

51 52
/*--------------------------------------------------------------------------*/
/* Platform Features                                                        */
53

54
/* Byte order.  */
55 56 57 58 59 60 61
/* All compilers that support Mac OS X define either __BIG_ENDIAN__ or
   __LITTLE_ENDIAN__ to match the endianness of the architecture being
   compiled for. This is not necessarily the same as the architecture of the
   machine doing the building. In order to support Universal Binaries on
   Mac OS X, we prefer those defines to decide the endianness.
   On other platforms we use the result of the TRY_RUN. */
#if !defined(__APPLE__)
62
 #cmakedefine VTK_WORDS_BIGENDIAN
63 64 65
#elif defined(__BIG_ENDIAN__)
# define VTK_WORDS_BIGENDIAN
#endif
66 67 68 69 70 71

/* Threading system.  */
#cmakedefine VTK_USE_PTHREADS
#cmakedefine VTK_USE_SPROC
#cmakedefine VTK_HP_PTHREADS
#cmakedefine VTK_USE_WIN32_THREADS
72
# define VTK_MAX_THREADS @VTK_MAX_THREADS@
73

74
/* Atomic operations */
75
#cmakedefine VTK_HAVE_SYNC_BUILTINS
76
#if defined(_WIN32)
77 78
 #cmakedefine VTK_HAS_INTERLOCKEDADD
#endif
79

80 81 82 83
/* vtkSMPTools back-end */
#define VTK_SMP_@VTK_SMP_IMPLEMENTATION_TYPE@
#define VTK_SMP_BACKEND "@VTK_SMP_IMPLEMENTATION_TYPE@"

84
/* Compiler features.  */
85
#cmakedefine VTK_HAVE_GETSOCKNAME_WITH_SOCKLEN_T
86
#cmakedefine VTK_HAVE_SO_REUSEADDR
87

88 89 90
/* Whether we require large files support.  */
#cmakedefine VTK_REQUIRE_LARGE_FILE_SUPPORT

91 92 93
/* Whether reverse const iterator's have comparison operators. */
#cmakedefine VTK_CONST_REVERSE_ITERATOR_COMPARISON

94 95
/*--------------------------------------------------------------------------*/
/* VTK Platform Configuration                                               */
96

97 98 99
/* Whether the target platform supports shared libraries.  */
#cmakedefine VTK_TARGET_SUPPORTS_SHARED_LIBS

100
/* Whether we are building shared libraries.  */
101
#cmakedefine VTK_BUILD_SHARED_LIBS
102

103
/* Whether vtkIdType is a 64-bit integer type (or a 32-bit integer type).  */
Charles Law's avatar
Charles Law committed
104 105
#cmakedefine VTK_USE_64BIT_IDS

106
@VTK_CONFIG_LEGACY_VERSION@
107

108 109 110
/* C++ compiler used.  */
#define VTK_CXX_COMPILER "@CMAKE_CXX_COMPILER@"

111 112 113 114
/* Compatibility settings.  */
#cmakedefine VTK_LEGACY_REMOVE
#cmakedefine VTK_LEGACY_SILENT

115 116 117
/* Debug leaks support.  */
#cmakedefine VTK_DEBUG_LEAKS

118 119 120
/* Print warning on vtkArrayDispatch failure.  */
#cmakedefine VTK_WARN_ON_DISPATCH_FAILURE

121 122 123
/* Should all New methods use the object factory override. */
#cmakedefine VTK_ALL_NEW_OBJECT_FACTORY

124 125 126
/*--------------------------------------------------------------------------*/
/* Setup VTK based on platform features and configuration.                  */

127 128 129 130 131
/* We now always use standard streams.  */
#ifndef VTK_LEGACY_REMOVE
# define VTK_USE_ANSI_STDLIB
#endif

132
/* Setup vtkstd, a portable namespace for std.  */
133
#ifndef VTK_LEGACY_REMOVE
134
# define vtkstd std
135 136
#endif

137
/* Define a "vtkstd_bool" for backwards compatibility.  Only use bool
138
   if this file is included by a c++ file. */
139
#ifndef VTK_LEGACY_REMOVE
140
# if defined(__cplusplus)
141 142 143 144
  typedef bool vtkstd_bool;
# else
  typedef int vtkstd_bool;
# endif
145 146
#endif

Bill Lorensen's avatar
Bill Lorensen committed
147 148 149 150 151 152 153 154 155 156 157
/* The maximum length of a file name in bytes including the
 * terminating null.
 */
#if defined(PATH_MAX) // Usually defined on Windows
# define VTK_MAXPATH PATH_MAX
#elif defined(MAXPATHLEN)  // Usually defined on linux
# define VTK_MAXPATH MAXPATHLEN
#else
# define VTK_MAXPATH 32767 // Possible with Windows "extended paths"
#endif

158 159 160 161 162 163 164 165 166
#cmakedefine VTK_USE_CXX11_FEATURES
#ifdef VTK_USE_CXX11_FEATURES
# define VTK_OVERRIDE override
# define VTK_FINAL final
#else
# define VTK_OVERRIDE
# define VTK_FINAL
#endif

167 168 169 170 171 172
/** std::auto_ptr is deprecated in C++11 and will be removed in C++17
 *  use std::unique_ptr in C++11 and later compilers.
 */
#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >=1700)\
 || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520)
# define VTK_HAS_STD_UNIQUE_PTR
173
#endif
174

175 176 177 178 179 180 181 182
/* MS Visual Studio 2015 finally supports C99/C++11's snprintf but
 * for older versions, use _snprintf instead. Annoyingly, its semantics
 * are slightly different, but still better than using sprintf.
 */
#if defined(_MSC_VER) && (_MSC_VER < 1900)
# define snprintf _snprintf
#endif

183
#endif // vtkConfigure_h