discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trying to use GNUstep and libdispatch in an ARC based objective-C pr


From: David Chisnall
Subject: Re: Trying to use GNUstep and libdispatch in an ARC based objective-C program
Date: Wed, 8 Jan 2014 12:17:43 +0000

Hi Quentin,

On 8 Jan 2014, at 09:32, Quentin Mathé <qmathe@gmail.com> wrote:

> It seems libdispatch ObjC integration is not compatible with libobjc2 as it 
> is. When compiling code that uses libdispatch, I  pass -DOS_OBJECT_USE_OBJC=0 
> to the CPPFLAGS, in order to disable the libdispatch ObjC integration.
> 
> See 
> http://stackoverflow.com/questions/8618632/does-arc-support-dispatch-queues

It would be nice for us to support that.  As I understand it, the only thing 
missing is treating the libdispatch types as ARC-compatible types?

> Based on my experience, this repository requires various changes to compile 
> and work correctly on GNUstep. Some GNUstep people have submitted changes but 
> they haven't been accepted yet.
> 
> I maintain a fork of this repository patched with GNUstep+libobjc2 support 
> here: http://svn.gna.org/viewcvs/etoile/trunk/Dependencies/libdispatch-objc2/

This patch shouldn't be needed.  I use libdispatch on FreeBSD, and it links 
against libBlockRuntime but then these symbols are weak so they're just 
replaced if you also link to libobjc.  There's absolutely no reason to use the 
libobjc2 headers instead of the BlocksRuntime headers, even if you're linking 
to libobjc instead of libBlocksRuntime.

> The changes I did are listed in this patch: 
> http://svn.gna.org/viewcvs/etoile?view=revision&revision=9796
> The main change is rewriting FindCBlocks.cmake to pick either 
> libBlocksRuntime or libobjc2, depending on what is available on the host 
> system.
> 
> For the install instructions, see: 
> http://svn.gna.org/viewcvs/*checkout*/etoile/trunk/Dependencies/libdispatch-objc2/INSTALL
> 
> Another major problem that remains unsovled lies the fact that GNUstep Base 
> doesn't attempt to detect libdispatch, and compile NSOperation and 
> NSOperationQueue with libdispatch support enabled. As a result, you have to 
> stick to the libdispatch C API.

-base actually does detect libdispatch and uses it for a few things (e.g. 
parallel iteration with NSArray), but it doesn't use it for NSRunLoop or 
NSOperationQueue - both of these would be nice to add.

David




-- Sent from my Apple II




reply via email to

[Prev in Thread] Current Thread [Next in Thread]