<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 23, 2020, at 05:56, David Zarzycki <<a href="mailto:dave@znu.io" class="">dave@znu.io</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi Louis:<br class=""><br class="">FYI – This still isn't sufficient:<br class=""><br class="">1) `REQUIRES: has-fblocks` and  `__has_include(<Block.h>)` does not imply anything about whether the blocks runtime is available.<br class="">2) The blocks runtime is not built into libc/libsystem on non-Apple platforms, therefore it must be explicitly linked against but the test fails to do so.<br class=""><br class="">I've worked around the build/test failure by removing the `libblocksruntime` and `libblocksruntime-devel` packages from my system, but not every non-Apple platform/user might be able to do this.<br class=""></div></div></blockquote><div><br class=""></div><div>Thanks a lot for the heads up! I've created a patch to fix this here: <a href="https://reviews.llvm.org/D78757" class="">https://reviews.llvm.org/D78757</a>. Please let me know what you think.</div><div><br class=""></div><div>Louis</div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">Dave<br class=""><br class=""><br class="">On Wed, Apr 22, 2020, at 3:22 PM, Louis Dionne via libcxx-commits wrote:<br class=""><blockquote type="cite" class=""><br class="">Author: Louis Dionne<br class="">Date: 2020-04-22T15:22:12-04:00<br class="">New Revision: cd66970b371240d90e163d2020c1a42bb2b7e1b9<br class=""><br class="">URL: <br class=""><a href="https://github.com/llvm/llvm-project/commit/cd66970b371240d90e163d2020c1a42bb2b7e1b9" class="">https://github.com/llvm/llvm-project/commit/cd66970b371240d90e163d2020c1a42bb2b7e1b9</a><br class="">DIFF: <br class="">https://github.com/llvm/llvm-project/commit/cd66970b371240d90e163d2020c1a42bb2b7e1b9.diff<br class=""><br class="">LOG: [libc++] Don't try to include <Block.h> when not available<br class=""><br class="">Added: <br class=""><br class=""><br class="">Modified: <br class="">    libcxx/include/functional<br class="">    libcxx/test/libcxx/utilities/function.objects/func.blocks.sh.cpp<br class=""><br class="">Removed: <br class=""><br class=""><br class=""><br class="">################################################################################<br class="">diff  --git a/libcxx/include/functional b/libcxx/include/functional<br class="">index f03ba8bb5541..360ca6e32005 100644<br class="">--- a/libcxx/include/functional<br class="">+++ b/libcxx/include/functional<br class="">@@ -508,7 +508,7 @@ POLICY:  For non-variadic implementations, the <br class="">number of arguments is limited<br class=""><br class=""> #include <__functional_base><br class=""><br class="">-#if defined(_LIBCPP_HAS_EXTENSION_BLOCKS) && <br class="">!defined(_LIBCPP_HAS_OBJC_ARC)<br class="">+#if defined(_LIBCPP_HAS_EXTENSION_BLOCKS) && <br class="">!defined(_LIBCPP_HAS_OBJC_ARC) && __has_include(<Block.h>)<br class=""> #include <Block.h><br class=""> #endif<br class=""><br class="">@@ -2255,7 +2255,7 @@ template <class _Rp, class... _ArgTypes> class <br class="">__policy_func<_Rp(_ArgTypes...)><br class=""> #endif // _LIBCPP_NO_RTTI<br class=""> };<br class=""><br class="">-#if defined(_LIBCPP_HAS_EXTENSION_BLOCKS) && <br class="">!defined(_LIBCPP_HAS_OBJC_ARC)<br class="">+#if defined(_LIBCPP_HAS_EXTENSION_BLOCKS) && <br class="">!defined(_LIBCPP_HAS_OBJC_ARC) && __has_include(<Block.h>)<br class=""><br class=""> template<class _Rp1, class ..._ArgTypes1, class _Alloc, class _Rp, <br class="">class ..._ArgTypes><br class=""> class __func<_Rp1(^)(_ArgTypes1...), _Alloc, _Rp(_ArgTypes...)><br class=""><br class="">diff  --git <br class="">a/libcxx/test/libcxx/utilities/function.objects/func.blocks.sh.cpp <br class="">b/libcxx/test/libcxx/utilities/function.objects/func.blocks.sh.cpp<br class="">index a608d42eb515..25b95465485e 100644<br class="">--- a/libcxx/test/libcxx/utilities/function.objects/func.blocks.sh.cpp<br class="">+++ b/libcxx/test/libcxx/utilities/function.objects/func.blocks.sh.cpp<br class="">@@ -14,6 +14,8 @@<br class=""> // RUN: %{build} -fblocks<br class=""> // RUN: %{run}<br class=""><br class="">+#if __has_include(<Block.h>)<br class="">+<br class=""> #include <functional><br class=""> #include <cstdlib><br class=""> #include <cassert><br class="">@@ -140,3 +142,9 @@ int main(int, char**)<br class=""><br class="">     return 0;<br class=""> }<br class="">+<br class="">+#else<br class="">+<br class="">+int main() { }<br class="">+<br class="">+#endif<br class=""><br class=""><br class=""><br class="">_______________________________________________<br class="">libcxx-commits mailing list<br class="">libcxx-commits@lists.llvm.org<br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-commits<br class=""><br class=""></blockquote></div></div></blockquote></div><br class=""></body></html>