[haiku-commits] Re: haiku: hrev52830 - headers/os/kernel src/system/libnetwork src/kits/network/libnetapi headers/private/system src/kits/app

  • From: Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 2 Feb 2019 10:45:52 +0100

On Fri, Feb 01, 2019 at 08:34:30PM -0500, waddlesplash wrote:

d545ad17ce0f: headers/kernel: Define B_CURRENT_IMAGE_SYMBOL via __func__.
  
  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.)

We could declare a static const char[0] in the macro and use that,
it would not embed the function name this way. This would insert
something of size 0, which is closer to not inserting anything.


Other related posts: