|
29 | 29 | // This is a low-level utility which does not work on all platforms, since it needs
|
30 | 30 | // to make assumptions about the object file format in use. Furthermore, it requires
|
31 | 31 | // the "base definition" of the function (the one we want to check whether it has been
|
32 |
| -// overridden) to be annotated with the _LIBCPP_MAKE_OVERRIDABLE_FUNCTION_DETECTABLE macro. |
| 32 | +// overridden) to be defined using the _LIBCPP_OVERRIDABLE_FUNCTION macro. |
33 | 33 | //
|
34 | 34 | // This currently works with Mach-O files (used on Darwin) and with ELF files (used on Linux
|
35 | 35 | // and others). On platforms where we know how to implement this detection, the macro
|
36 | 36 | // _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION is defined to 1, and it is defined to 0 on
|
37 |
| -// other platforms. The _LIBCPP_MAKE_OVERRIDABLE_FUNCTION_DETECTABLE macro is defined to |
38 |
| -// nothing on unsupported platforms so that it can be used to decorate functions regardless |
39 |
| -// of whether detection is actually supported. |
| 37 | +// other platforms. The _LIBCPP_OVERRIDABLE_FUNCTION macro is defined to perform a normal |
| 38 | +// function definition on unsupported platforms so that it can be used to define functions |
| 39 | +// regardless of whether detection is actually supported. |
40 | 40 | //
|
41 | 41 | // How does this work?
|
42 | 42 | // -------------------
|
43 | 43 | //
|
44 | 44 | // Let's say we want to check whether a weak function `f` has been overridden by the user.
|
45 | 45 | // The general mechanism works by placing `f`'s definition (in the libc++ built library)
|
46 | 46 | // inside a special section, which we do using the `__section__` attribute via the
|
47 |
| -// _LIBCPP_MAKE_OVERRIDABLE_FUNCTION_DETECTABLE macro. |
| 47 | +// _LIBCPP_OVERRIDABLE_FUNCTION macro. |
48 | 48 | //
|
49 | 49 | // Then, when comes the time to check whether the function has been overridden, we take
|
50 | 50 | // the address of the function and we check whether it falls inside the special function
|
|
0 commit comments