Skip to content

Commit

Permalink
[asan][Darwin] Use Apples blocks extension only when supported (llvm#…
Browse files Browse the repository at this point in the history
…72639)

The commit at 020cdaf broke build of asan on macOS with GCC. GCC does not
support the Apple blocks extension (yet). Uses of blocks in other parts
of the sanitisers are protected by MISSING_BLOCKS_SUPPORT. But the type
definition is not.
  • Loading branch information
fxcoudert authored and tob2 committed Nov 17, 2023
1 parent ec42d54 commit 43a5a06
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler-rt/lib/asan/asan_mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,11 @@ typedef void (*dispatch_mach_handler_function_t)(void *context,
dispatch_mach_reason reason,
dispatch_mach_msg_t message,
mach_error_t error);
# if !defined(MISSING_BLOCKS_SUPPORT)
typedef void (^dispatch_mach_handler_t)(dispatch_mach_reason reason,
dispatch_mach_msg_t message,
mach_error_t error);
# endif

// A wrapper for the ObjC blocks used to support libdispatch.
typedef struct {
Expand Down

0 comments on commit 43a5a06

Please sign in to comment.