[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Creating a block using the Macros....
From: |
David Chisnall |
Subject: |
Re: Creating a block using the Macros.... |
Date: |
Tue, 29 Oct 2019 12:41:59 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
This is not possible in the general case.
A block is a structure containing:
- A pointer to the invoke function.
- The type info for the call.
- A set of references to captured variables including:
- Helpers to destroy any captured variables.
- Helpers to copy any captured variables.
C macros are nowhere near expressive enough for this. You could
probably (just about) implement them using C++ templates, though it
would be a lot of work.
The block macros give a way of allowing functions / methods that take
blocks to be called, so that it is possible to build GNUstep with GCC
and link it to a program built with clang. To date, anything that needs
to create blocks, we have implemented a different way or conditionally
compiled out when building with GCC.
David
On 27/10/2019 15:55, Gregory Casamento wrote:
How do I create a block using the macros? I know how to declare one,
but not actually create one. Doing it in clang is easy, but I need
something that will work for both....
Any ideas?
GC
--
Gregory Casamento
GNUstep Lead Developer / OLC, Principal Consultant
http://www.gnustep.org - http://heronsperch.blogspot.com
http://ind.ie/phoenix/
Mailtrack
<https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5&>
Sender notified by
Mailtrack
<https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5&>
10/27/19, 11:53:53 AM