]>
Commit | Line | Data |
---|---|---|
1 | .. | |
2 | Copyright 1988-2022 Free Software Foundation, Inc. | |
3 | This is part of the GCC manual. | |
4 | For copying conditions, see the copyright.rst file. | |
5 | ||
6 | .. _compatibility_alias: | |
7 | ||
8 | compatibility_alias | |
9 | ******************* | |
10 | ||
11 | The keyword ``@compatibility_alias`` allows you to define a class name | |
12 | as equivalent to another class name. For example: | |
13 | ||
14 | .. code-block:: objective-c | |
15 | ||
16 | @compatibility_alias WOApplication GSWApplication; | |
17 | ||
18 | tells the compiler that each time it encounters ``WOApplication`` as | |
19 | a class name, it should replace it with ``GSWApplication`` (that is, | |
20 | ``WOApplication`` is just an alias for ``GSWApplication``). | |
21 | ||
22 | There are some constraints on how this can be used--- | |
23 | ||
24 | * ``WOApplication`` (the alias) must not be an existing class; | |
25 | ||
26 | * ``GSWApplication`` (the real class) must be an existing class. |