VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkWin32Header.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00022 #ifndef __vtkWIN32Header_h 00023 #define __vtkWIN32Header_h 00024 00025 #ifndef __VTK_SYSTEM_INCLUDES__INSIDE 00026 Do_not_include_vtkWin32Header_directly__vtkSystemIncludes_includes_it; 00027 #endif 00028 00029 #include "vtkConfigure.h" 00030 #include "vtkABI.h" 00031 00032 /* 00033 * This is a support for files on the disk that are larger than 2GB. 00034 * Since this is the first place that any include should happen, do this here. 00035 */ 00036 #ifdef VTK_REQUIRE_LARGE_FILE_SUPPORT 00037 # ifndef _LARGEFILE_SOURCE 00038 # define _LARGEFILE_SOURCE 00039 # endif 00040 # ifndef _LARGE_FILES 00041 # define _LARGE_FILES 00042 # endif 00043 # ifndef _FILE_OFFSET_BITS 00044 # define _FILE_OFFSET_BITS 64 00045 # endif 00046 #endif 00047 00048 // 00049 // Windows specific stuff------------------------------------------ 00050 #if defined(_WIN32) || defined(WIN32) 00051 00052 // define strict header for windows 00053 #ifndef STRICT 00054 #define STRICT 00055 #endif 00056 00057 #ifdef VTK_USE_ANSI_STDLIB 00058 #ifndef NOMINMAX 00059 #define NOMINMAX 00060 #endif 00061 #endif 00062 00063 #endif 00064 00065 // Never include the windows header here when building VTK itself. 00066 #if defined(VTK_IN_VTK) 00067 # undef VTK_INCLUDE_WINDOWS_H 00068 #endif 00069 00070 #if defined(_WIN32) 00071 // Include the windows header here only if requested by user code. 00072 # if defined(VTK_INCLUDE_WINDOWS_H) 00073 # include <windows.h> 00074 // Define types from the windows header file. 00075 typedef DWORD vtkWindowsDWORD; 00076 typedef PVOID vtkWindowsPVOID; 00077 typedef LPVOID vtkWindowsLPVOID; 00078 typedef HANDLE vtkWindowsHANDLE; 00079 typedef LPTHREAD_START_ROUTINE vtkWindowsLPTHREAD_START_ROUTINE; 00080 # else 00081 // Define types from the windows header file. 00082 typedef unsigned long vtkWindowsDWORD; 00083 typedef void* vtkWindowsPVOID; 00084 typedef vtkWindowsPVOID vtkWindowsLPVOID; 00085 typedef vtkWindowsPVOID vtkWindowsHANDLE; 00086 typedef vtkWindowsDWORD (__stdcall *vtkWindowsLPTHREAD_START_ROUTINE)(vtkWindowsLPVOID); 00087 # endif 00088 // Enable workaround for windows header name mangling. 00089 // See VTK/Utilities/Upgrading/README.WindowsMangling.txt for details. 00090 #if !defined(__WRAP__) 00091 # define VTK_WORKAROUND_WINDOWS_MANGLE 00092 #endif 00093 00094 #if ( _MSC_VER >= 1300 ) // Visual studio .NET 00095 #pragma warning ( disable : 4311 ) 00096 #pragma warning ( disable : 4312 ) 00097 # define vtkGetWindowLong GetWindowLongPtr 00098 # define vtkSetWindowLong SetWindowLongPtr 00099 # define vtkLONG LONG_PTR 00100 # define vtkGWL_WNDPROC GWLP_WNDPROC 00101 # define vtkGWL_HINSTANCE GWLP_HINSTANCE 00102 # define vtkGWL_USERDATA GWLP_USERDATA 00103 #else // older or non-Visual studio 00104 # define vtkGetWindowLong GetWindowLong 00105 # define vtkSetWindowLong SetWindowLong 00106 # define vtkLONG LONG 00107 # ifdef _WIN64 00108 # define vtkGWL_WNDPROC GWLP_WNDPROC 00109 # define vtkGWL_HINSTANCE GWLP_HINSTANCE 00110 # define vtkGWL_USERDATA GWLP_USERDATA 00111 # else 00112 # define vtkGWL_WNDPROC GWL_WNDPROC 00113 # define vtkGWL_HINSTANCE GWL_HINSTANCE 00114 # define vtkGWL_USERDATA GWL_USERDATA 00115 # endif 00116 #endif // 00117 00118 #endif 00119 00120 #if defined(_MSC_VER) 00121 // Enable MSVC compiler warning messages that are useful but off by default. 00122 # pragma warning ( default : 4263 ) /* no override, call convention differs */ 00123 // Disable MSVC compiler warning messages that often occur in valid code. 00124 # if !defined(VTK_DISPLAY_WIN32_WARNINGS) 00125 # pragma warning ( disable : 4003 ) /* not enough actual parameters for macro */ 00126 # pragma warning ( disable : 4097 ) /* typedef is synonym for class */ 00127 # pragma warning ( disable : 4127 ) /* conditional expression is constant */ 00128 # pragma warning ( disable : 4244 ) /* possible loss in conversion */ 00129 # pragma warning ( disable : 4251 ) /* missing DLL-interface */ 00130 # pragma warning ( disable : 4305 ) /* truncation from type1 to type2 */ 00131 # pragma warning ( disable : 4309 ) /* truncation of constant value */ 00132 # pragma warning ( disable : 4514 ) /* unreferenced inline function */ 00133 # pragma warning ( disable : 4706 ) /* assignment in conditional expression */ 00134 # pragma warning ( disable : 4710 ) /* function not inlined */ 00135 # pragma warning ( disable : 4786 ) /* identifier truncated in debug info */ 00136 # endif 00137 #endif 00138 00139 // MSVC 6.0 in release mode will warn about code it produces with its 00140 // optimizer. Disable the warnings specifically for this 00141 // configuration. Real warnings will be revealed by a debug build or 00142 // by other compilers. 00143 #if defined(_MSC_VER) && (_MSC_VER < 1300) && defined(NDEBUG) 00144 # pragma warning ( disable : 4701 ) /* Variable may be used uninitialized. */ 00145 # pragma warning ( disable : 4702 ) /* Unreachable code. */ 00146 #endif 00147 00148 #if defined(__BORLANDC__) 00149 // Disable Borland compiler warning messages that often occur in valid code. 00150 # if !defined(VTK_DISPLAY_WIN32_WARNINGS) 00151 # pragma warn -8004 /* assigned a value that is never used */ 00152 # pragma warn -8008 /* condition is always false */ 00153 # pragma warn -8026 /* funcs w/class-by-value args not expanded inline */ 00154 # pragma warn -8027 /* functions w/ do/for/while not expanded inline */ 00155 # pragma warn -8060 /* possibly incorrect assignment */ 00156 # pragma warn -8066 /* unreachable code */ 00157 # pragma warn -8072 /* suspicious pointer arithmetic */ 00158 # endif 00159 #endif 00160 00161 // Now set up all of the export macros for the VTK kits 00162 #if defined(VTK_BUILD_SHARED_LIBS) 00163 00164 #define VTK_EXPORT VTK_ABI_EXPORT 00165 00166 #if defined(vtkCommon_EXPORTS) 00167 #define VTK_COMMON_EXPORT VTK_ABI_EXPORT 00168 #else 00169 #define VTK_COMMON_EXPORT VTK_ABI_IMPORT 00170 #endif 00171 00172 #if defined(vtkFiltering_EXPORTS) 00173 #define VTK_FILTERING_EXPORT VTK_ABI_EXPORT 00174 #else 00175 #define VTK_FILTERING_EXPORT VTK_ABI_IMPORT 00176 #endif 00177 00178 #if defined(vtkImaging_EXPORTS) 00179 #define VTK_IMAGING_EXPORT VTK_ABI_EXPORT 00180 #else 00181 #define VTK_IMAGING_EXPORT VTK_ABI_IMPORT 00182 #endif 00183 00184 #if defined(vtkGenericFiltering_EXPORTS) 00185 #define VTK_GENERIC_FILTERING_EXPORT VTK_ABI_EXPORT 00186 #else 00187 #define VTK_GENERIC_FILTERING_EXPORT VTK_ABI_IMPORT 00188 #endif 00189 00190 #if defined(vtkGeovis_EXPORTS) 00191 #define VTK_GEOVIS_EXPORT VTK_ABI_EXPORT 00192 #else 00193 #define VTK_GEOVIS_EXPORT VTK_ABI_IMPORT 00194 #endif 00195 00196 #if defined(vtkGraphics_EXPORTS) 00197 #define VTK_GRAPHICS_EXPORT VTK_ABI_EXPORT 00198 #else 00199 #define VTK_GRAPHICS_EXPORT VTK_ABI_IMPORT 00200 #endif 00201 00202 #if defined(vtkGraphicsJava_EXPORTS) 00203 #define VTK_GRAPHICS_JAVA_EXPORT VTK_ABI_EXPORT 00204 #else 00205 #define VTK_GRAPHICS_JAVA_EXPORT VTK_ABI_IMPORT 00206 #endif 00207 00208 #if defined(vtkInfovis_EXPORTS) 00209 #define VTK_INFOVIS_EXPORT VTK_ABI_EXPORT 00210 #else 00211 #define VTK_INFOVIS_EXPORT VTK_ABI_IMPORT 00212 #endif 00213 00214 #if defined(vtkIO_EXPORTS) 00215 #define VTK_IO_EXPORT VTK_ABI_EXPORT 00216 #else 00217 #define VTK_IO_EXPORT VTK_ABI_IMPORT 00218 #endif 00219 00220 #if defined(vtkRendering_EXPORTS) 00221 #define VTK_RENDERING_EXPORT VTK_ABI_EXPORT 00222 #else 00223 #define VTK_RENDERING_EXPORT VTK_ABI_IMPORT 00224 #endif 00225 00226 #if defined(vtkTextAnalysis_EXPORTS) 00227 #define VTK_TEXT_ANALYSIS_EXPORT VTK_ABI_EXPORT 00228 #else 00229 #define VTK_TEXT_ANALYSIS_EXPORT VTK_ABI_IMPORT 00230 #endif 00231 00232 #if defined(vtkVolumeRendering_EXPORTS) 00233 #define VTK_VOLUMERENDERING_EXPORT VTK_ABI_EXPORT 00234 #else 00235 #define VTK_VOLUMERENDERING_EXPORT VTK_ABI_IMPORT 00236 #endif 00237 00238 #if defined(vtkHybrid_EXPORTS) 00239 #define VTK_HYBRID_EXPORT VTK_ABI_EXPORT 00240 #else 00241 #define VTK_HYBRID_EXPORT VTK_ABI_IMPORT 00242 #endif 00243 00244 #if defined(vtkWidgets_EXPORTS) 00245 #define VTK_WIDGETS_EXPORT VTK_ABI_EXPORT 00246 #else 00247 #define VTK_WIDGETS_EXPORT VTK_ABI_IMPORT 00248 #endif 00249 00250 #if defined(vtkParallel_EXPORTS) 00251 #define VTK_PARALLEL_EXPORT VTK_ABI_EXPORT 00252 #else 00253 #define VTK_PARALLEL_EXPORT VTK_ABI_IMPORT 00254 #endif 00255 00256 #if defined(vtkViews_EXPORTS) 00257 #define VTK_VIEWS_EXPORT VTK_ABI_EXPORT 00258 #else 00259 #define VTK_VIEWS_EXPORT VTK_ABI_IMPORT 00260 #endif 00261 00262 #if defined(vtkCharts_EXPORTS) 00263 #define VTK_CHARTS_EXPORT VTK_ABI_EXPORT 00264 #else 00265 #define VTK_CHARTS_EXPORT VTK_ABI_IMPORT 00266 #endif 00267 00268 #if defined(vtkChemistry_EXPORTS) 00269 #define VTK_CHEMISTRY_EXPORT VTK_ABI_EXPORT 00270 #else 00271 #define VTK_CHEMISTRY_EXPORT VTK_ABI_IMPORT 00272 #endif 00273 00274 #else 00275 #define VTK_COMMON_EXPORT 00276 #define VTK_FILTERING_EXPORT 00277 #define VTK_GENERIC_FILTERING_EXPORT 00278 #define VTK_GEOVIS_EXPORT 00279 #define VTK_GRAPHICS_EXPORT 00280 #define VTK_GRAPHICS_JAVA_EXPORT 00281 #define VTK_IMAGING_EXPORT 00282 #define VTK_INFOVIS_EXPORT 00283 #define VTK_IO_EXPORT 00284 #define VTK_RENDERING_EXPORT 00285 #define VTK_TEXT_ANALYSIS_EXPORT 00286 #define VTK_VOLUMERENDERING_EXPORT 00287 #define VTK_HYBRID_EXPORT 00288 #define VTK_WIDGETS_EXPORT 00289 #define VTK_PARALLEL_EXPORT 00290 #define VTK_VIEWS_EXPORT 00291 #define VTK_CHARTS_EXPORT 00292 #define VTK_CHEMISTRY_EXPORT 00293 #define VTK_EXPORT 00294 #endif 00295 00296 // this is exclusively for the tcl Init functions 00297 #define VTK_TK_EXPORT VTK_ABI_EXPORT 00298 00299 #endif