[libcxx-commits] [libcxx] [libc++][NFC] Refactor _LIBCPP_AVAILABILITY_HAS_* macros to always be defined (PR #71002)

Heejin Ahn via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 28 14:19:00 PDT 2024


aheejin wrote:

First, thanks for your replies!

I can open a separate issue, but I don't think the code size was the point. (And I agree in general that code size increase doesn't matter, but it can be an issue for some embedded systems or Wasm because the larger the code size is it takes more time to transmit over the internet. But again, it's not the point here.)

My question was, is there a way to toggle individual setting in any way, for whatever reason?

> Basically, this mechanism is intended to be used for back-deployment purposes, not to optimize code size or enable/disable individual features based on preferences. That's why that mechanism is not optimized for setting just one or two of these macros. That's a mismatch between the way the header intends to be used and the way you are trying to use it.

OK, now I understand that messing with `__availability` to toggle individual settings is not the way it's intended to be used. Then what's the recommended way of changing a single (or a couple) setting in libcxx now?

https://github.com/llvm/llvm-project/pull/71002


More information about the libcxx-commits mailing list