File: feature_macros.htm

package info (click to toggle)
tbb 4.2~20140122-5
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 21,492 kB
  • ctags: 21,278
  • sloc: cpp: 92,813; ansic: 9,775; asm: 1,070; makefile: 1,057; sh: 351; java: 226; objc: 98; pascal: 71; xml: 41
file content (216 lines) | stat: -rwxr-xr-x 7,052 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns:MSHelp="http://www.microsoft.com/MSHelp/" lang="en-us" xml:lang="en-us"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="DC.Type" content="topic">
<meta name="DC.Title" content="Feature macros">
<meta name="DC.subject" content="Feature macros, TBB_DEPRECATED, TBB_USE_EXCEPTIONS, TBB_USE_CAPTURED_EXCEPTION, C++11 Support">
<meta name="keywords" content="Feature macros, TBB_DEPRECATED, TBB_USE_EXCEPTIONS, TBB_USE_CAPTURED_EXCEPTION, C++11 Support">
<meta name="DC.Relation" scheme="URI" content="../../reference/environment.htm">
<meta name="DC.Relation" scheme="URI" content="../exceptions.htm">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="feature_macros">
<meta name="DC.Language" content="en-US">
<link rel="stylesheet" type="text/css" href="../../intel_css_styles.css">
<title>Feature macros</title>
<xml>
<MSHelp:Attr Name="DocSet" Value="Intel"></MSHelp:Attr>
<MSHelp:Attr Name="Locale" Value="kbEnglish"></MSHelp:Attr>
<MSHelp:Attr Name="TopicType" Value="kbReference"></MSHelp:Attr>
</xml>
</head>
<body id="feature_macros">
 <!-- ==============(Start:NavScript)================= -->
 <script src="..\..\NavScript.js" language="JavaScript1.2" type="text/javascript"></script>
 <script language="JavaScript1.2" type="text/javascript">WriteNavLink(2);</script>
 <!-- ==============(End:NavScript)================= -->
<a name="feature_macros"><!-- --></a>

 
  <h1 class="topictitle1">Feature macros</h1>
 
   
  <div> 
	 <div class="section"> 
		<p>Macros in this section control optional features in
		  the library. 
		</p>
 
	 </div>
 
	 <div class="section"><h2 class="sectiontitle"><samp class="codeph">TBB_DEPRECATED</samp>
		  macro</h2> 
		 
		<p>The macro 
		  <samp class="codeph">TBB_DEPRECATED</samp> controls deprecated features that would
		  otherwise conflict with non-deprecated use. Define it to be 1 to get deprecated
		  Intel&reg; Threading Building Blocks (Intel&reg; TBB) 2.1 interfaces. 
		</p>
 
	 </div>
 
	 <div class="section"><h2 class="sectiontitle"><samp class="codeph">TBB_USE_EXCEPTIONS</samp>
		  macro</h2> 
		 
		<p>The macro 
		  <samp class="codeph">TBB_USE_EXCEPTIONS</samp> controls whether the library
		  headers use exception-handling constructs such as 
		  <samp class="codeph">try</samp>, 
		  <samp class="codeph">catch</samp>, and 
		  <samp class="codeph">throw</samp>. The headers do not use these constructs when 
		  <samp class="codeph">TBB_USE_EXCEPTIONS=0</samp>. 
		</p>
 
		<p>For the Microsoft Windows*, Linux*, and OS X*
		  operating systems, the default value is 1 if exception handling constructs are
		  enabled in the compiler, and 0 otherwise. 
		</p>
 
		<div class="Note"><h3 class="NoteTipHead">
					Caution</h3> 
		  <p>The runtime library may still throw an exception
			 when 
			 <samp class="codeph">TBB_USE_EXCEPTIONS=0</samp>. 
		  </p>
 
		</div> 
	 </div>
 
	 <div class="section"><h2 class="sectiontitle"><samp class="codeph">TBB_USE_CAPTURED_EXCEPTION</samp>
		  macro</h2> 
		 
		<p>The macro 
		  <samp class="codeph">TBB_USE_CAPTURED_EXCEPTION</samp> controls rethrow of
		  exceptions within the library. Because C++ 1998 does not support catching an
		  exception on one thread and rethrowing it on another thread, the library
		  sometimes resorts to rethrowing an approximation called 
		  <samp class="codeph">tbb::captured_exception</samp>. 
		</p>
 
		<ul type="disc"> 
		  <li> 
			 <p>Define 
				<samp class="codeph">TBB_USE_CAPTURED_EXCEPTION=1</samp> to make the library
				rethrow an approximation. This is useful for uniform behavior across platforms.
				
			 </p>
 
		  </li>
 
		  <li> 
			 <p>Define 
				<samp class="codeph">TBB_USE_CAPTURED_EXCEPTION=0</samp> to request rethrow of
				the exact exception. This setting is valid only on platforms that support the
				std::exception_ptr feature of C++11. Otherwise a compile-time diagnostic is
				issued. 
			 </p>
 
		  </li>
 
		</ul>
 
		<p>On Windows* , Linux* and OS X* operating systems,
		  the default value is 
		  <samp class="codeph">1</samp> for supported host compilers with 
		  <samp class="codeph">std::exception_ptr</samp>, and 
		  <samp class="codeph">0</samp> otherwise. On IA-64 architecture processors the
		  default value is 
		  <samp class="codeph">0</samp>. 
		</p>
 
		<div class="Note"><h3 class="NoteTipHead">
					Caution</h3> 
		  <p>In order for exact exception propagation to work
			 properly an appropriate library binary should be used. 
		  </p>
 
		</div> 
	 </div>
 
	 <div class="section"><h2 class="sectiontitle">C++11 Support</h2> 
		 
		<p>To enable C++11 specific code, you need to use a compiler that
		  supports C++11 mode, and compile your code with the C++11 mode set. C++11
		  support is off by default in the compiler. The following table shows the option
		  for turning it on. 
		</p>
 
		
