Skip to content

Compilation: define __BLOCKS__ when blocks are enabled#1074

Open
vancluever wants to merge 1 commit into
Vexu:masterfrom
vancluever:blocks-define
Open

Compilation: define __BLOCKS__ when blocks are enabled#1074
vancluever wants to merge 1 commit into
Vexu:masterfrom
vancluever:blocks-define

Conversation

@vancluever

Copy link
Copy Markdown
Contributor

This gets defined when blocks are enabled in clang: https://github.com/llvm/llvm-project/blob/9e22a5950e51ace7f50729d7f556ca99d06fa8bb/clang/lib/Frontend/InitPreprocessor.cpp#L1010

Found while trying to translate #include <CoreVideo/CoreVideo.h> on MacOS.

PS: Not too sure if this should be implicit or not somewhere, but -fblocks specifically needs to be enabled when doing C translation for the MacOS frameworks that employ blocks. I don't recall if this is necessary or not in Zig right now currently (it might just be in our flags somewhere that I haven't seen yet).

@Vexu

Vexu commented Jul 7, 2026

Copy link
Copy Markdown
Owner

This is included in #971

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants