mirror of
https://review.haiku-os.org/haiku
synced 2025-02-24 06:28:44 +01:00
Previously, __haiku_init_before was a symbol that was included in each (shared) object, and so it could be used to determine what one we were in. Now, there are no such universal symbols that are declared private to only the object, so we have to use a different approach. __func__ is defined as a const char* at the very beginning of every function it's used in, set to a string of the function name only, i.e., the arguments and return type are left off. So while including that is perhaps not quite optimal, in practice this definition is used extremely rarely (it was introduced by Haiku, and it is used in only 2 applications at all that I could find -- WebKit and Canna.) There really isn't any other way to get a pointer that we know for certain is within the current object besides this one without inserting one, but that really isn't merited just for this. (__builtin_return_address() has problematic semantics wrt. inlining, including linker-inlining.) So this will have to do.