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 =========================================================================*/
23 #ifndef vtkWin32Header_h
24 #define vtkWin32Header_h
25 
26 #ifndef __VTK_SYSTEM_INCLUDES__INSIDE
28 #endif
29 
30 #include "vtkConfigure.h"
31 #include "vtkABI.h"
32 
33 /*
34  * This is a support for files on the disk that are larger than 2GB.
35  * Since this is the first place that any include should happen, do this here.
36  */
37 #ifdef VTK_REQUIRE_LARGE_FILE_SUPPORT
38 # ifndef _LARGEFILE_SOURCE
39 # define _LARGEFILE_SOURCE
40 # endif
41 # ifndef _LARGE_FILES
42 # define _LARGE_FILES
43 # endif
44 # ifndef _FILE_OFFSET_BITS
45 # define _FILE_OFFSET_BITS 64
46 # endif
47 #endif
48 
49 //
50 // Windows specific stuff------------------------------------------
51 #if defined(_WIN32)
52 
53 // define strict header for windows
54 #ifndef STRICT
55 #define STRICT
56 #endif
57 
58 #ifndef NOMINMAX
59 #define NOMINMAX
60 #endif
61 
62 #endif
63 
64 // Never include the windows header here when building VTK itself.
65 #if defined(VTK_IN_VTK)
66 # undef VTK_INCLUDE_WINDOWS_H
67 #endif
68 
69 #if defined(_WIN32)
70  // Include the windows header here only if requested by user code.
71 # if defined(VTK_INCLUDE_WINDOWS_H)
72 # include <windows.h>
73  // Define types from the windows header file.
74  typedef DWORD vtkWindowsDWORD;
75  typedef PVOID vtkWindowsPVOID;
76  typedef LPVOID vtkWindowsLPVOID;
77  typedef HANDLE vtkWindowsHANDLE;
78  typedef LPTHREAD_START_ROUTINE vtkWindowsLPTHREAD_START_ROUTINE;
79 # else
80  // Define types from the windows header file.
81  typedef unsigned long vtkWindowsDWORD;
82  typedef void* vtkWindowsPVOID;
83  typedef vtkWindowsPVOID vtkWindowsLPVOID;
84  typedef vtkWindowsPVOID vtkWindowsHANDLE;
85  typedef vtkWindowsDWORD (__stdcall *vtkWindowsLPTHREAD_START_ROUTINE)(vtkWindowsLPVOID);
86 # endif
87  // Enable workaround for windows header name mangling.
88  // See VTK/Utilities/Upgrading/README.WindowsMangling.txt for details.
89 #if !defined(__VTK_WRAP__)
90 # define VTK_WORKAROUND_WINDOWS_MANGLE
91 #endif
92 
93 #if defined(_MSC_VER) // Visual studio
94 #pragma warning ( disable : 4311 )
95 #pragma warning ( disable : 4312 )
96 #endif //
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 
104 #endif
105 
106 #if defined(_MSC_VER)
107  // Enable MSVC compiler warning messages that are useful but off by default.
108 # pragma warning ( default : 4263 ) /* no override, call convention differs */
109  // Disable MSVC compiler warning messages that often occur in valid code.
110 # if !defined(VTK_DISPLAY_WIN32_WARNINGS)
111 # pragma warning ( disable : 4003 ) /* not enough actual parameters for macro */
112 # pragma warning ( disable : 4097 ) /* typedef is synonym for class */
113 # pragma warning ( disable : 4127 ) /* conditional expression is constant */
114 # pragma warning ( disable : 4244 ) /* possible loss in conversion */
115 # pragma warning ( disable : 4251 ) /* missing DLL-interface */
116 # pragma warning ( disable : 4305 ) /* truncation from type1 to type2 */
117 # pragma warning ( disable : 4309 ) /* truncation of constant value */
118 # pragma warning ( disable : 4514 ) /* unreferenced inline function */
119 # pragma warning ( disable : 4706 ) /* assignment in conditional expression */
120 # pragma warning ( disable : 4710 ) /* function not inlined */
121 # pragma warning ( disable : 4786 ) /* identifier truncated in debug info */
122 # endif
123 #endif
124 
125 #if defined(__BORLANDC__)
126  // Disable Borland compiler warning messages that often occur in valid code.
127 # if !defined(VTK_DISPLAY_WIN32_WARNINGS)
128 # pragma warn -8004 /* assigned a value that is never used */
129 # pragma warn -8008 /* condition is always false */
130 # pragma warn -8026 /* funcs w/class-by-value args not expanded inline */
131 # pragma warn -8027 /* functions w/ do/for/while not expanded inline */
132 # pragma warn -8060 /* possibly incorrect assignment */
133 # pragma warn -8066 /* unreachable code */
134 # pragma warn -8072 /* suspicious pointer arithmetic */
135 # endif
136 #endif
137 
138 // Now set up the generic VTK export macro.
139 #if defined(VTK_BUILD_SHARED_LIBS)
140 # define VTK_EXPORT VTK_ABI_EXPORT
141 #else
142 # define VTK_EXPORT
143 #endif
144 
145 // this is exclusively for the tcl Init functions
146 #define VTK_TK_EXPORT VTK_ABI_EXPORT
147 
148 #endif
149 // VTK-HeaderTest-Exclude: vtkWin32Header.h
Do_not_include_vtkWin32Header_directly__vtkSystemIncludes_includes_it