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

Generated at Thu Mar 20 2014 16:32:06 for OpenIGTLink by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2000