[libc++] Fix modules issues on OS X
authorArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Sun, 31 Jul 2022 16:25:05 +0000 (12:25 -0400)
committerLouis Dionne <ldionne.2@gmail.com>
Wed, 1 Mar 2023 15:33:40 +0000 (10:33 -0500)
commitf56dfb78aa3fcc96bf7e5b6c3bdff8fa620aefd1
treee9e7cb150d6a9208fa3e22cd8254291f657e4b49
parent2c81d43241f79168dc3f63691c1f154d33942dc9
[libc++] Fix modules issues on OS X

First, fix a collision with the Point type from MacTypes.h, which was
reported on Slack, 2022-07-31: https://cpplang.slack.com/archives/C2X659D1B/p1659284691275889

Second, rename the meta:: namespace to types::. OSX's "/usr/include/ncurses.h"
defines a `meta` function, and is (for some reason) included in
"<SDK>/usr/include/module.modulemap", so that identifier is off-limits
for us to use in anything that compiles with -fmodules:

    libcxx/test/support/type_algorithms.h:16:11: error: redefinition of 'meta' as different kind of symbol
    namespace meta {
               ^
    <SDK>/usr/include/ncurses.h:603:28: note: previous definition is here
    extern NCURSES_EXPORT(int) meta (WINDOW *,bool);                        /* implemented */
                                ^

Finally, add a CI configuration for modules on OS X to make sure it
does not regress.

Differential Revision: https://reviews.llvm.org/D144915
18 files changed:
libcxx/test/libcxx/type_traits/is_always_bitcastable.compile.pass.cpp
libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy.pass.cpp
libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/ranges.copy.segmented.pass.cpp
libcxx/test/std/algorithms/alg.nonmodifying/alg.equal/equal.pass.cpp
libcxx/test/std/depr/depr.c.headers/math_h.pass.cpp
libcxx/test/std/language.support/support.limits/limits/is_specialized.pass.cpp
libcxx/test/std/numerics/c.math/isfinite.pass.cpp
libcxx/test/std/numerics/c.math/isinf.pass.cpp
libcxx/test/std/numerics/c.math/isnan.pass.cpp
libcxx/test/std/numerics/c.math/isnormal.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.as.rvalue/begin.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.as.rvalue/end.pass.cpp
libcxx/test/std/ranges/range.adaptors/range.filter/iterator/arrow.pass.cpp
libcxx/test/std/strings/basic.string/string.access/at.pass.cpp
libcxx/test/support/test.support/type_algorithms.pass.cpp
libcxx/test/support/test_iterators.h
libcxx/test/support/type_algorithms.h
libcxx/utils/ci/buildkite-pipeline.yml