Page MenuHomePhabricator

[libc++] Add a persistent way to disable availability

Authored by smeenai on Aug 14 2017, 2:29 PM.



Add _LIBCPP_DISABLE_AVAILABILITY to the site config options, and add a
cmake option LIBCXX_DISABLE_AVAILABILITY to control the site config.
This is similar to other options which influence headers and therefore
shold have some way to be set persistently.

Event Timeline

smeenai created this revision.Aug 14 2017, 2:29 PM
mehdi_amini edited edge metadata.Aug 14 2017, 3:24 PM
mehdi_amini added a subscriber: dexonsmith.

Seems fine to me. Adding @dexonsmith (I don't know who maintain libc++ at Apple right now)

This revision is now accepted and ready to land.Aug 14 2017, 3:27 PM
mclow.lists edited edge metadata.Aug 14 2017, 4:01 PM

What's the use case here? What are you trying to accomplish?

What's the use case here? What are you trying to accomplish?

The _LIBCPP_DISABLE_AVAILABILITY macro already exists, but since it influences headers, it's a lot more useful to have it as a site config option, so that it can be set consistently.

I have an internal codebase where the availability macros cause issues, for complicated reasons that I unfortunately can't go into detail about. Rather than having to add _LIBCPP_DISABLE_AVAILABILITY to every single build using the libc++ headers, it would be really nice to be able to do the disabling via the site config. I know that's not a very satisfying explanation, but this seemed like a small and generally useful change, and it's consistent with how we're handling other macros that influence headers.

@mclow.lists does this seem reasonable to you?

@mclow.lists, any final verdict here? I ended up doing this differently for my internal use case, so if you think this isn't generally useful, I'm happy to abandon.

smeenai abandoned this revision.Oct 4 2017, 3:54 PM

I ended up handling this differently internally (via a custom site config). If someone else ends up needing the same functionality, they can revive it.