gnustep-dev
[Top][All Lists]
Advanced

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

Re: Embedded blocks...


From: Gregory Casamento
Subject: Re: Embedded blocks...
Date: Sun, 27 Oct 2019 12:05:18 -0400

We are a GNU / FSF project.  Dropping support for GCC would be bad political mojo.   There is little we can do to bridge the gap other than doing these macros.

On Sun, Oct 27, 2019 at 12:00 PM 陈北宗 <address@hidden> wrote:
What is stopping us from dropping GCC though?

On Oct 27, 2019, at 23:57, Gregory Casamento <address@hidden> wrote:

The only way I can see to do it is to pull it out of the retTy structure, but I am not sure that's the right way.   

Things would be so much easier if we were to drop GCC from the list of supported compilers since it doesn't enable many features which are needed by most developers at this point.

GC

MailtrackSender notified by 
Mailtrack 10/27/19, 11:56:05 AM

MailtrackSender notified by 
Mailtrack 10/27/19, 11:57:35 AM

On Sat, Oct 26, 2019 at 12:36 PM 陈北宗 <address@hidden> wrote:
So you need a pointer to the inner block… I did not find any way of doing this using public API. You might have to dig into private API’s in libBlocksRuntime.

On Oct 27, 2019, at 00:28, Gregory Casamento <address@hidden> wrote:

I know how to handle it in the normal case.   The issue is how to pull it out of the gnustep specific strict to use it.  

On Sat, Oct 26, 2019, 11:28 AM 陈北宗 <address@hidden> wrote:
What do you want to access it for? Invoking it? Copying it?

If it is latter, just copying or retaining the outer block is adequate, as copying the outer block will cause the inner block be retained, which would copy it if it is a stack block.

On Oct 26, 2019, at 22:42, Gregory Casamento <address@hidden> wrote:

Hey Guys,

I am implementing the following class:


DEFINE_BLOCK_TYPE(NSBackgroundActivityCompletionHandler, void, NSBackgroundActivityResult);
DEFINE_BLOCK_TYPE(GSScheduledBlock, void, NSBackgroundActivityCompletionHandler);  

@interface NSBackgroundActivityScheduler : NSObject
{
  NSString *_identifier;
  NSQualityOfService _qualityOfService;
  NSTimeInterval _interval;
  NSTimeInterval _tolerance;
  BOOL _repeats;
  BOOL _shouldDefer;
}
  
- (instancetype) initWithIdentifier: (NSString *)identifier;

- (NSString *) identifier;
- (void) setIdentifier: (NSString *)identifier;

- (NSQualityOfService) qualityOfService;
- (void) setQualityOfService: (NSQualityOfService)qualityOfService;

- (BOOL) repeats;
- (void) setRepeats: (BOOL)flag;

- (NSTimeInterval) interval;
- (void) setInterval: (NSTimeInterval)interval;

- (NSTimeInterval) tolerance;
- (void) setTolerance: (NSTimeInterval)interval;

- (BOOL) shouldDefer;
- (void) setShouldDefer: (BOOL)flag;

- (void) scheduleWithBlock: (GSScheduledBlock)block;

- (void) invalidate;
  
@end

How do I handle the embedded block GSScheduledBlock??  Declaring it this way compiles, but I have no idea how to access the handler which is passed in.

Any clues?  

Thanks, GC

-- 
Gregory Casamento
GNUstep Lead Developer / OLC, Principal Consultant
http://www.gnustep.org - http://heronsperch.blogspot.com
http://ind.ie/phoenix/



MailtrackSender notified by 
Mailtrack 10/26/19, 10:39:17 AM




-- 
Gregory Casamento
GNUstep Lead Developer / OLC, Principal Consultant
http://www.gnustep.org - http://heronsperch.blogspot.com
http://ind.ie/phoenix/



--
Gregory Casamento
GNUstep Lead Developer / OLC, Principal Consultant
http://www.gnustep.org - http://heronsperch.blogspot.com
http://ind.ie/phoenix/

reply via email to

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