Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtlWin32Header.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: The OpenIGTLink Library
4  Language: C++
5  Web page: http://openigtlink.org/
6 
7  Copyright (c) Insight Software Consortium. All rights reserved.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 =========================================================================*/
14 /*=========================================================================
15 
16  Program: Insight Segmentation & Registration Toolkit
17  Module: $RCSfile: itkWin32Header.h,v $
18  Language: C++
19  Date: $Date: 2010-01-17 13:38:05 -0500 (Sun, 17 Jan 2010) $
20  Version: $Revision: 5577 $
21 
22  Copyright (c) Insight Software Consortium. All rights reserved.
23  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
24 
25  Portions of this code are covered under the VTK copyright.
26  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
27 
28  This software is distributed WITHOUT ANY WARRANTY; without even
29  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
30  PURPOSE. See the above copyright notices for more information.
31 
32 =========================================================================*/
33 #ifndef __igtlWin32Header_h
34 #define __igtlWin32Header_h
35 
36 #include "igtlConfigure.h"
37 
38 // add in the Windows variants
39 
40 #if defined(__CYGWIN__)
41 #ifndef WIN32
42 #define WIN32 1
43 #endif
44 #ifndef _WIN32
45 #define _WIN32 1
46 #endif
47 #endif
48 
49 #if defined(_WIN32)
50  // Include the windows header here only if requested by user code.
51 # if defined(IGTL_INCLUDE_WINDOWS_H)
52 # include <windows.h>
53  // Define types from the windows header file.
54  typedef DWORD igtlWindowsDWORD;
55  typedef PVOID igtlWindowsPVOID;
56  typedef LPVOID igtlWindowsLPVOID;
57  typedef HANDLE igtlWindowsHANDLE;
58  typedef LPTHREAD_START_ROUTINE igtlWindowsLPTHREAD_START_ROUTINE;
59 # else
60  // Define types from the windows header file.
61  typedef unsigned long igtlWindowsDWORD;
62  typedef void* igtlWindowsPVOID;
63  typedef igtlWindowsPVOID igtlWindowsLPVOID;
64  typedef igtlWindowsPVOID igtlWindowsHANDLE;
65  typedef igtlWindowsDWORD (__stdcall *igtlWindowsLPTHREAD_START_ROUTINE)(igtlWindowsLPVOID);
66 # endif
67 
68 #if ( _MSC_VER >= 1300 ) // Visual studio .NET
69 #pragma warning ( disable : 4311 )
70 #pragma warning ( disable : 4312 )
71 # define igtlGetWindowLong GetWindowLongPtr
72 # define igtlSetWindowLong SetWindowLongPtr
73 # define igtlLONG LONG_PTR
74 # define igtlGWL_WNDPROC GWLP_WNDPROC
75 # define igtlGWL_HINSTANCE GWLP_HINSTANCE
76 # define igtlGWL_USERDATA GWLP_USERDATA
77 #else // older or non-Visual studio
78 # define igtlGetWindowLong GetWindowLong
79 # define igtlSetWindowLong SetWindowLong
80 # define igtlLONG LONG
81 # define igtlGWL_WNDPROC GWL_WNDPROC
82 # define igtlGWL_HINSTANCE GWL_HINSTANCE
83 # define igtlGWL_USERDATA GWL_USERDATA
84 #endif //
85 #endif
86 
87 
88 #if defined(_MSC_VER)
89  // Enable MSVC compiler warning messages that are useful but off by default.
90 # pragma warning ( default : 4263 ) /* no override, call convention differs */
91  // Disable MSVC compiler warning messages that often occur in valid code.
92 # if !defined(IGTL_DISPLAY_WIN32_WARNINGS)
93 # pragma warning ( disable : 4003 ) /* not enough actual parameters for macro */
94 # pragma warning ( disable : 4097 ) /* typedef is synonym for class */
95 # pragma warning ( disable : 4127 ) /* conditional expression is constant */
96 # pragma warning ( disable : 4244 ) /* possible loss in conversion */
97 # pragma warning ( disable : 4251 ) /* missing DLL-interface */
98 # pragma warning ( disable : 4305 ) /* truncation from type1 to type2 */
99 # pragma warning ( disable : 4309 ) /* truncation of constant value */
100 # pragma warning ( disable : 4514 ) /* unreferenced inline function */
101 # pragma warning ( disable : 4706 ) /* assignment in conditional expression */
102 # pragma warning ( disable : 4710 ) /* function not inlined */
103 # pragma warning ( disable : 4786 ) /* identifier truncated in debug info */
104 # pragma warning ( disable : 4996 ) /* 'strncpy': This function or variable may be unsafe. */
105 # endif
106 
107 // typename keyword in default template arguments is not accepted by
108 // MSVC. This macro should only be used in such places.
109 # if !defined(CABLE_CONFIGURATION) && (_MSC_VER < 1310)
110 # define IGTL_TYPENAME
111 # else
112 # define IGTL_TYPENAME typename
113 # endif
114 #else
115 # define IGTL_TYPENAME typename
116 #endif
117 
118 // MSVC 6.0 in release mode will warn about code it produces with its
119 // optimizer. Disable the warnings specifically for this
120 // configuration. Real warnings will be revealed by a debug build or
121 // by other compilers.
122 #if defined(_MSC_VER) && (_MSC_VER < 1300) && defined(NDEBUG)
123 # pragma warning ( disable : 4701 ) /* Variable may be used uninitialized. */
124 # pragma warning ( disable : 4702 ) /* Unreachable code. */
125 #endif
126 
127 #if defined(__BORLANDC__)
128  // Disable Borland compiler warning messages that often occur in valid code.
129 # if !defined(IGTL_DISPLAY_WIN32_WARNINGS)
130 # pragma warn -8004 /* assigned a value that is never used */
131 # pragma warn -8008 /* condition is always false */
132 # pragma warn -8026 /* funcs w/class-by-value args not expanded inline */
133 # pragma warn -8027 /* functions w/ do/for/while not expanded inline */
134 # pragma warn -8060 /* possibly incorrect assignment */
135 # pragma warn -8066 /* unreachable code */
136 # pragma warn -8072 /* suspicious pointer arithmetic */
137 # endif
138 #endif
139 
140 // IGTL_EXPORT can not be used
141 #define IGTL_EXPORT
142 
143 #if (defined(_WIN32) || defined(WIN32)) && !defined(IGTLSTATIC)
144 # ifdef IGTLCommon_EXPORTS
145 # define IGTLCommon_EXPORT __declspec(dllexport)
146 # else
147 # define IGTLCommon_EXPORT __declspec(dllimport)
148 # endif /* IGTLCommon_EXPORT */
149 #else
150 /* unix needs nothing */
151 #define IGTLCommon_EXPORT
152 #endif
153 
154 
155 
156 
157 #endif

Generated for OpenIGTLink by Doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2012