VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkWin32Header.h,v $ 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 00031 /* 00032 * This is a support for files on the disk that are larger than 2GB. 00033 * Since this is the first place that any include should happen, do this here. 00034 */ 00035 #ifdef VTK_REQUIRE_LARGE_FILE_SUPPORT 00036 # ifndef _LARGEFILE_SOURCE 00037 # define _LARGEFILE_SOURCE 00038 # endif 00039 # ifndef _LARGE_FILES 00040 # define _LARGE_FILES 00041 # endif 00042 # ifndef _FILE_OFFSET_BITS 00043 # define _FILE_OFFSET_BITS 64 00044 # endif 00045 #endif 00046 00047 00048 // 00049 // Windows specific stuff------------------------------------------ 00050 #if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) 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 # define VTK_WORKAROUND_WINDOWS_MANGLE 00091 00092 #if ( _MSC_VER >= 1300 ) // Visual studio .NET 00093 #pragma warning ( disable : 4311 ) 00094 #pragma warning ( disable : 4312 ) 00095 # define vtkGetWindowLong GetWindowLongPtr 00096 # define vtkSetWindowLong SetWindowLongPtr 00097 # define vtkLONG LONG_PTR 00098 # define vtkGWL_WNDPROC GWLP_WNDPROC 00099 # define vtkGWL_HINSTANCE GWLP_HINSTANCE 00100 # define vtkGWL_USERDATA GWLP_USERDATA 00101 #else // older or non-Visual studio 00102 # define vtkGetWindowLong GetWindowLong 00103 # define vtkSetWindowLong SetWindowLong 00104 # define vtkLONG LONG 00105 # define vtkGWL_WNDPROC GWL_WNDPROC 00106 # define vtkGWL_HINSTANCE GWL_HINSTANCE 00107 # define vtkGWL_USERDATA GWL_USERDATA 00108 #endif // 00109 00110 #endif 00111 00112 #if defined(_MSC_VER) 00113 // Enable MSVC compiler warning messages that are useful but off by default. 00114 # pragma warning ( default : 4263 ) /* no override, call convention differs */ 00115 // Disable MSVC compiler warning messages that often occur in valid code. 00116 # if !defined(VTK_DISPLAY_WIN32_WARNINGS) 00117 # pragma warning ( disable : 4003 ) /* not enough actual parameters for macro */ 00118 # pragma warning ( disable : 4097 ) /* typedef is synonym for class */ 00119 # pragma warning ( disable : 4127 ) /* conditional expression is constant */ 00120 # pragma warning ( disable : 4244 ) /* possible loss in conversion */ 00121 # pragma warning ( disable : 4251 ) /* missing DLL-interface */ 00122 # pragma warning ( disable : 4305 ) /* truncation from type1 to type2 */ 00123 # pragma warning ( disable : 4309 ) /* truncation of constant value */ 00124 # pragma warning ( disable : 4514 ) /* unreferenced inline function */ 00125 # pragma warning ( disable : 4706 ) /* assignment in conditional expression */ 00126 # pragma warning ( disable : 4710 ) /* function not inlined */ 00127 # pragma warning ( disable : 4786 ) /* identifier truncated in debug info */ 00128 # endif 00129 #endif 00130 00131 // MSVC 6.0 in release mode will warn about code it produces with its 00132 // optimizer. Disable the warnings specifically for this 00133 // configuration. Real warnings will be revealed by a debug build or 00134 // by other compilers. 00135 #if defined(_MSC_VER) && (_MSC_VER < 1300) && defined(NDEBUG) 00136 # pragma warning ( disable : 4701 ) /* Variable may be used uninitialized. */ 00137 # pragma warning ( disable : 4702 ) /* Unreachable code. */ 00138 #endif 00139 00140 #if defined(__BORLANDC__) 00141 // Disable Borland compiler warning messages that often occur in valid code. 00142 # if !defined(VTK_DISPLAY_WIN32_WARNINGS) 00143 # pragma warn -8004 /* assigned a value that is never used */ 00144 # pragma warn -8008 /* condition is always false */ 00145 # pragma warn -8026 /* funcs w/class-by-value args not expanded inline */ 00146 # pragma warn -8027 /* functions w/ do/for/while not expanded inline */ 00147 # pragma warn -8060 /* possibly incorrect assignment */ 00148 # pragma warn -8066 /* unreachable code */ 00149 # pragma warn -8072 /* suspicious pointer arithmetic */ 00150 # endif 00151 #endif 00152 00153 #if defined(WIN32) && defined(VTK_BUILD_SHARED_LIBS) 00154 #define VTK_EXPORT __declspec( dllexport ) 00155 00156 #if defined(vtkCommon_EXPORTS) 00157 #define VTK_COMMON_EXPORT __declspec( dllexport ) 00158 #else 00159 #define VTK_COMMON_EXPORT __declspec( dllimport ) 00160 #endif 00161 00162 #if defined(vtkFiltering_EXPORTS) 00163 #define VTK_FILTERING_EXPORT __declspec( dllexport ) 00164 #else 00165 #define VTK_FILTERING_EXPORT __declspec( dllimport ) 00166 #endif 00167 00168 #if defined(vtkImaging_EXPORTS) 00169 #define VTK_IMAGING_EXPORT __declspec( dllexport ) 00170 #else 00171 #define VTK_IMAGING_EXPORT __declspec( dllimport ) 00172 #endif 00173 00174 #if defined(vtkGenericFiltering_EXPORTS) 00175 #define VTK_GENERIC_FILTERING_EXPORT __declspec( dllexport ) 00176 #else 00177 #define VTK_GENERIC_FILTERING_EXPORT __declspec( dllimport ) 00178 #endif 00179 00180 #if defined(vtkGeovis_EXPORTS) 00181 #define VTK_GEOVIS_EXPORT __declspec( dllexport ) 00182 #else 00183 #define VTK_GEOVIS_EXPORT __declspec( dllimport ) 00184 #endif 00185 00186 #if defined(vtkGraphics_EXPORTS) 00187 #define VTK_GRAPHICS_EXPORT __declspec( dllexport ) 00188 #else 00189 #define VTK_GRAPHICS_EXPORT __declspec( dllimport ) 00190 #endif 00191 00192 #if defined(vtkInfovis_EXPORTS) 00193 #define VTK_INFOVIS_EXPORT __declspec( dllexport ) 00194 #else 00195 #define VTK_INFOVIS_EXPORT __declspec( dllimport ) 00196 #endif 00197 00198 #if defined(vtkIO_EXPORTS) 00199 #define VTK_IO_EXPORT __declspec( dllexport ) 00200 #else 00201 #define VTK_IO_EXPORT __declspec( dllimport ) 00202 #endif 00203 00204 #if defined(vtkRendering_EXPORTS) 00205 #define VTK_RENDERING_EXPORT __declspec( dllexport ) 00206 #else 00207 #define VTK_RENDERING_EXPORT __declspec( dllimport ) 00208 #endif 00209 00210 #if defined(vtkVolumeRendering_EXPORTS) 00211 #define VTK_VOLUMERENDERING_EXPORT __declspec( dllexport ) 00212 #else 00213 #define VTK_VOLUMERENDERING_EXPORT __declspec( dllimport ) 00214 #endif 00215 00216 #if defined(vtkHybrid_EXPORTS) 00217 #define VTK_HYBRID_EXPORT __declspec( dllexport ) 00218 #else 00219 #define VTK_HYBRID_EXPORT __declspec( dllimport ) 00220 #endif 00221 00222 #if defined(vtkWidgets_EXPORTS) 00223 #define VTK_WIDGETS_EXPORT __declspec( dllexport ) 00224 #else 00225 #define VTK_WIDGETS_EXPORT __declspec( dllimport ) 00226 #endif 00227 00228 #if defined(vtkParallel_EXPORTS) 00229 #define VTK_PARALLEL_EXPORT __declspec( dllexport ) 00230 #else 00231 #define VTK_PARALLEL_EXPORT __declspec( dllimport ) 00232 #endif 00233 00234 #if defined(vtkViews_EXPORTS) 00235 #define VTK_VIEWS_EXPORT __declspec( dllexport ) 00236 #else 00237 #define VTK_VIEWS_EXPORT __declspec( dllimport ) 00238 #endif 00239 00240 #else 00241 #define VTK_COMMON_EXPORT 00242 #define VTK_FILTERING_EXPORT 00243 #define VTK_GENERIC_FILTERING_EXPORT 00244 #define VTK_GEOVIS_EXPORT 00245 #define VTK_GRAPHICS_EXPORT 00246 #define VTK_IMAGING_EXPORT 00247 #define VTK_INFOVIS_EXPORT 00248 #define VTK_IO_EXPORT 00249 #define VTK_RENDERING_EXPORT 00250 #define VTK_VOLUMERENDERING_EXPORT 00251 #define VTK_HYBRID_EXPORT 00252 #define VTK_WIDGETS_EXPORT 00253 #define VTK_PARALLEL_EXPORT 00254 #define VTK_VIEWS_EXPORT 00255 #define VTK_EXPORT 00256 #endif 00257 00258 // this is exclusively for the tcl Init functions 00259 #if defined(WIN32) 00260 #define VTK_TK_EXPORT __declspec( dllexport ) 00261 #else 00262 #define VTK_TK_EXPORT 00263 #endif 00264 00265 #endif