<div class="tablenoborder"><a name="tbl9"><!-- --></a><table cellpadding="4" summary="" id="tbl9" width="100%" frame="border" border="1" cellspacing="0" rules="all"><caption><span class="tablecap">Compilation Commands for Setting C++11 Support</span></caption> 
		  <thead align="left"> 
			 <tr> 
				<th class="cellrowborder" valign="top" width="30.959752321981426%" id="d60661e176"> 
				  <p>Environment 
				  </p>
 
				</th>
 
				<th class="cellrowborder" valign="top" width="69.04024767801857%" id="d60661e182"> 
				  <p>Intel&reg; C++ Compiler (Version 11.0) 
				  </p>
 
				  <p>Compilation Command and Option 
				  </p>
 
				</th>
 
			 </tr>
</thead>
 
		  <tbody> 
			 <tr> 
				<td class="cellrowborder" valign="top" width="30.959752321981426%" headers="d60661e176 "> 
				  <p>Windows* OS systems 
				  </p>
 
				</td>
 
				<td class="cellrowborder" valign="top" width="69.04024767801857%" headers="d60661e182 "> 
				  <p><samp class="codeph">icl /Qstd:c++0x foo.cpp</samp> 
				  </p>
 
				</td>
 
			 </tr>
 
			 <tr> 
				<td class="cellrowborder" valign="top" width="30.959752321981426%" headers="d60661e176 "> 
				  <p>Linux* OS systems 
				  </p>
 
				  <p>OS X* systems 
				  </p>
 
				</td>
 
				<td class="cellrowborder" valign="top" width="69.04024767801857%" headers="d60661e182 "> 
				  <p><samp class="codeph">icc -std=c++0x foo.cpp</samp> 
				  </p>
 
				</td>
 
			 </tr>
 
		  </tbody>
 
		</table>
</div>
 
	 </div>

  </div>
 
  
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong>&nbsp;<a href="../../reference/environment.htm">Environment</a></div>
</div>
<div class="See Also">
<h2>See Also</h2>
<div class="linklist">
<div><a href="../exceptions.htm">Exceptions 
		  </a></div></div>
</div> 

</body>
</html>