Use __has_include to choose between <Block.h> and <objc/blocks_runtime.h>

Most Linux distributions and MSYS2 include a version of BlocksRuntime which includes the `Block.h` header.
This commit is contained in:
Frederik Carlier 2023-10-08 20:19:25 +02:00
parent 531d3b8559
commit 1f2eba393c

View file

@ -358,7 +358,7 @@ static inline void gs_consumed(id NS_CONSUMED GS_UNUSED_ARG o) { return; }
*/
#if __has_feature(blocks)
# if OBJC2RUNTIME
# if defined(__APPLE__)
# if __has_include(<Block.h>)
# include <Block.h>
# else
# include <objc/blocks_runtime.h>