VTK  9.2.20230528
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 (definition as itself ensures that no code breaks)
55 #ifdef STRICT
56 #undef STRICT
57 #endif
58 #define STRICT STRICT
59 
60 #ifndef NOMINMAX
61 #define NOMINMAX
62 #endif
63 
64 #endif
65 
66 #if defined(_WIN32)
67 // Include the windows header here only if requested by user code.
68 #if defined(VTK_INCLUDE_WINDOWS_H)
69 #include <windows.h>
70 // Define types from the windows header file.
71 typedef DWORD vtkWindowsDWORD;
72 typedef PVOID vtkWindowsPVOID;
73 typedef LPVOID vtkWindowsLPVOID;
74 typedef HANDLE vtkWindowsHANDLE;
75 typedef LPTHREAD_START_ROUTINE vtkWindowsLPTHREAD_START_ROUTINE;
76 #else
77 // Define types from the windows header file.
78 typedef unsigned long vtkWindowsDWORD;
79 typedef void* vtkWindowsPVOID;
80 typedef vtkWindowsPVOID vtkWindowsLPVOID;
81 typedef vtkWindowsPVOID vtkWindowsHANDLE;
82 typedef vtkWindowsDWORD(__stdcall* vtkWindowsLPTHREAD_START_ROUTINE)(vtkWindowsLPVOID);
83 #endif
84 // Enable workaround for windows header name mangling.
85 // See VTK/Utilities/Upgrading/README.WindowsMangling.txt for details.
86 #if !defined(__VTK_WRAP__) && !defined(__WRAP_GCCXML__)
87 #define VTK_WORKAROUND_WINDOWS_MANGLE
88 #endif
89 
90 #if defined(_MSC_VER) // Visual studio
91 #pragma warning(disable : 4311)
92 #pragma warning(disable : 4312)
93 #endif
94 
95 #define vtkGetWindowLong GetWindowLongPtr
96 #define vtkSetWindowLong SetWindowLongPtr
97 #define vtkLONG LONG_PTR
98 #define vtkGWL_WNDPROC GWLP_WNDPROC
99 #define vtkGWL_HINSTANCE GWLP_HINSTANCE
100 #define vtkGWL_USERDATA GWLP_USERDATA
101 
102 #endif
103 
104 #if defined(_MSC_VER)
105 // Enable MSVC compiler warning messages that are useful but off by default.
106 #pragma warning(default : 4263) /* no override, call convention differs */
107 // Disable MSVC compiler warning messages that often occur in valid code.
108 #if !defined(VTK_DISPLAY_WIN32_WARNINGS)
109 #pragma warning(disable : 4003) /* not enough actual parameters for macro */
110 #pragma warning(disable : 4097) /* typedef is synonym for class */
111 #pragma warning(disable : 4127) /* conditional expression is constant */
112 #pragma warning(disable : 4244) /* possible loss in conversion */
113 #pragma warning(disable : 4251) /* missing DLL-interface */
114 #pragma warning(disable : 4305) /* truncation from type1 to type2 */
115 #pragma warning(disable : 4309) /* truncation of constant value */
116 #pragma warning(disable : 4514) /* unreferenced inline function */
117 #pragma warning(disable : 4706) /* assignment in conditional expression */
118 #pragma warning(disable : 4710) /* function not inlined */
119 #pragma warning(disable : 4786) /* identifier truncated in debug info */
120 #endif
121 #endif
122 
123 // Now set up the generic VTK export macro.
124 #if defined(VTK_BUILD_SHARED_LIBS)
125 #define VTK_EXPORT VTK_ABI_EXPORT
126 #else
127 #define VTK_EXPORT
128 #endif
129 
130 #endif
131 // VTK-HeaderTest-Exclude: vtkWin32Header.h
Do_not_include_vtkWin32Header_directly_vtkSystemIncludes_includes_it