[libcxx-commits] [PATCH] D131435: [libcxx] Make stdatomic.h work when included from a C source file

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Aug 10 12:17:56 PDT 2022


ldionne requested changes to this revision.
ldionne added a comment.
This revision now requires changes to proceed.

> In an ideal world, a C source file wouldn't be including the libc++ header directory in its search path, so we'd never have this issue.

This.

> Unfortunately, certain build environments make this hard to guarantee, and in this case it's easy to tweak this header to make it work in a C context, so I'm hoping this is acceptable.

I also agree that we could try to accommodate these setups, but I'm not super eager to do that because I'm sure there are various other ways in which libc++ can break when used from C.

I think a necessary input to make our mind here would be to better understand the case in which you hit this problem, and how you fixed it.

Finally, an alternative approach to this might be to try to handle C inside `__config`. We'd have to do something about the way that we define `_LIBCPP_STD_VER` and we'd probably want to have a special macro like `_LIBCPP_C_LANGUAGE` or whatever, but it might be workable if we had tests for it.

I'm not closed to this patch, but I'll request changes just so we can have this discussion.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131435/new/

https://reviews.llvm.org/D131435



More information about the libcxx-commits mailing list