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