vmd_vc.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  4. <title>Visual C++ define</title>
  5. <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
  7. <link rel="home" href="../index.html" title="Chapter&#160;1.&#160;The Variadic Macro Data Library 1.9">
  8. <link rel="up" href="../index.html" title="Chapter&#160;1.&#160;The Variadic Macro Data Library 1.9">
  9. <link rel="prev" href="vmd_vmacros.html" title="Using variadic macros">
  10. <link rel="next" href="vmd_detail.html" title="Functional groups">
  11. </head>
  12. <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
  13. <table cellpadding="2" width="100%"><tr>
  14. <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
  15. <td align="center"><a href="../../../../../index.html">Home</a></td>
  16. <td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
  17. <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
  18. <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
  19. <td align="center"><a href="../../../../../more/index.htm">More</a></td>
  20. </tr></table>
  21. <hr>
  22. <div class="spirit-nav">
  23. <a accesskey="p" href="vmd_vmacros.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="vmd_detail.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
  24. </div>
  25. <div class="section">
  26. <div class="titlepage"><div><div><h2 class="title" style="clear: both">
  27. <a name="variadic_macro_data.vmd_vc"></a><a class="link" href="vmd_vc.html" title="Visual C++ define">Visual C++ define</a>
  28. </h2></div></div></div>
  29. <p>
  30. Microsoft's Visual C++ compiler, abbreviated VC++, is a very popular compiler
  31. but does not implement the standard C++ preprocessor correctly in a number
  32. of respects. Because of this the programmer using the VMD needs to occasionally
  33. do things differently when VC++ is being used. These "quirks" of
  34. VC++ have been smoothed over as much as possible in the VMD library, but are
  35. mentioned in further topics and occasionally must be addressed by the programmer
  36. using VMD.
  37. </p>
  38. <p>
  39. The VMD has a macro that indicates when VC++ is the compiler being used. The
  40. macro is an object-like macro called BOOST_VMD_MSVC. It is set to 1 when VC++
  41. is being used and set to 0 when VC++ is not being used. You can use this macro
  42. in your own macro code whenever you include a VMD header file to write code
  43. which may need special processing for VC++ as outlined in this documentation.
  44. Your macro processing may therefore occasional take the form of:
  45. </p>
  46. <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">vmd</span><span class="special">/</span><span class="identifier">some_header</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
  47. <span class="preprocessor">#if</span> <span class="identifier">BOOST_VMD_MSVC</span>
  48. <span class="preprocessor">#define</span> <span class="identifier">SOME_MACRO</span> <span class="special">...</span> <span class="identifier">code</span> <span class="keyword">for</span> <span class="identifier">VC</span><span class="special">++</span>
  49. <span class="preprocessor">#else</span>
  50. <span class="preprocessor">#define</span> <span class="identifier">SOME_MACRO</span> <span class="special">...</span> <span class="identifier">code</span> <span class="keyword">for</span> <span class="identifier">all</span> <span class="identifier">other</span> <span class="identifier">compilers</span>
  51. <span class="preprocessor">#endif</span>
  52. </pre>
  53. </div>
  54. <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
  55. <td align="left"></td>
  56. <td align="right"><div class="copyright-footer">Copyright &#169; 2010-2017 Tropic Software
  57. East Inc</div></td>
  58. </tr></table>
  59. <hr>
  60. <div class="spirit-nav">
  61. <a accesskey="p" href="vmd_vmacros.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="vmd_detail.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
  62. </div>
  63. </body>
  64. </html>