VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkWin32Header.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00022 #ifndef __vtkWIN32Header_h 00023 #define __vtkWIN32Header_h 00024 00025 #ifndef __VTK_SYSTEM_INCLUDES__INSIDE 00026 Do_not_include_vtkWin32Header_directly__vtkSystemIncludes_includes_it; 00027 #endif 00028 00029 #include "vtkConfigure.h" 00030 #include "vtkABI.h" 00031 00032 /* 00033 * This is a support for files on the disk that are larger than 2GB. 00034 * Since this is the first place that any include should happen, do this here. 00035 */ 00036 #ifdef VTK_REQUIRE_LARGE_FILE_SUPPORT 00037 # ifndef _LARGEFILE_SOURCE 00038 # define _LARGEFILE_SOURCE 00039 # endif 00040 # ifndef _LARGE_FILES 00041 # define _LARGE_FILES 00042 # endif 00043 # ifndef _FILE_OFFSET_BITS 00044 # define _FILE_OFFSET_BITS 64 00045 # endif 00046 #endif 00047 00048 // 00049 // Windows specific stuff------------------------------------------ 00050 #if defined(_WIN32) || defined(WIN32) 00051 00052 // define strict header for windows 00053 #ifndef STRICT 00054 #define STRICT 00055 #endif 00056 00057 #ifndef NOMINMAX 00058 #define NOMINMAX 00059 #endif 00060 00061 #endif 00062 00063 // Never include the windows header here when building VTK itself. 00064 #if defined(VTK_IN_VTK) 00065 # undef VTK_INCLUDE_WINDOWS_H 00066 #endif 00067 00068 #if defined(_WIN32) 00069 // Include the windows header here only if requested by user code. 00070 # if defined(VTK_INCLUDE_WINDOWS_H) 00071 # include <windows.h> 00072 // Define types from the windows header file. 00073 typedef DWORD vtkWindowsDWORD; 00074 typedef PVOID vtkWindowsPVOID; 00075 typedef LPVOID vtkWindowsLPVOID; 00076 typedef HANDLE vtkWindowsHANDLE; 00077 typedef LPTHREAD_START_ROUTINE vtkWindowsLPTHREAD_START_ROUTINE; 00078 # else 00079 // Define types from the windows header file. 00080 typedef unsigned long vtkWindowsDWORD; 00081 typedef void* vtkWindowsPVOID; 00082 typedef vtkWindowsPVOID vtkWindowsLPVOID; 00083 typedef vtkWindowsPVOID vtkWindowsHANDLE; 00084 typedef vtkWindowsDWORD (__stdcall *vtkWindowsLPTHREAD_START_ROUTINE)(vtkWindowsLPVOID); 00085 # endif 00086 // Enable workaround for windows header name mangling. 00087 // See VTK/Utilities/Upgrading/README.WindowsMangling.txt for details. 00088 #if !defined(__WRAP__) 00089 # define VTK_WORKAROUND_WINDOWS_MANGLE 00090 #endif 00091 00092 #if defined(_MSC_VER) // Visual studio 00093 #pragma warning ( disable : 4311 ) 00094 #pragma warning ( disable : 4312 ) 00095 # define vtkGetWindowLong GetWindowLongPtr 00096 # define vtkSetWindowLong SetWindowLongPtr 00097 # define vtkLONG LONG_PTR 00098 # define vtkGWL_WNDPROC GWLP_WNDPROC 00099 # define vtkGWL_HINSTANCE GWLP_HINSTANCE 00100 # define vtkGWL_USERDATA GWLP_USERDATA 00101 #else // non-Visual studio 00102 # define vtkGetWindowLong GetWindowLong 00103 # define vtkSetWindowLong SetWindowLong 00104 # define vtkLONG LONG 00105 # ifdef _WIN64 00106 # define vtkGWL_WNDPROC GWLP_WNDPROC 00107 # define vtkGWL_HINSTANCE GWLP_HINSTANCE 00108 # define vtkGWL_USERDATA GWLP_USERDATA 00109 # else 00110 # define vtkGWL_WNDPROC GWL_WNDPROC 00111 # define vtkGWL_HINSTANCE GWL_HINSTANCE 00112 # define vtkGWL_USERDATA GWL_USERDATA 00113 # endif 00114 #endif // 00115 00116 #endif 00117 00118 #if defined(_MSC_VER) 00119 // Enable MSVC compiler warning messages that are useful but off by default. 00120 # pragma warning ( default : 4263 ) /* no override, call convention differs */ 00121 // Disable MSVC compiler warning messages that often occur in valid code. 00122 # if !defined(VTK_DISPLAY_WIN32_WARNINGS) 00123 # pragma warning ( disable : 4003 ) /* not enough actual parameters for macro */ 00124 # pragma warning ( disable : 4097 ) /* typedef is synonym for class */ 00125 # pragma warning ( disable : 4127 ) /* conditional expression is constant */ 00126 # pragma warning ( disable : 4244 ) /* possible loss in conversion */ 00127 # pragma warning ( disable : 4251 ) /* missing DLL-interface */ 00128 # pragma warning ( disable : 4305 ) /* truncation from type1 to type2 */ 00129 # pragma warning ( disable : 4309 ) /* truncation of constant value */ 00130 # pragma warning ( disable : 4514 ) /* unreferenced inline function */ 00131 # pragma warning ( disable : 4706 ) /* assignment in conditional expression */ 00132 # pragma warning ( disable : 4710 ) /* function not inlined */ 00133 # pragma warning ( disable : 4786 ) /* identifier truncated in debug info */ 00134 # endif 00135 #endif 00136 00137 #if defined(__BORLANDC__) 00138 // Disable Borland compiler warning messages that often occur in valid code. 00139 # if !defined(VTK_DISPLAY_WIN32_WARNINGS) 00140 # pragma warn -8004 /* assigned a value that is never used */ 00141 # pragma warn -8008 /* condition is always false */ 00142 # pragma warn -8026 /* funcs w/class-by-value args not expanded inline */ 00143 # pragma warn -8027 /* functions w/ do/for/while not expanded inline */ 00144 # pragma warn -8060 /* possibly incorrect assignment */ 00145 # pragma warn -8066 /* unreachable code */ 00146 # pragma warn -8072 /* suspicious pointer arithmetic */ 00147 # endif 00148 #endif 00149 00150 // Now set up the generic VTK export macro. 00151 #if defined(VTK_BUILD_SHARED_LIBS) 00152 # define VTK_EXPORT VTK_ABI_EXPORT 00153 #else 00154 # define VTK_EXPORT 00155 #endif 00156 00157 // this is exclusively for the tcl Init functions 00158 #define VTK_TK_EXPORT VTK_ABI_EXPORT 00159 00160 #endif 00161 // VTK-HeaderTest-Exclude: vtkWin32Header.h