Skip to content

Commit

Permalink
Undefine __BLOCKS__ before the cups.h import as some versions of this
Browse files Browse the repository at this point in the history
header file expect unconditional that libdispatch is present when that
variable is defined.
Remove duplicated -allocWithZone: methods.
  • Loading branch information
fredkiefer committed Dec 28, 2017
1 parent ec19a2d commit 441af14
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2017-12-28 Fred Kiefer <[email protected]>

* Printing/GSCUPS/GSCUPSPrinter.m,
* Printing/GSCUPS/GSCUPSPrintInfo.m,
* Printing/GSCUPS/GSCUPSPrintOperation.m: Undefine __BLOCKS__
before the cups.h import as some versions of this header file
expect unconditional that libdispatch is present when that
variable is defined.
Remove duplicated -allocWithZone: methods.

2017-12-27 Richard Frith-Macdonald <[email protected]>

* Source/NSGraphicsContext.m: When using clang and the gnustep
Expand Down
14 changes: 6 additions & 8 deletions Printing/GSCUPS/GSCUPSPrintInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
#import "AppKit/NSPrinter.h"
#import "GSCUPSPrintInfo.h"
#import "GSCUPSPrinter.h"
// There are broken versions of cups.h where __BLOCKS__ requires
// libdispatch to be present. This has long been fixed in CUPS,
// but the file is still in CentOS 7.
#undef __BLOCKS__
#include <cups/cups.h>


Expand All @@ -45,18 +49,12 @@ + (void)initialize
if (self == [GSCUPSPrintInfo class])
{
// Initial version
[self setVersion:1];
[self setVersion: 1];
}
}


+ (id) allocWithZone: (NSZone*)zone
{
return NSAllocateObject(self, 0, zone);
}


+(NSPrinter*) defaultPrinter
+ (NSPrinter*) defaultPrinter
{
NSString *defaultName;
int numDests;
Expand Down
9 changes: 1 addition & 8 deletions Printing/GSCUPS/GSCUPSPrintOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,12 @@
#import <AppKit/NSPrintOperation.h>
#import "GSGuiPrivate.h"
#import "GSCUPSPrintOperation.h"
#undef __BLOCKS__
#include <cups/cups.h>


//A subclass of GSPrintOperation, NOT NSPrintOperation.
@implementation GSCUPSPrintOperation
//
// Class methods
//
+ (id) allocWithZone: (NSZone*)zone
{
return NSAllocateObject(self, 0, zone);
}


- (id)initWithView:(NSView *)aView
printInfo:(NSPrintInfo *)aPrintInfo
Expand Down
7 changes: 1 addition & 6 deletions Printing/GSCUPS/GSCUPSPrinter.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#import "GNUstepGUI/GSPrinting.h"
#import "GSCUPSPrinter.h"

#undef __BLOCKS__
#include <cups/cups.h>
#include <cups/ppd.h>

Expand All @@ -68,12 +69,6 @@ +(void) initialize
}
}


+(id) allocWithZone: (NSZone*) zone
{
return NSAllocateObject(self, 0, zone);
}

//
// Finding an NSPrinter
//
Expand Down

0 comments on commit 441af14

Please sign in to comment.