OLD | NEW |
1 {{+bindTo:partials.standard_nacl_article}} | 1 {{+bindTo:partials.standard_nacl_article}} |
2 | 2 |
3 <section id="pnacl-c-c-language-support"> | 3 <section id="pnacl-c-c-language-support"> |
4 <h1 id="pnacl-c-c-language-support">PNaCl C/C++ Language Support</h1> | 4 <h1 id="pnacl-c-c-language-support">PNaCl C/C++ Language Support</h1> |
5 <div class="contents local" id="contents" style="display: none"> | 5 <div class="contents local" id="contents" style="display: none"> |
6 <ul class="small-gap"> | 6 <ul class="small-gap"> |
7 <li><p class="first"><a class="reference internal" href="#source-language-suppor
t" id="id2">Source language support</a></p> | 7 <li><p class="first"><a class="reference internal" href="#source-language-suppor
t" id="id2">Source language support</a></p> |
8 <ul class="small-gap"> | 8 <ul class="small-gap"> |
9 <li><a class="reference internal" href="#preprocessor-definitions" id="id3">Prep
rocessor definitions</a></li> | 9 <li><a class="reference internal" href="#versions" id="id3">Versions</a></li> |
| 10 <li><a class="reference internal" href="#preprocessor-definitions" id="id4">Prep
rocessor definitions</a></li> |
10 </ul> | 11 </ul> |
11 </li> | 12 </li> |
12 <li><p class="first"><a class="reference internal" href="#memory-model-and-atomi
cs" id="id4">Memory Model and Atomics</a></p> | 13 <li><p class="first"><a class="reference internal" href="#memory-model-and-atomi
cs" id="id5">Memory Model and Atomics</a></p> |
13 <ul class="small-gap"> | 14 <ul class="small-gap"> |
14 <li><a class="reference internal" href="#memory-model-for-concurrent-operations"
id="id5">Memory Model for Concurrent Operations</a></li> | 15 <li><a class="reference internal" href="#memory-model-for-concurrent-operations"
id="id6">Memory Model for Concurrent Operations</a></li> |
15 <li><a class="reference internal" href="#atomic-memory-ordering-constraints" id=
"id6">Atomic Memory Ordering Constraints</a></li> | 16 <li><a class="reference internal" href="#atomic-memory-ordering-constraints" id=
"id7">Atomic Memory Ordering Constraints</a></li> |
16 <li><a class="reference internal" href="#volatile-memory-accesses" id="id7">Vola
tile Memory Accesses</a></li> | 17 <li><a class="reference internal" href="#volatile-memory-accesses" id="id8">Vola
tile Memory Accesses</a></li> |
17 </ul> | 18 </ul> |
18 </li> | 19 </li> |
19 <li><a class="reference internal" href="#threading" id="id8">Threading</a></li> | 20 <li><a class="reference internal" href="#threading" id="id9">Threading</a></li> |
20 <li><a class="reference internal" href="#setjmp-and-longjmp" id="id9"><code>setj
mp</code> and <code>longjmp</code></a></li> | 21 <li><a class="reference internal" href="#setjmp-and-longjmp" id="id10"><code>set
jmp</code> and <code>longjmp</code></a></li> |
21 <li><a class="reference internal" href="#c-exception-handling" id="id10">C++ Exc
eption Handling</a></li> | 22 <li><a class="reference internal" href="#c-exception-handling" id="id11">C++ Exc
eption Handling</a></li> |
22 <li><a class="reference internal" href="#inline-assembly" id="id11">Inline Assem
bly</a></li> | 23 <li><a class="reference internal" href="#inline-assembly" id="id12">Inline Assem
bly</a></li> |
23 <li><a class="reference internal" href="#undefined-behavior" id="id12">Undefined
Behavior</a></li> | 24 <li><a class="reference internal" href="#undefined-behavior" id="id13">Undefined
Behavior</a></li> |
24 <li><a class="reference internal" href="#floating-point" id="id13">Floating-Poin
t</a></li> | 25 <li><a class="reference internal" href="#floating-point" id="id14">Floating-Poin
t</a></li> |
25 <li><a class="reference internal" href="#computed-goto" id="id14">Computed <code
>goto</code></a></li> | 26 <li><a class="reference internal" href="#computed-goto" id="id15">Computed <code
>goto</code></a></li> |
26 <li><p class="first"><a class="reference internal" href="#future-directions" id=
"id15">Future Directions</a></p> | 27 <li><p class="first"><a class="reference internal" href="#future-directions" id=
"id16">Future Directions</a></p> |
27 <ul class="small-gap"> | 28 <ul class="small-gap"> |
28 <li><a class="reference internal" href="#simd" id="id16">SIMD</a></li> | 29 <li><a class="reference internal" href="#simd" id="id17">SIMD</a></li> |
29 <li><a class="reference internal" href="#inter-process-communication" id="id17">
Inter-Process Communication</a></li> | 30 <li><a class="reference internal" href="#inter-process-communication" id="id18">
Inter-Process Communication</a></li> |
30 <li><a class="reference internal" href="#posix-style-signal-handling" id="id18">
POSIX-style Signal Handling</a></li> | 31 <li><a class="reference internal" href="#posix-style-signal-handling" id="id19">
POSIX-style Signal Handling</a></li> |
31 </ul> | 32 </ul> |
32 </li> | 33 </li> |
33 </ul> | 34 </ul> |
34 | 35 |
35 </div><section id="source-language-support"> | 36 </div><section id="source-language-support"> |
36 <h2 id="source-language-support">Source language support</h2> | 37 <h2 id="source-language-support">Source language support</h2> |
37 <p>The currently supported languages are C and C++. The PNaCl toolchain is | 38 <p>The currently supported languages are C and C++. The PNaCl toolchain is |
38 based on Clang 3.3, which fully supports C++11 and most of C11. A | 39 based on recent Clang, which fully supports C++11 and most of C11. A |
39 detailed status of the language support is available <a class="reference externa
l" href="http://clang.llvm.org/cxx_status.html">here</a>.</p> | 40 detailed status of the language support is available <a class="reference externa
l" href="http://clang.llvm.org/cxx_status.html">here</a>.</p> |
40 <p>For information on using languages other than C/C++, see the <a class="refere
nce internal" href="/native-client/faq.html#other-languages"><em>FAQ | 41 <p>For information on using languages other than C/C++, see the <a class="refere
nce internal" href="/native-client/faq.html#other-languages"><em>FAQ |
41 section on other languages</em></a>.</p> | 42 section on other languages</em></a>.</p> |
42 <p>As for the standard libraries, the PNaCl toolchain is currently based on | 43 <p>As for the standard libraries, the PNaCl toolchain is currently based on |
43 <code>libc++</code>, and the <code>newlib</code> standard C library (version is
available | 44 <code>libc++</code>, and the <code>newlib</code> standard C library. <code>libst
dc++</code> is also |
44 through the macro <code>NEWLIB_VERSION</code>). <code>libstdc++</code> is also s
upported | 45 supported but its use is discouraged; see <a class="reference internal" href="/n
ative-client/devguide/devcycle/building.html#building-cpp-libraries"><em>C++ sta
ndard libraries</em></a> |
45 but its use is discouraged; see <a class="reference internal" href="/native-clie
nt/devguide/devcycle/building.html#building-cpp-libraries"><em>C++ standard libr
aries</em></a> for more | 46 for more details.</p> |
46 details.</p> | 47 <section id="versions"> |
47 <section id="preprocessor-definitions"> | 48 <h3 id="versions">Versions</h3> |
| 49 <p>Version information can be obtained:</p> |
| 50 <ul class="small-gap"> |
| 51 <li>Clang/LLVM: run <code>pnacl-clang -v</code>.</li> |
| 52 <li><code>newlib</code>: use the <code>_NEWLIB_VERSION</code> macro.</li> |
| 53 <li><code>libc++</code>: use the <code>_LIBCPP_VERSION</code> macro.</li> |
| 54 <li><code>libstdc++</code>: use the <code>_GLIBCXX_VERSION</code> macro.</li> |
| 55 </ul> |
| 56 </section><section id="preprocessor-definitions"> |
48 <h3 id="preprocessor-definitions">Preprocessor definitions</h3> | 57 <h3 id="preprocessor-definitions">Preprocessor definitions</h3> |
49 <p>When compiling C/C++ code, the PNaCl toolchain defines the <code>__pnacl__</c
ode> | 58 <p>When compiling C/C++ code, the PNaCl toolchain defines the <code>__pnacl__</c
ode> |
50 macro. In addition, <code>__native_client__</code> is defined for compatibility | 59 macro. In addition, <code>__native_client__</code> is defined for compatibility |
51 with other NaCl toolchains.</p> | 60 with other NaCl toolchains.</p> |
52 </section></section><section id="memory-model-and-atomics"> | 61 </section></section><section id="memory-model-and-atomics"> |
53 <span id="id1"></span><h2 id="memory-model-and-atomics"><span id="id1"></span>Me
mory Model and Atomics</h2> | 62 <span id="id1"></span><h2 id="memory-model-and-atomics"><span id="id1"></span>Me
mory Model and Atomics</h2> |
54 <section id="memory-model-for-concurrent-operations"> | 63 <section id="memory-model-for-concurrent-operations"> |
55 <h3 id="memory-model-for-concurrent-operations">Memory Model for Concurrent Oper
ations</h3> | 64 <h3 id="memory-model-for-concurrent-operations">Memory Model for Concurrent Oper
ations</h3> |
56 <p>The memory model offered by PNaCl relies on the same coding guidelines | 65 <p>The memory model offered by PNaCl relies on the same coding guidelines |
57 as the C11/C++11 one: concurrent accesses must always occur through | 66 as the C11/C++11 one: concurrent accesses must always occur through |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 <p>Neither PNaCl nor NaCl currently support asynchronous interruption | 258 <p>Neither PNaCl nor NaCl currently support asynchronous interruption |
250 or suspension of threads.</p> | 259 or suspension of threads.</p> |
251 </li> | 260 </li> |
252 </ul> | 261 </ul> |
253 <p>If PNaCl were to support either of these, the interaction of | 262 <p>If PNaCl were to support either of these, the interaction of |
254 <code>volatile</code> and atomics with same-thread signal handling would need | 263 <code>volatile</code> and atomics with same-thread signal handling would need |
255 to be carefully detailed.</p> | 264 to be carefully detailed.</p> |
256 </section></section></section> | 265 </section></section></section> |
257 | 266 |
258 {{/partials.standard_nacl_article}} | 267 {{/partials.standard_nacl_article}} |
OLD | NEW |