VTK
vtkWin32Header.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkWin32Header.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
22 #ifndef __vtkWIN32Header_h
23 #define __vtkWIN32Header_h
24 
25 #ifndef __VTK_SYSTEM_INCLUDES__INSIDE
27 #endif
28 
29 #include "vtkConfigure.h"
30 #include "vtkABI.h"
31 
32 /*
33  * This is a support for files on the disk that are larger than 2GB.
34  * Since this is the first place that any include should happen, do this here.
35  */
36 #ifdef VTK_REQUIRE_LARGE_FILE_SUPPORT
37 # ifndef _LARGEFILE_SOURCE
38 # define _LARGEFILE_SOURCE
39 # endif
40 # ifndef _LARGE_FILES
41 # define _LARGE_FILES
42 # endif
43 # ifndef _FILE_OFFSET_BITS
44 # define _FILE_OFFSET_BITS 64
45 # endif
46 #endif
47 
48 //
49 // Windows specific stuff------------------------------------------
50 #if defined(_WIN32) || defined(WIN32)
51 
52 // define strict header for windows
53 #ifndef STRICT
54 #define STRICT
55 #endif
56 
57 #ifdef VTK_USE_ANSI_STDLIB
58 #ifndef NOMINMAX
59 #define NOMINMAX
60 #endif
61 #endif
62 
63 #endif
64 
65 // Never include the windows header here when building VTK itself.
66 #if defined(VTK_IN_VTK)
67 # undef VTK_INCLUDE_WINDOWS_H
68 #endif
69 
70 #if defined(_WIN32)
71  // Include the windows header here only if requested by user code.
72 # if defined(VTK_INCLUDE_WINDOWS_H)
73 # include <windows.h>
74  // Define types from the windows header file.
75  typedef DWORD vtkWindowsDWORD;
76  typedef PVOID vtkWindowsPVOID;
77  typedef LPVOID vtkWindowsLPVOID;
78  typedef HANDLE vtkWindowsHANDLE;
79  typedef LPTHREAD_START_ROUTINE vtkWindowsLPTHREAD_START_ROUTINE;
80 # else
81  // Define types from the windows header file.
82  typedef unsigned long vtkWindowsDWORD;
83  typedef void* vtkWindowsPVOID;
84  typedef vtkWindowsPVOID vtkWindowsLPVOID;
85  typedef vtkWindowsPVOID vtkWindowsHANDLE;
86  typedef vtkWindowsDWORD (__stdcall *vtkWindowsLPTHREAD_START_ROUTINE)(vtkWindowsLPVOID);
87 # endif
88  // Enable workaround for windows header name mangling.
89  // See VTK/Utilities/Upgrading/README.WindowsMangling.txt for details.
90 #if !defined(__WRAP__)
91 # define VTK_WORKAROUND_WINDOWS_MANGLE
92 #endif
93 
94 #if ( _MSC_VER >= 1300 ) // Visual studio .NET
95 #pragma warning ( disable : 4311 )
96 #pragma warning ( disable : 4312 )
97 # define vtkGetWindowLong GetWindowLongPtr
98 # define vtkSetWindowLong SetWindowLongPtr
99 # define vtkLONG LONG_PTR
100 # define vtkGWL_WNDPROC GWLP_WNDPROC
101 # define vtkGWL_HINSTANCE GWLP_HINSTANCE
102 # define vtkGWL_USERDATA GWLP_USERDATA
103 #else // older or non-Visual studio
104 # define vtkGetWindowLong GetWindowLong
105 # define vtkSetWindowLong SetWindowLong
106 # define vtkLONG LONG
107 # ifdef _WIN64
108 # define vtkGWL_WNDPROC GWLP_WNDPROC
109 # define vtkGWL_HINSTANCE GWLP_HINSTANCE
110 # define vtkGWL_USERDATA GWLP_USERDATA
111 # else
112 # define vtkGWL_WNDPROC GWL_WNDPROC
113 # define vtkGWL_HINSTANCE GWL_HINSTANCE
114 # define vtkGWL_USERDATA GWL_USERDATA
115 # endif
116 #endif //
117 
118 #endif
119 
120 #if defined(_MSC_VER)
121  // Enable MSVC compiler warning messages that are useful but off by default.
122 # pragma warning ( default : 4263 ) /* no override, call convention differs */
123  // Disable MSVC compiler warning messages that often occur in valid code.
124 # if !defined(VTK_DISPLAY_WIN32_WARNINGS)
125 # pragma warning ( disable : 4003 ) /* not enough actual parameters for macro */
126 # pragma warning ( disable : 4097 ) /* typedef is synonym for class */
127 # pragma warning ( disable : 4127 ) /* conditional expression is constant */
128 # pragma warning ( disable : 4244 ) /* possible loss in conversion */
129 # pragma warning ( disable : 4251 ) /* missing DLL-interface */
130 # pragma warning ( disable : 4305 ) /* truncation from type1 to type2 */
131 # pragma warning ( disable : 4309 ) /* truncation of constant value */
132 # pragma warning ( disable : 4514 ) /* unreferenced inline function */
133 # pragma warning ( disable : 4706 ) /* assignment in conditional expression */
134 # pragma warning ( disable : 4710 ) /* function not inlined */
135 # pragma warning ( disable : 4786 ) /* identifier truncated in debug info */
136 # endif
137 #endif
138 
139 // MSVC 6.0 in release mode will warn about code it produces with its
140 // optimizer. Disable the warnings specifically for this
141 // configuration. Real warnings will be revealed by a debug build or
142 // by other compilers.
143 #if defined(_MSC_VER) && (_MSC_VER < 1300) && defined(NDEBUG)
144 # pragma warning ( disable : 4701 ) /* Variable may be used uninitialized. */
145 # pragma warning ( disable : 4702 ) /* Unreachable code. */
146 #endif
147 
148 #if defined(__BORLANDC__)
149  // Disable Borland compiler warning messages that often occur in valid code.
150 # if !defined(VTK_DISPLAY_WIN32_WARNINGS)
151 # pragma warn -8004 /* assigned a value that is never used */
152 # pragma warn -8008 /* condition is always false */
153 # pragma warn -8026 /* funcs w/class-by-value args not expanded inline */
154 # pragma warn -8027 /* functions w/ do/for/while not expanded inline */
155 # pragma warn -8060 /* possibly incorrect assignment */
156 # pragma warn -8066 /* unreachable code */
157 # pragma warn -8072 /* suspicious pointer arithmetic */
158 # endif
159 #endif
160 
161 // Now set up all of the export macros for the VTK kits
162 #if defined(VTK_BUILD_SHARED_LIBS)
163 
164  #define VTK_EXPORT VTK_ABI_EXPORT
165 
166  #if defined(vtkCommon_EXPORTS)
167  #define VTK_COMMON_EXPORT VTK_ABI_EXPORT
168  #else
169  #define VTK_COMMON_EXPORT VTK_ABI_IMPORT
170  #endif
171 
172  #if defined(vtkFiltering_EXPORTS)
173  #define VTK_FILTERING_EXPORT VTK_ABI_EXPORT
174  #else
175  #define VTK_FILTERING_EXPORT VTK_ABI_IMPORT
176  #endif
177 
178  #if defined(vtkImaging_EXPORTS)
179  #define VTK_IMAGING_EXPORT VTK_ABI_EXPORT
180  #else
181  #define VTK_IMAGING_EXPORT VTK_ABI_IMPORT
182  #endif
183 
184  #if defined(vtkGenericFiltering_EXPORTS)
185  #define VTK_GENERIC_FILTERING_EXPORT VTK_ABI_EXPORT
186  #else
187  #define VTK_GENERIC_FILTERING_EXPORT VTK_ABI_IMPORT
188  #endif
189 
190  #if defined(vtkGeovis_EXPORTS)
191  #define VTK_GEOVIS_EXPORT VTK_ABI_EXPORT
192  #else
193  #define VTK_GEOVIS_EXPORT VTK_ABI_IMPORT
194  #endif
195 
196  #if defined(vtkGraphics_EXPORTS)
197  #define VTK_GRAPHICS_EXPORT VTK_ABI_EXPORT
198  #else
199  #define VTK_GRAPHICS_EXPORT VTK_ABI_IMPORT
200  #endif
201 
202  #if defined(vtkGraphicsJava_EXPORTS)
203  #define VTK_GRAPHICS_JAVA_EXPORT VTK_ABI_EXPORT
204  #else
205  #define VTK_GRAPHICS_JAVA_EXPORT VTK_ABI_IMPORT
206  #endif
207 
208  #if defined(vtkInfovis_EXPORTS)
209  #define VTK_INFOVIS_EXPORT VTK_ABI_EXPORT
210  #else
211  #define VTK_INFOVIS_EXPORT VTK_ABI_IMPORT
212  #endif
213 
214  #if defined(vtkIO_EXPORTS)
215  #define VTK_IO_EXPORT VTK_ABI_EXPORT
216  #else
217  #define VTK_IO_EXPORT VTK_ABI_IMPORT
218  #endif
219 
220  #if defined(vtkRendering_EXPORTS)
221  #define VTK_RENDERING_EXPORT VTK_ABI_EXPORT
222  #else
223  #define VTK_RENDERING_EXPORT VTK_ABI_IMPORT
224  #endif
225 
226  #if defined(vtkTextAnalysis_EXPORTS)
227  #define VTK_TEXT_ANALYSIS_EXPORT VTK_ABI_EXPORT
228  #else
229  #define VTK_TEXT_ANALYSIS_EXPORT VTK_ABI_IMPORT
230  #endif
231 
232  #if defined(vtkVolumeRendering_EXPORTS)
233  #define VTK_VOLUMERENDERING_EXPORT VTK_ABI_EXPORT
234  #else
235  #define VTK_VOLUMERENDERING_EXPORT VTK_ABI_IMPORT
236  #endif
237 
238  #if defined(vtkHybrid_EXPORTS)
239  #define VTK_HYBRID_EXPORT VTK_ABI_EXPORT
240  #else
241  #define VTK_HYBRID_EXPORT VTK_ABI_IMPORT
242  #endif
243 
244  #if defined(vtkWidgets_EXPORTS)
245  #define VTK_WIDGETS_EXPORT VTK_ABI_EXPORT
246  #else
247  #define VTK_WIDGETS_EXPORT VTK_ABI_IMPORT
248  #endif
249 
250  #if defined(vtkParallel_EXPORTS)
251  #define VTK_PARALLEL_EXPORT VTK_ABI_EXPORT
252  #else
253  #define VTK_PARALLEL_EXPORT VTK_ABI_IMPORT
254  #endif
255 
256  #if defined(vtkViews_EXPORTS)
257  #define VTK_VIEWS_EXPORT VTK_ABI_EXPORT
258  #else
259  #define VTK_VIEWS_EXPORT VTK_ABI_IMPORT
260  #endif
261 
262  #if defined(vtkCharts_EXPORTS)
263  #define VTK_CHARTS_EXPORT VTK_ABI_EXPORT
264  #else
265  #define VTK_CHARTS_EXPORT VTK_ABI_IMPORT
266  #endif
267 
268 #else
269  #define VTK_COMMON_EXPORT
270  #define VTK_FILTERING_EXPORT
271  #define VTK_GENERIC_FILTERING_EXPORT
272  #define VTK_GEOVIS_EXPORT
273  #define VTK_GRAPHICS_EXPORT
274  #define VTK_GRAPHICS_JAVA_EXPORT
275  #define VTK_IMAGING_EXPORT
276  #define VTK_INFOVIS_EXPORT
277  #define VTK_IO_EXPORT
278  #define VTK_RENDERING_EXPORT
279  #define VTK_TEXT_ANALYSIS_EXPORT
280  #define VTK_VOLUMERENDERING_EXPORT
281  #define VTK_HYBRID_EXPORT
282  #define VTK_WIDGETS_EXPORT
283  #define VTK_PARALLEL_EXPORT
284  #define VTK_VIEWS_EXPORT
285  #define VTK_CHARTS_EXPORT
286  #define VTK_EXPORT
287 #endif
288 
289 // this is exclusively for the tcl Init functions
290 #define VTK_TK_EXPORT VTK_ABI_EXPORT
291 
292 #endif
Do_not_include_vtkWin32Header_directly__vtkSystemIncludes_includes_it