VTK  9.1.20211028
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 "vtkABI.h"
31 #include "vtkBuild.h" // For VTK_BUILD_SHARED_LIBS
32 #include "vtkPlatform.h" // for VTK_REQUIRE_LARGE_FILE_SUPPORT
33 
34 /*
35  * This is a support for files on the disk that are larger than 2GB.
36  * Since this is the first place that any include should happen, do this here.
37  */
38 #ifdef VTK_REQUIRE_LARGE_FILE_SUPPORT
39 #ifndef _LARGEFILE_SOURCE
40 #define _LARGEFILE_SOURCE
41 #endif
42 #ifndef _LARGE_FILES
43 #define _LARGE_FILES
44 #endif
45 #ifndef _FILE_OFFSET_BITS
46 #define _FILE_OFFSET_BITS 64
47 #endif
48 #endif
49 
50 //
51 // Windows specific stuff------------------------------------------
52 #if defined(_WIN32)
53 
54 // define strict header for windows
55 #ifndef STRICT
56 #define STRICT
57 #endif
58 
59 #ifndef NOMINMAX
60 #define NOMINMAX
61 #endif
62 
63 #endif
64 
65 #if defined(_WIN32)
66 // Include the windows header here only if requested by user code.
67 #if defined(VTK_INCLUDE_WINDOWS_H)
68 #include <windows.h>
69 // Define types from the windows header file.
70 typedef DWORD vtkWindowsDWORD;
71 typedef PVOID vtkWindowsPVOID;
72 typedef LPVOID vtkWindowsLPVOID;
73 typedef HANDLE vtkWindowsHANDLE;
74 typedef LPTHREAD_START_ROUTINE vtkWindowsLPTHREAD_START_ROUTINE;
75 #else
76 // Define types from the windows header file.
77 typedef unsigned long vtkWindowsDWORD;
78 typedef void* vtkWindowsPVOID;
79 typedef vtkWindowsPVOID vtkWindowsLPVOID;
80 typedef vtkWindowsPVOID vtkWindowsHANDLE;
81 typedef vtkWindowsDWORD(__stdcall* vtkWindowsLPTHREAD_START_ROUTINE)(vtkWindowsLPVOID);
82 #endif
83 // Enable workaround for windows header name mangling.
84 // See VTK/Utilities/Upgrading/README.WindowsMangling.txt for details.
85 #if !defined(__VTK_WRAP__) && !defined(__WRAP_GCCXML__)
86 #define VTK_WORKAROUND_WINDOWS_MANGLE
87 #endif
88 
89 #if defined(_MSC_VER) // Visual studio
90 #pragma warning(disable : 4311)
91 #pragma warning(disable : 4312)
92 #endif
93 
94 #define vtkGetWindowLong GetWindowLongPtr
95 #define vtkSetWindowLong SetWindowLongPtr
96 #define vtkLONG LONG_PTR
97 #define vtkGWL_WNDPROC GWLP_WNDPROC
98 #define vtkGWL_HINSTANCE GWLP_HINSTANCE
99 #define vtkGWL_USERDATA GWLP_USERDATA
100 
101 #endif
102 
103 #if defined(_MSC_VER)
104 // Enable MSVC compiler warning messages that are useful but off by default.
105 #pragma warning(default : 4263) /* no override, call convention differs */
106 // Disable MSVC compiler warning messages that often occur in valid code.
107 #if !defined(VTK_DISPLAY_WIN32_WARNINGS)
108 #pragma warning(disable : 4003) /* not enough actual parameters for macro */
109 #pragma warning(disable : 4097) /* typedef is synonym for class */
110 #pragma warning(disable : 4127) /* conditional expression is constant */
111 #pragma warning(disable : 4244) /* possible loss in conversion */
112 #pragma warning(disable : 4251) /* missing DLL-interface */
113 #pragma warning(disable : 4305) /* truncation from type1 to type2 */
114 #pragma warning(disable : 4309) /* truncation of constant value */
115 #pragma warning(disable : 4514) /* unreferenced inline function */
116 #pragma warning(disable : 4706) /* assignment in conditional expression */
117 #pragma warning(disable : 4710) /* function not inlined */
118 #pragma warning(disable : 4786) /* identifier truncated in debug info */
119 #endif
120 #endif
121 
122 // Now set up the generic VTK export macro.
123 #if defined(VTK_BUILD_SHARED_LIBS)
124 #define VTK_EXPORT VTK_ABI_EXPORT
125 #else
126 #define VTK_EXPORT
127 #endif
128 
129 #endif
130 // VTK-HeaderTest-Exclude: vtkWin32Header.h
Do_not_include_vtkWin32Header_directly_vtkSystemIncludes_includes_it