[libcxx-commits] [PATCH] D103705: [libc++] Simplify a few macros in __config

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 4 10:56:33 PDT 2021


ldionne created this revision.
Herald added a subscriber: krytarowski.
ldionne requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Several macros were guarded with a check along the lines of:

#ifndef MACRO

1. define MACRO ... #endif

However, some of these macros are never intended to be defined by users,
so it's pointless to make this check (i.e. the first #ifndef is always
true). This commit removes those checks.

The motivation for doing this cleanup is to remove the impression that
arbitrary configurations macros can be defined by users when including
libc++ headers, which doesn't work reliably and leads to macro spaghetti.
If one needs to be able to override a knob in the __config, that's fine,
but the proper way to do that is to document the macro as being a public
facing knob in the documentation, and most likely to migrate that macro
to __config_site (depending on the nature of the macro).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103705

Files:
  libcxx/include/__config

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103705.349918.patch
Type: text/x-patch
Size: 5453 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210604/9429ab5d/attachment.bin>


More information about the libcxx-commits mailing list