summaryrefslogtreecommitdiff
path: root/devdocs/gcc~13/compatibility_005falias.html
blob: aebd3e041508158bf723934220991f22fe955441 (plain)
1
2
3
4
5
6
7
8
9
10
11
<div class="section-level-extent" id="compatibility_005falias"> <div class="nav-panel"> <p> Next: <a href="exceptions" accesskey="n" rel="next">Exceptions</a>, Previous: <a href="constant-string-objects" accesskey="p" rel="prev">Constant String Objects</a>, Up: <a href="objective-c" accesskey="u" rel="up">GNU Objective-C Features</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div>  <h1 class="section" id="compatibility_005falias-1"><span>8.6 compatibility_alias<a class="copiable-link" href="#compatibility_005falias-1"> ¶</a></span></h1> <p>The keyword <code class="code">@compatibility_alias</code> allows you to define a class name as equivalent to another class name. For example: </p> <div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">@compatibility_alias WOApplication GSWApplication;</pre>
</div> <p>tells the compiler that each time it encounters <code class="code">WOApplication</code> as a class name, it should replace it with <code class="code">GSWApplication</code> (that is, <code class="code">WOApplication</code> is just an alias for <code class="code">GSWApplication</code>). </p> <p>There are some constraints on how this can be used— </p> <ul class="itemize mark-bullet"> <li>
<code class="code">WOApplication</code> (the alias) must not be an existing class; </li>
<li>
<code class="code">GSWApplication</code> (the real class) must be an existing class. </li>
</ul> </div><div class="_attribution">
  <p class="_attribution-p">
    &copy; Free Software Foundation<br>Licensed under the GNU Free Documentation License, Version 1.3.<br>
    <a href="https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/compatibility_005falias.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/compatibility_005falias.html</a>
  </p>
</div>