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__) && !defined(__WRAP_GCCXML__)
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 
98 #define vtkGetWindowLong GetWindowLongPtr
99 #define vtkSetWindowLong SetWindowLongPtr
100 #define vtkLONG LONG_PTR
101 #define vtkGWL_WNDPROC GWLP_WNDPROC
102 #define vtkGWL_HINSTANCE GWLP_HINSTANCE
103 #define vtkGWL_USERDATA GWLP_USERDATA
104 
105 #endif
106 
107 #if defined(_MSC_VER)
108  // Enable MSVC compiler warning messages that are useful but off by default.
109 # pragma warning ( default : 4263 ) /* no override, call convention differs */
110  // Disable MSVC compiler warning messages that often occur in valid code.
111 # if !defined(VTK_DISPLAY_WIN32_WARNINGS)
112 # pragma warning ( disable : 4003 ) /* not enough actual parameters for macro */
113 # pragma warning ( disable : 4097 ) /* typedef is synonym for class */
114 # pragma warning ( disable : 4127 ) /* conditional expression is constant */
115 # pragma warning ( disable : 4244 ) /* possible loss in conversion */
116 # pragma warning ( disable : 4251 ) /* missing DLL-interface */
117 # pragma warning ( disable : 4305 ) /* truncation from type1 to type2 */
118 # pragma warning ( disable : 4309 ) /* truncation of constant value */
119 # pragma warning ( disable : 4514 ) /* unreferenced inline function */
120 # pragma warning ( disable : 4706 ) /* assignment in conditional expression */
121 # pragma warning ( disable : 4710 ) /* function not inlined */
122 # pragma warning ( disable : 4786 ) /* identifier truncated in debug info */
123 # endif
124 #endif
125 
126 #if defined(__BORLANDC__) && (__BORLANDC__ < 0x660)
127  // Disable Borland compiler warning messages that often occur in valid code.
128 # if !defined(VTK_DISPLAY_WIN32_WARNINGS)
129 # pragma warn -8004 /* assigned a value that is never used */
130 # pragma warn -8008 /* condition is always false */
131 # pragma warn -8026 /* funcs w/class-by-value args not expanded inline */
132 # pragma warn -8027 /* functions w/ do/for/while not expanded inline */
133 # pragma warn -8060 /* possibly incorrect assignment */
134 # pragma warn -8066 /* unreachable code */
135 # pragma warn -8072 /* suspicious pointer arithmetic */
136 # endif
137 #endif
138 
139 // Now set up the generic VTK export macro.
140 #if defined(VTK_BUILD_SHARED_LIBS)
141 # define VTK_EXPORT VTK_ABI_EXPORT
142 #else
143 # define VTK_EXPORT
144 #endif
145 
146 #endif
147 // VTK-HeaderTest-Exclude: vtkWin32Header.h
Do_not_include_vtkWin32Header_directly_vtkSystemIncludes_includes_it