aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-devtools/osx-runtime/files/foundation_framework_headers_clang.patch
blob: 0f87c537c45d98b2471bee4896167ebd89d0d6da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSArray.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSArray.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSArray.h
@@ -55,7 +55,7 @@
 - (NSArray *)objectsAtIndexes:(NSIndexSet *)indexes;
 
 - (id)objectAtIndexedSubscript:(NSUInteger)idx NS_AVAILABLE(10_8, 6_0);
-
+#if defined(__clang__)
 - (void)enumerateObjectsUsingBlock:(void (^)(id obj, NSUInteger idx, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
 - (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (^)(id obj, NSUInteger idx, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
 - (void)enumerateObjectsAtIndexes:(NSIndexSet *)s options:(NSEnumerationOptions)opts usingBlock:(void (^)(id obj, NSUInteger idx, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
@@ -67,7 +67,20 @@
 - (NSIndexSet *)indexesOfObjectsPassingTest:(BOOL (^)(id obj, NSUInteger idx, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
 - (NSIndexSet *)indexesOfObjectsWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL (^)(id obj, NSUInteger idx, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
 - (NSIndexSet *)indexesOfObjectsAtIndexes:(NSIndexSet *)s options:(NSEnumerationOptions)opts passingTest:(BOOL (^)(id obj, NSUInteger idx, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
+#else
+- (void)enumerateObjectsUsingBlock:(void *(id obj, NSUInteger idx, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
+- (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void *(id obj, NSUInteger idx, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
+- (void)enumerateObjectsAtIndexes:(NSIndexSet *)s options:(NSEnumerationOptions)opts usingBlock:(void *(id obj, NSUInteger idx, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
+
+- (NSUInteger)indexOfObjectPassingTest:(BOOL *(id obj, NSUInteger idx, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
+- (NSUInteger)indexOfObjectWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL *(id obj, NSUInteger idx, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
+- (NSUInteger)indexOfObjectAtIndexes:(NSIndexSet *)s options:(NSEnumerationOptions)opts passingTest:(BOOL *(id obj, NSUInteger idx, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
+
+- (NSIndexSet *)indexesOfObjectsPassingTest:(BOOL *(id obj, NSUInteger idx, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
+- (NSIndexSet *)indexesOfObjectsWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL *(id obj, NSUInteger idx, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
+- (NSIndexSet *)indexesOfObjectsAtIndexes:(NSIndexSet *)s options:(NSEnumerationOptions)opts passingTest:(BOOL *(id obj, NSUInteger idx, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
 
+#endif
 - (NSArray *)sortedArrayUsingComparator:(NSComparator)cmptr NS_AVAILABLE(10_6, 4_0);
 - (NSArray *)sortedArrayWithOptions:(NSSortOptions)opts usingComparator:(NSComparator)cmptr NS_AVAILABLE(10_6, 4_0);
 
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSAttributedString.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSAttributedString.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSAttributedString.h
@@ -34,8 +34,13 @@
   NSAttributedStringEnumerationLongestEffectiveRangeNotRequired = (1UL << 20)
 };
 
+#if defined(__clang__)
 - (void)enumerateAttributesInRange:(NSRange)enumerationRange options:(NSAttributedStringEnumerationOptions)opts usingBlock:(void (^)(NSDictionary *attrs, NSRange range, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
 - (void)enumerateAttribute:(NSString *)attrName inRange:(NSRange)enumerationRange options:(NSAttributedStringEnumerationOptions)opts usingBlock:(void (^)(id value, NSRange range, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
+#else
+- (void)enumerateAttributesInRange:(NSRange)enumerationRange options:(NSAttributedStringEnumerationOptions)opts usingBlock:(void *(NSDictionary *attrs, NSRange range, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
+- (void)enumerateAttribute:(NSString *)attrName inRange:(NSRange)enumerationRange options:(NSAttributedStringEnumerationOptions)opts usingBlock:(void *(id value, NSRange range, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
+#endif
 
 @end
 
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSBackgroundActivityScheduler.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSBackgroundActivityScheduler.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSBackgroundActivityScheduler.h
@@ -15,7 +15,11 @@
     NSBackgroundActivityResultDeferred = 2,
 } NS_ENUM_AVAILABLE(10_10, NA);
 
+#if defined(__clang__)
 typedef void (^NSBackgroundActivityCompletionHandler)(NSBackgroundActivityResult result);
+#else
+typedef void *NSBackgroundActivityCompletionHandler;
+#endif
 
 /*
  This class provides a Cocoa-level interface to the XPC Activity API (see xpc/activity.h).
@@ -72,7 +76,11 @@
  
    When invoking the completionHandler, the system will set the schedule the next invocation. If you want to adjust the properties of your scheduler (e.g., the interval or tolerance), do this before invoking the completion block.
  */
+#if defined(__clang__)
 - (void)scheduleWithBlock:(void (^)(NSBackgroundActivityCompletionHandler completionHandler))block;
+#else
+- (void)scheduleWithBlock:(void *(NSBackgroundActivityCompletionHandler completionHandler))block;
+#endif
 
 /* Stop scheduling the activity. Any currently executing block will still complete.
  */
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSCalendar.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSCalendar.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSCalendar.h
@@ -318,7 +318,11 @@
 	Result dates have an integer number of seconds (as if 0 was specified for the nanoseconds property of the NSDateComponents matching parameter), unless a value was set in the nanoseconds property, in which case the result date will have that number of nanoseconds (or as close as possible with floating point numbers).
 	The enumeration is stopped by setting *stop = YES in the block and return.  It is not necessary to set *stop to NO to keep the enumeration going.
 */
+#if defined(__clang__)
 - (void)enumerateDatesStartingAfterDate:(NSDate *)start matchingComponents:(NSDateComponents *)comps options:(NSCalendarOptions)opts usingBlock:(void (^)(NSDate *date, BOOL exactMatch, BOOL *stop))block NS_AVAILABLE(10_9, 8_0);
+#else
+- (void)enumerateDatesStartingAfterDate:(NSDate *)start matchingComponents:(NSDateComponents *)comps options:(NSCalendarOptions)opts usingBlock:(void *(NSDate *date, BOOL exactMatch, BOOL *stop))block NS_AVAILABLE(10_9, 8_0);
+#endif
 
 /*
 	This method computes the next date which matches (or most closely matches) a given set of components.
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSData.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSData.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSData.h
@@ -93,7 +93,11 @@
 /*
  'block' is called once for each contiguous region of memory in the receiver (once total for contiguous NSDatas), until either all bytes have been enumerated, or the 'stop' parameter is set to YES.
  */
+#if defined(__clang__)
 - (void) enumerateByteRangesUsingBlock:(void (^)(const void *bytes, NSRange byteRange, BOOL *stop))block NS_AVAILABLE(10_9, 7_0);
+#else
+- (void) enumerateByteRangesUsingBlock:(void *(const void *bytes, NSRange byteRange, BOOL *stop))block NS_AVAILABLE(10_9, 7_0);
+#endif
 
 @end
 
@@ -110,7 +114,11 @@
 - (instancetype)initWithBytes:(const void *)bytes length:(NSUInteger)length;
 - (instancetype)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length;
 - (instancetype)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)b;
+#if defined(__clang__)
 - (instancetype)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length deallocator:(void (^)(void *bytes, NSUInteger length))deallocator NS_AVAILABLE(10_9, 7_0);
+#else
+- (instancetype)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length deallocator:(void *(void *bytes, NSUInteger length))deallocator NS_AVAILABLE(10_9, 7_0);
+#endif
 - (instancetype)initWithContentsOfFile:(NSString *)path options:(NSDataReadingOptions)readOptionsMask error:(NSError **)errorPtr;
 - (instancetype)initWithContentsOfURL:(NSURL *)url options:(NSDataReadingOptions)readOptionsMask error:(NSError **)errorPtr;
 - (instancetype)initWithContentsOfFile:(NSString *)path;
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSDictionary.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSDictionary.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSDictionary.h
@@ -44,14 +44,23 @@
 
 - (id)objectForKeyedSubscript:(id)key NS_AVAILABLE(10_8, 6_0);
 
+#if defined(__clang__)
 - (void)enumerateKeysAndObjectsUsingBlock:(void (^)(id key, id obj, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
 - (void)enumerateKeysAndObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (^)(id key, id obj, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
-
+#else
+- (void)enumerateKeysAndObjectsUsingBlock:(void *(id key, id obj, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
+- (void)enumerateKeysAndObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void *(id key, id obj, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
+#endif
 - (NSArray *)keysSortedByValueUsingComparator:(NSComparator)cmptr NS_AVAILABLE(10_6, 4_0);
 - (NSArray *)keysSortedByValueWithOptions:(NSSortOptions)opts usingComparator:(NSComparator)cmptr NS_AVAILABLE(10_6, 4_0);
 
+#if defined(__clang__)
 - (NSSet *)keysOfEntriesPassingTest:(BOOL (^)(id key, id obj, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
 - (NSSet *)keysOfEntriesWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL (^)(id key, id obj, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
+#else
+- (NSSet *)keysOfEntriesPassingTest:(BOOL *(id key, id obj, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
+- (NSSet *)keysOfEntriesWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL *(id key, id obj, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
+#endif
 
 @end
 
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSExpression.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSExpression.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSExpression.h
@@ -96,7 +96,11 @@
 + (NSExpression *)expressionForFunction:(NSExpression *)target selectorName:(NSString *)name arguments:(NSArray *)parameters NS_AVAILABLE(10_5, 3_0);    // Expression that invokes the selector on target with parameters. Will throw at runtime if target does not implement selector or if parameters are wrong.
 + (NSExpression *)expressionForAnyKey NS_AVAILABLE(10_9, 7_0);
 
+#if defined(__clang__)
 + (NSExpression *)expressionForBlock:(id (^)(id evaluatedObject, NSArray *expressions, NSMutableDictionary *context))block arguments:(NSArray *)arguments NS_AVAILABLE(10_6, 4_0); // Expression that invokes the block with the parameters; note that block expressions are not encodable or representable as parseable strings.
+#else
++ (NSExpression *)expressionForBlock:(id *(id evaluatedObject, NSArray *expressions, NSMutableDictionary *context))block arguments:(NSArray *)arguments NS_AVAILABLE(10_6, 4_0); // Expression that invokes the block with the parameters; note that block expressions are not encodable or representable as parseable strings.
+#endif
 
 - (instancetype)initWithExpressionType:(NSExpressionType)type;    // designated initializer
 
@@ -114,7 +118,11 @@
 @property (readonly, copy) NSExpression *leftExpression NS_AVAILABLE(10_5, 3_0); // expression which represents the left side of a set expression
 @property (readonly, copy) NSExpression *rightExpression NS_AVAILABLE(10_5, 3_0); // expression which represents the right side of a set expression
 
+#if defined(__clang__)
 @property (readonly, copy) id (^expressionBlock)(id, NSArray *, NSMutableDictionary *) NS_AVAILABLE(10_6, 4_0);
+#else
+@property (readonly) id *expressionBlock NS_AVAILABLE(10_6, 4_0);
+#endif
 
 // evaluate the expression using the object and bindings- note that context is mutable here and can be used by expressions to store temporary state for one predicate evaluation
 - (id)expressionValueWithObject:(id)object context:(NSMutableDictionary *)context;
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSFileCoordinator.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSFileCoordinator.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSFileCoordinator.h
@@ -165,7 +165,11 @@
  
 For both coordinated reading and writing, if there are multiple NSFilePresenters involved then the order in which they are messaged is undefined. If an NSFilePresenter signals failure then waiting will fail and *outError will be set to an NSError describing the failure.
 */
+#if defined(__clang__)
 - (void)coordinateAccessWithIntents:(NSArray *)intents queue:(NSOperationQueue *)queue byAccessor:(void (^)(NSError *error))accessor NS_AVAILABLE(10_10, 8_0);
+#else
+- (void)coordinateAccessWithIntents:(NSArray *)intents queue:(NSOperationQueue *)queue byAccessor:(void *(NSError *error))accessor NS_AVAILABLE(10_10, 8_0);
+#endif
 
 #pragma mark *** Synchronous File Coordination ***
 
@@ -177,10 +181,17 @@
  
 Each of these methods returns an NSError by reference instead of passing it to the accessory block. However, these methods are uncommon among Cocoa framework methods in that they don't also return a result indicating success or failure. The success of the waiting that they do is typically not interesting to invokers. Only the success of file system access done by the passed-in block is interesting. (The failure of either is of course interesting.) When invoking these methods it's cleanest to just declare a __block variable outside of the block and initialize it to a value that signals failure, and then inside the block set it to a value that signals success. If the waiting fails then the invoked method sets the error reference to an NSError that describes what went wrong, your block will not be invoked, your __block variable will not be set to a value that signals success, and all will be as it should be, with failure signaled and an NSError that describes the failure.
 */
+#if defined(__clang__)
 - (void)coordinateReadingItemAtURL:(NSURL *)url options:(NSFileCoordinatorReadingOptions)options error:(NSError **)outError byAccessor:(void (^)(NSURL *newURL))reader;
 - (void)coordinateWritingItemAtURL:(NSURL *)url options:(NSFileCoordinatorWritingOptions)options error:(NSError **)outError byAccessor:(void (^)(NSURL *newURL))writer;
 - (void)coordinateReadingItemAtURL:(NSURL *)readingURL options:(NSFileCoordinatorReadingOptions)readingOptions writingItemAtURL:(NSURL *)writingURL options:(NSFileCoordinatorWritingOptions)writingOptions error:(NSError **)outError byAccessor:(void (^)(NSURL *newReadingURL, NSURL *newWritingURL))readerWriter;
 - (void)coordinateWritingItemAtURL:(NSURL *)url1 options:(NSFileCoordinatorWritingOptions)options1 writingItemAtURL:(NSURL *)url2 options:(NSFileCoordinatorWritingOptions)options2 error:(NSError **)outError byAccessor:(void (^)(NSURL *newURL1, NSURL *newURL2))writer;
+#else
+- (void)coordinateReadingItemAtURL:(NSURL *)url options:(NSFileCoordinatorReadingOptions)options error:(NSError **)outError byAccessor:(void *(NSURL *newURL))reader;
+- (void)coordinateWritingItemAtURL:(NSURL *)url options:(NSFileCoordinatorWritingOptions)options error:(NSError **)outError byAccessor:(void *(NSURL *newURL))writer;
+- (void)coordinateReadingItemAtURL:(NSURL *)readingURL options:(NSFileCoordinatorReadingOptions)readingOptions writingItemAtURL:(NSURL *)writingURL options:(NSFileCoordinatorWritingOptions)writingOptions error:(NSError **)outError byAccessor:(void *(NSURL *newReadingURL, NSURL *newWritingURL))readerWriter;
+- (void)coordinateWritingItemAtURL:(NSURL *)url1 options:(NSFileCoordinatorWritingOptions)options1 writingItemAtURL:(NSURL *)url2 options:(NSFileCoordinatorWritingOptions)options2 error:(NSError **)outError byAccessor:(void *(NSURL *newURL1, NSURL *newURL2))writer;
+#endif
 
 #pragma mark *** Batched File Coordination ***
 
@@ -190,7 +201,11 @@
 
 In most cases it is redundant to pass the same reading or writing options in an invocation of this method as are passed to individual invocations of the -coordinate... methods invoked by the block passed to an invocation of this method. For example, when Finder invokes this method during a copy operation it does not pass NSFileCoordinatorReadingWithoutChanges because it is appropriate to trigger the saving of document changes right away, but it does pass it when doing the nested invocations of -coordinate... methods because it is not necessary to trigger saving again, even if the user changes the document before the Finder proceeds far enough to actually copy that document's file.
 */
+#if defined(__clang__)
 - (void)prepareForReadingItemsAtURLs:(NSArray *)readingURLs options:(NSFileCoordinatorReadingOptions)readingOptions writingItemsAtURLs:(NSArray *)writingURLs options:(NSFileCoordinatorWritingOptions)writingOptions error:(NSError **)outError byAccessor:(void (^)(void (^completionHandler)(void)))batchAccessor;
+#else
+- (void)prepareForReadingItemsAtURLs:(NSArray *)readingURLs options:(NSFileCoordinatorReadingOptions)readingOptions writingItemsAtURLs:(NSArray *)writingURLs options:(NSFileCoordinatorWritingOptions)writingOptions error:(NSError **)outError byAccessor:(void *(void *completionHandler))batchAccessor;
+#endif
 
 #pragma mark *** Renaming and Moving Notification ***
 
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSFileManager.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSFileManager.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSFileManager.h
@@ -227,7 +227,11 @@
 
     If you wish to only receive the URLs and no other attributes, then pass '0' for 'options' and an empty NSArray ('[NSArray array]') for 'keys'. If you wish to have the property caches of the vended URLs pre-populated with a default set of attributes, then pass '0' for 'options' and 'nil' for 'keys'.
  */
+#if defined(__clang__)
 - (NSDirectoryEnumerator *)enumeratorAtURL:(NSURL *)url includingPropertiesForKeys:(NSArray *)keys options:(NSDirectoryEnumerationOptions)mask errorHandler:(BOOL (^)(NSURL *url, NSError *error))handler NS_AVAILABLE(10_6, 4_0);
+#else
+- (NSDirectoryEnumerator *)enumeratorAtURL:(NSURL *)url includingPropertiesForKeys:(NSArray *)keys options:(NSDirectoryEnumerationOptions)mask errorHandler:(BOOL *(NSURL *url, NSError *error))handler NS_AVAILABLE(10_6, 4_0);
+#endif
 
 /* subpathsAtPath: returns an NSArray of all contents and subpaths recursively from the provided path. This may be very expensive to compute for deep filesystem hierarchies, and should probably be avoided.
  */
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSFilePresenter.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSFilePresenter.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSFilePresenter.h
@@ -40,13 +40,21 @@
 
 A common sequence that your NSFilePresenter must handle is the file coordination mechanism sending this message, then sending -savePresentedItemChangesWithCompletionHandler:, and then, after you have invoked that completion handler, invoking your reacquirer.
 */
+#if defined(__clang__)
 - (void)relinquishPresentedItemToReader:(void (^)(void (^reacquirer)(void)))reader;
+#else
+- (void)relinquishPresentedItemToReader:(void *(void *reacquirer(void)))reader;
+#endif
 
 /* Given that something in the system is waiting to write to the presented file or directory, do whatever it takes to ensure that the application will behave properly while that writing is happening, and then invoke the completion handler. The definition of "properly" depends on what kind of ownership model the application implements. Implementations of this method must always invoke the passed-in writer block because other parts of the system will wait until it is invoked or until the user loses patience and cancels the waiting. When an implementation of this method invokes the passed-in block it can pass that block yet another block, which will be invoked in the receiver's operation queue when writing is complete.
 
 A common sequence that your NSFilePresenter must handle is the file coordination mechanism sending this message, then sending -accommodatePresentedItemDeletionWithCompletionHandler: or -savePresentedItemChangesWithCompletionHandler:, and then, after you have invoked that completion handler, invoking your reacquirer. It is also common for your NSFilePresenter to be sent a combination of the -presented... messages listed below in between relinquishing and reacquiring.
 */
+#if defined(__clang__)
 - (void)relinquishPresentedItemToWriter:(void (^)(void (^reacquirer)(void)))writer;
+#else
+- (void)relinquishPresentedItemToWriter:(void *(void *reacquirer))writer;
+#endif
 
 /* Given that something in the system is waiting to read from the presented file or directory, do whatever it takes to ensure that the contents of the presented file or directory is completely up to date, and then invoke the completion handler. If successful (including when there is simply nothing to do) pass nil to the completion handler, or if not successful pass an NSError that encapsulates the reason why saving failed. Implementations of this method must always invoke the completion handler because other parts of the system will wait until it is invoked or the user loses patience and cancels the waiting. If this method is not implemented then the NSFilePresenter is assumed to be one that never lets the user make changes that need to be saved.
 
@@ -54,7 +62,11 @@
 
 The file coordination mechanism does not always send -relinquishPresentedItemToReader: or -relinquishPresentedItemToWriter: to your NSFilePresenter before sending this message. For example, other process' use of -[NSFileCoordinator prepareForReadingItemsAtURLs:options:writingItemsAtURLs:options:error:byAccessor:] can cause this to happen.
 */
+#if defined(__clang__)
 - (void)savePresentedItemChangesWithCompletionHandler:(void (^)(NSError *errorOrNil))completionHandler;
+#else
+- (void)savePresentedItemChangesWithCompletionHandler:(void *(NSError *errorOrNil))completionHandler;
+#endif
 
 /* Given that something in the system is waiting to delete the presented file or directory, do whatever it takes to ensure that the deleting will succeed and that the receiver's application will behave properly when the deleting has happened, and then invoke the completion handler. If successful (including when there is simply nothing to do) pass nil to the completion handler, or if not successful pass an NSError that encapsulates the reason why preparation failed. Implementations of this method must always invoke the completion handler because other parts of the system will wait until it is invoked or until the user loses patience and cancels the waiting.
 
@@ -62,7 +74,11 @@
 
 The file coordination mechanism does not always send -relinquishPresentedItemToReader: or -relinquishPresentedItemToWriter: to your NSFilePresenter before sending this message. For example, other process' use of -[NSFileCoordinator prepareForReadingItemsAtURLs:options:writingItemsAtURLs:options:error:byAccessor:] can cause this to happen.
 */
+#if defined(__clang__)
 - (void)accommodatePresentedItemDeletionWithCompletionHandler:(void (^)(NSError *errorOrNil))completionHandler;
+#else
+- (void)accommodatePresentedItemDeletionWithCompletionHandler:(void *(NSError *errorOrNil))completionHandler;
+#endif
 
 /* Be notified that the file or directory has been moved or renamed, or a directory containing it has been moved or renamed. A typical implementation of this method will cause subsequent invocations of -presentedItemURL to return the new URL.
 
@@ -104,7 +120,11 @@
 
 The file coordination mechanism does not always send -relinquishPresentedItemToReader: or -relinquishPresentedItemToWriter: to your NSFilePresenter before sending this message. For example, other process' use of -[NSFileCoordinator prepareForReadingItemsAtURLs:options:writingItemsAtURLs:options:error:byAccessor:] can cause this to happen.
 */
+#if defined(__clang__)
 - (void)accommodatePresentedSubitemDeletionAtURL:(NSURL *)url completionHandler:(void (^)(NSError *errorOrNil))completionHandler;
+#else
+- (void)accommodatePresentedSubitemDeletionAtURL:(NSURL *)url completionHandler:(void *(NSError *errorOrNil))completionHandler;
+#endif
 
 /* Be notified that a file or directory contained by the directory has been added. If this method is not implemented but -presentedItemDidChange is, and the directory is actually a file package, then the file coordination machinery will invoke -presentedItemDidChange instead.
 
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSFileVersion.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSFileVersion.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSFileVersion.h
@@ -62,7 +62,11 @@
  
 If you need to get all versions for a document, both local and non-local, you should use an NSFilePresenter that implements -presentedItemDidGainVersion: and -presentedItemDidLoseVersion: and invoke +[NSFileCoordinator addFilePresenter:], +[NSFileVersion otherVersionsOfItemAtURL:], and this method within a single coordinated read.
 */
+#if defined(__clang__)
 + (void)getNonlocalVersionsOfItemAtURL:(NSURL *)url completionHandler:(void (^)(NSArray *nonlocalFileVersions, NSError *error))completionHandler NS_AVAILABLE(10_10, 8_0);
+#else
++ (void)getNonlocalVersionsOfItemAtURL:(NSURL *)url completionHandler:(void *(NSArray *nonlocalFileVersions, NSError *error))completionHandler NS_AVAILABLE(10_10, 8_0);
+#endif
 
 /* For a file located by a URL, return the NSFileVersion identified by a persistent identifier of the sort returned by -persistentIdentifier, or nil if the version no longer exists.
 */
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSHTTPCookieStorage.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSHTTPCookieStorage.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSHTTPCookieStorage.h
@@ -129,7 +129,11 @@
 
 @interface NSHTTPCookieStorage (NSURLSessionTaskAdditions)
 - (void)storeCookies:(NSArray *)cookies forTask:(NSURLSessionTask *)task NS_AVAILABLE(10_10, 8_0);
+#if defined(__clang__)
 - (void)getCookiesForTask:(NSURLSessionTask *)task completionHandler:(void (^) (NSArray *cookies))completionHandler NS_AVAILABLE(10_10, 8_0);
+#else
+- (void)getCookiesForTask:(NSURLSessionTask *)task completionHandler:(void *(NSArray *cookies))completionHandler NS_AVAILABLE(10_10, 8_0);
+#endif
 @end
 
 /*!
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSIndexSet.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSIndexSet.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSIndexSet.h
@@ -79,6 +79,7 @@
 
 - (BOOL)intersectsIndexesInRange:(NSRange)range;
 
+#if defined(__clang__)
 - (void)enumerateIndexesUsingBlock:(void (^)(NSUInteger idx, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
 - (void)enumerateIndexesWithOptions:(NSEnumerationOptions)opts usingBlock:(void (^)(NSUInteger idx, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
 - (void)enumerateIndexesInRange:(NSRange)range options:(NSEnumerationOptions)opts usingBlock:(void (^)(NSUInteger idx, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
@@ -90,15 +91,34 @@
 - (NSIndexSet *)indexesPassingTest:(BOOL (^)(NSUInteger idx, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
 - (NSIndexSet *)indexesWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL (^)(NSUInteger idx, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
 - (NSIndexSet *)indexesInRange:(NSRange)range options:(NSEnumerationOptions)opts passingTest:(BOOL (^)(NSUInteger idx, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
+#else
+- (void)enumerateIndexesUsingBlock:(void *(NSUInteger idx, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
+- (void)enumerateIndexesWithOptions:(NSEnumerationOptions)opts usingBlock:(void *(NSUInteger idx, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
+- (void)enumerateIndexesInRange:(NSRange)range options:(NSEnumerationOptions)opts usingBlock:(void *(NSUInteger idx, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
+
+- (NSUInteger)indexPassingTest:(BOOL *(NSUInteger idx, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
+- (NSUInteger)indexWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL *(NSUInteger idx, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
+- (NSUInteger)indexInRange:(NSRange)range options:(NSEnumerationOptions)opts passingTest:(BOOL *(NSUInteger idx, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
+
+- (NSIndexSet *)indexesPassingTest:(BOOL *(NSUInteger idx, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
+- (NSIndexSet *)indexesWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL *(NSUInteger idx, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
+- (NSIndexSet *)indexesInRange:(NSRange)range options:(NSEnumerationOptions)opts passingTest:(BOOL *(NSUInteger idx, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
+#endif
 
 /*
  The following three convenience methods allow you to enumerate the indexes in the receiver by ranges of contiguous indexes. The performance of these methods is not guaranteed to be any better than if they were implemented with enumerateIndexesInRange:options:usingBlock:. However, depending on the receiver's implementation, they may perform better than that.
  
  If the specified range for enumeration intersects a range of contiguous indexes in the receiver, then the block will be invoked with the intersection of those two ranges.
 */
+#if defined(__clang__)
 - (void)enumerateRangesUsingBlock:(void (^)(NSRange range, BOOL *stop))block NS_AVAILABLE(10_7, 5_0);
 - (void)enumerateRangesWithOptions:(NSEnumerationOptions)opts usingBlock:(void (^)(NSRange range, BOOL *stop))block NS_AVAILABLE(10_7, 5_0);
 - (void)enumerateRangesInRange:(NSRange)range options:(NSEnumerationOptions)opts usingBlock:(void (^)(NSRange range, BOOL *stop))block NS_AVAILABLE(10_7, 5_0);
+#else
+- (void)enumerateRangesUsingBlock:(void *(NSRange range, BOOL *stop))block NS_AVAILABLE(10_7, 5_0);
+- (void)enumerateRangesWithOptions:(NSEnumerationOptions)opts usingBlock:(void *(NSRange range, BOOL *stop))block NS_AVAILABLE(10_7, 5_0);
+- (void)enumerateRangesInRange:(NSRange)range options:(NSEnumerationOptions)opts usingBlock:(void *(NSRange range, BOOL *stop))block NS_AVAILABLE(10_7, 5_0);
+#endif
 
 @end
 
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSLinguisticTagger.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSLinguisticTagger.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSLinguisticTagger.h
@@ -101,7 +101,11 @@
 
 /* The tagger will segment the string as needed into sentences and tokens, and return those ranges along with a tag for any scheme in its array of tag schemes.  The fundamental tagging method on NSLinguisticTagger is a block iterator, that iterates over all tokens intersecting a given range, supplying tags and ranges.  There are several additional convenience methods, for obtaining a sentence range, information about a single token, or for obtaining information about all tokens intersecting a given range at once, in arrays.  In each case, the charIndex or range passed in must not extend beyond the end of the tagger's string, or the methods will raise an exception.  Note that a given instance of NSLinguisticTagger should not be used from more than one thread simultaneously.
 */
+#if defined(__clang__)
 - (void)enumerateTagsInRange:(NSRange)range scheme:(NSString *)tagScheme options:(NSLinguisticTaggerOptions)opts usingBlock:(void (^)(NSString *tag, NSRange tokenRange, NSRange sentenceRange, BOOL *stop))block NS_AVAILABLE(10_7, 5_0);
+#else
+- (void)enumerateTagsInRange:(NSRange)range scheme:(NSString *)tagScheme options:(NSLinguisticTaggerOptions)opts usingBlock:(void *(NSString *tag, NSRange tokenRange, NSRange sentenceRange, BOOL *stop))block NS_AVAILABLE(10_7, 5_0);
+#endif
 
 - (NSRange)sentenceRangeForRange:(NSRange)range NS_AVAILABLE(10_7, 5_0);
 - (NSString *)tagAtIndex:(NSUInteger)charIndex scheme:(NSString *)tagScheme tokenRange:(NSRangePointer)tokenRange sentenceRange:(NSRangePointer)sentenceRange NS_AVAILABLE(10_7, 5_0);
@@ -115,7 +119,11 @@
 /* Clients wishing to analyze a given string once may use these NSString APIs without having to create an instance of NSLinguisticTagger.  If more than one tagging operation is needed on a given string, it is more efficient to use an explicit NSLinguisticTagger instance.
 */
 - (NSArray *)linguisticTagsInRange:(NSRange)range scheme:(NSString *)tagScheme options:(NSLinguisticTaggerOptions)opts orthography:(NSOrthography *)orthography tokenRanges:(NSArray **)tokenRanges NS_AVAILABLE(10_7, 5_0);
+#if defined(__clang__)
 - (void)enumerateLinguisticTagsInRange:(NSRange)range scheme:(NSString *)tagScheme options:(NSLinguisticTaggerOptions)opts orthography:(NSOrthography *)orthography usingBlock:(void (^)(NSString *tag, NSRange tokenRange, NSRange sentenceRange, BOOL *stop))block NS_AVAILABLE(10_7, 5_0);
+#else
+- (void)enumerateLinguisticTagsInRange:(NSRange)range scheme:(NSString *)tagScheme options:(NSLinguisticTaggerOptions)opts orthography:(NSOrthography *)orthography usingBlock:(void *(NSString *tag, NSRange tokenRange, NSRange sentenceRange, BOOL *stop))block NS_AVAILABLE(10_7, 5_0);
+#endif
 
 @end
 
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSMetadata.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSMetadata.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSMetadata.h
@@ -54,9 +54,13 @@
 // Results are NSMetadataItems, or whatever the delegate replaces that with
 @property (readonly) NSUInteger resultCount;
 - (id)resultAtIndex:(NSUInteger)idx;
-
+#if defined(__clang__)
 - (void)enumerateResultsUsingBlock:(void (^)(id result, NSUInteger idx, BOOL *stop))block NS_AVAILABLE(10_9, 7_0);
 - (void)enumerateResultsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (^)(id result, NSUInteger idx, BOOL *stop))block NS_AVAILABLE(10_9, 7_0);
+#else
+- (void)enumerateResultsUsingBlock:(void *(id result, NSUInteger idx, BOOL *stop))block NS_AVAILABLE(10_9, 7_0);
+- (void)enumerateResultsWithOptions:(NSEnumerationOptions)opts usingBlock:(void *(id result, NSUInteger idx, BOOL *stop))block NS_AVAILABLE(10_9, 7_0);
+#endif
 
 @property (readonly, copy) NSArray *results;   // this is for K-V Bindings, and causes side-effects on the query
 
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSNotification.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSNotification.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSNotification.h
@@ -48,7 +48,11 @@
 - (void)removeObserver:(id)observer;
 - (void)removeObserver:(id)observer name:(NSString *)aName object:(id)anObject;
 
+#if defined(__clang__)
 - (id <NSObject>)addObserverForName:(NSString *)name object:(id)obj queue:(NSOperationQueue *)queue usingBlock:(void (^)(NSNotification *note))block NS_AVAILABLE(10_6, 4_0);
+#else
+- (id <NSObject>)addObserverForName:(NSString *)name object:(id)obj queue:(NSOperationQueue *)queue usingBlock:(void *(NSNotification *note))block NS_AVAILABLE(10_6, 4_0);
+#endif
     // The return value is retained by the system, and should be held onto by the caller in
     // order to remove the observer with removeObserver: later, to stop observation.
 
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSObjCRuntime.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSObjCRuntime.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSObjCRuntime.h
@@ -224,7 +224,10 @@
 #endif
 #endif
 
+#pragma warning "!!!!!!!!!!!!! Here (jb)"
+
 #if !__has_feature(objc_instancetype)
+#pragma warning "!!!!!!!!!!!!! Here-1 (jb)"
 #undef instancetype
 #define instancetype id
 #endif
@@ -416,9 +419,16 @@
 typedef NS_ENUM(NSInteger, NSComparisonResult) {NSOrderedAscending = -1L, NSOrderedSame, NSOrderedDescending};
 
 #if NS_BLOCKS_AVAILABLE
-typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
+  #if defined(__clang__)
+    typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
+  #else
+    typedef NSComparisonResult *NSComparator;
+  #endif
+#else
+  typedef NSComparisonResult *NSComparator;
 #endif
 
+
 typedef NS_OPTIONS(NSUInteger, NSEnumerationOptions) {
     NSEnumerationConcurrent = (1UL << 0),
     NSEnumerationReverse = (1UL << 1),
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSOperation.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSOperation.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSOperation.h
@@ -53,7 +53,11 @@
 
 @property NSOperationQueuePriority queuePriority;
 
+#if defined(__clang__)
 @property (copy) void (^completionBlock)(void) NS_AVAILABLE(10_6, 4_0);
+#else
+@property void *completionBlock NS_AVAILABLE(10_6, 4_0);
+#endif
 
 - (void)waitUntilFinished NS_AVAILABLE(10_6, 4_0);
 
@@ -74,9 +78,16 @@
     void *_reserved2;
 }
 
+#if defined(__clang__)
 + (instancetype)blockOperationWithBlock:(void (^)(void))block;
 
 - (void)addExecutionBlock:(void (^)(void))block;
+#else
++ (instancetype)blockOperationWithBlock:(void *(void))block;
+
+- (void)addExecutionBlock:(void *(void))block;
+#endif
+
 @property (readonly, copy) NSArray *executionBlocks;
 
 @end
@@ -112,7 +123,11 @@
 - (void)addOperation:(NSOperation *)op;
 - (void)addOperations:(NSArray *)ops waitUntilFinished:(BOOL)wait NS_AVAILABLE(10_6, 4_0);
 
+#if defined(__clang__)
 - (void)addOperationWithBlock:(void (^)(void))block NS_AVAILABLE(10_6, 4_0);
+#else
+- (void)addOperationWithBlock:(void *(void))block NS_AVAILABLE(10_6, 4_0);
+#endif
 
 @property (readonly, copy) NSArray *operations;
 @property (readonly) NSUInteger operationCount NS_AVAILABLE(10_6, 4_0);
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSOrderedSet.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSOrderedSet.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSOrderedSet.h
@@ -55,6 +55,7 @@
 @property (readonly, copy) NSArray *array;
 @property (readonly, copy) NSSet *set;
 
+#if defined(__clang__)
 - (void)enumerateObjectsUsingBlock:(void (^)(id obj, NSUInteger idx, BOOL *stop))block;
 - (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (^)(id obj, NSUInteger idx, BOOL *stop))block;
 - (void)enumerateObjectsAtIndexes:(NSIndexSet *)s options:(NSEnumerationOptions)opts usingBlock:(void (^)(id obj, NSUInteger idx, BOOL *stop))block;
@@ -66,7 +67,19 @@
 - (NSIndexSet *)indexesOfObjectsPassingTest:(BOOL (^)(id obj, NSUInteger idx, BOOL *stop))predicate;
 - (NSIndexSet *)indexesOfObjectsWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL (^)(id obj, NSUInteger idx, BOOL *stop))predicate;
 - (NSIndexSet *)indexesOfObjectsAtIndexes:(NSIndexSet *)s options:(NSEnumerationOptions)opts passingTest:(BOOL (^)(id obj, NSUInteger idx, BOOL *stop))predicate;
+#else
+- (void)enumerateObjectsUsingBlock:(void *(id obj, NSUInteger idx, BOOL *stop))block;
+- (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void *(id obj, NSUInteger idx, BOOL *stop))block;
+- (void)enumerateObjectsAtIndexes:(NSIndexSet *)s options:(NSEnumerationOptions)opts usingBlock:(void *(id obj, NSUInteger idx, BOOL *stop))block;
 
+- (NSUInteger)indexOfObjectPassingTest:(BOOL *(id obj, NSUInteger idx, BOOL *stop))predicate;
+- (NSUInteger)indexOfObjectWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL *(id obj, NSUInteger idx, BOOL *stop))predicate;
+- (NSUInteger)indexOfObjectAtIndexes:(NSIndexSet *)s options:(NSEnumerationOptions)opts passingTest:(BOOL *(id obj, NSUInteger idx, BOOL *stop))predicate;
+
+- (NSIndexSet *)indexesOfObjectsPassingTest:(BOOL *(id obj, NSUInteger idx, BOOL *stop))predicate;
+- (NSIndexSet *)indexesOfObjectsWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL *(id obj, NSUInteger idx, BOOL *stop))predicate;
+- (NSIndexSet *)indexesOfObjectsAtIndexes:(NSIndexSet *)s options:(NSEnumerationOptions)opts passingTest:(BOOL *(id obj, NSUInteger idx, BOOL *stop))predicate;
+#endif
 - (NSUInteger)indexOfObject:(id)object inSortedRange:(NSRange)range options:(NSBinarySearchingOptions)opts usingComparator:(NSComparator)cmp; // binary search
 
 - (NSArray *)sortedArrayUsingComparator:(NSComparator)cmptr;
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSPredicate.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSPredicate.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSPredicate.h
@@ -28,8 +28,11 @@
 + (NSPredicate *)predicateFromMetadataQueryString:(NSString *)queryString NS_AVAILABLE_MAC(10_9);
 
 + (NSPredicate *)predicateWithValue:(BOOL)value;    // return predicates that always evaluate to true/false
-
+#if defined(__clang__)
 + (NSPredicate*)predicateWithBlock:(BOOL (^)(id evaluatedObject, NSDictionary *bindings))block NS_AVAILABLE(10_6, 4_0);
+#else
++ (NSPredicate*)predicateWithBlock:(BOOL *(id evaluatedObject, NSDictionary *bindings))block NS_AVAILABLE(10_6, 4_0);
+#endif
 
 @property (readonly, copy) NSString *predicateFormat;    // returns the format string of the predicate
 
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSProcessInfo.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSProcessInfo.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSProcessInfo.h
@@ -165,7 +165,11 @@
 /*
  * Synchronously perform an activity. The activity will be automatically ended after your block argument returns. The reason string is used for debugging.
  */
+#if defined(__clang__)
 - (void)performActivityWithOptions:(NSActivityOptions)options reason:(NSString *)reason usingBlock:(void (^)(void))block NS_AVAILABLE(10_9, 7_0);
+#else
+- (void)performActivityWithOptions:(NSActivityOptions)options reason:(NSString *)reason usingBlock:(void *(void))block NS_AVAILABLE(10_9, 7_0);
+#endif
 
 @end
 
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSProgress.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSProgress.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSProgress.h
@@ -15,9 +15,15 @@
     int64_t _reserved4;
     id _values;
     id _reserved5;
+#if defined(__clang__)
     void (^_cancellationHandler)(void);
     void (^_pausingHandler)(void);
     void (^_prioritizationHandler)(void);
+#else
+    void *_cancellationHandler;
+    void *_pausingHandler;
+    void *prioritizationHandler;
+#endif
     uint64_t _flags;
     id _userInfoProxy;
     NSString *_publisherID;
@@ -98,8 +104,13 @@
 
 /* A block to be invoked when -cancel or -pause is invoked, respectively. The block will be invoked even when the method is invoked on an ancestor of the receiver, or an instance of NSProgress in another process that resulted from publishing the receiver or an ancestor of the receiver. Your block won't be invoked on any particular queue. If it must do work on a specific queue then it should schedule that work on that queue.
 */
+#if defined(__clang__)
 @property (copy) void (^cancellationHandler)(void);
 @property (copy) void (^pausingHandler)(void);
+#else
+@property void *cancellationHandler;
+@property void *pausingHandler;
+#endif
 
 /* Set a value in the dictionary returned by invocations of -userInfo, with appropriate KVO notification for properties whose values can depend on values in the user info dictionary, like localizedDescription. If a nil value is passed then the dictionary entry is removed.
 */
@@ -150,8 +161,13 @@
 
 #pragma mark *** Observing and Controlling File Progress by Other Processes (OS X Only) ***
 
+#if defined(__clang__)
 typedef void (^NSProgressUnpublishingHandler)(void);
 typedef NSProgressUnpublishingHandler (^NSProgressPublishingHandler)(NSProgress *progress);
+#else
+typedef void *NSProgressUnpublishingHandler;
+typedef NSProgressUnpublishingHandler *NSProgressPublishingHandler;
+#endif
 
 /* Register to hear about file progress. The passed-in block will be invoked when -publish has been sent to an NSProgress whose NSProgressFileURLKey user info dictionary entry is an NSURL locating the same item located by the passed-in NSURL, or an item directly contained by it. The NSProgress passed to your block will be a proxy of the one that was published. The passed-in block may return another block. If it does, then that returned block will be invoked when the corresponding invocation of -unpublish is made, or the publishing process terminates, or +removeSubscriber: is invoked. Your blocks will be invoked on the main thread.
 */
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSRegularExpression.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSRegularExpression.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSRegularExpression.h
@@ -69,7 +69,11 @@
 /* The fundamental matching method on NSRegularExpression is a block iterator.  There are several additional convenience methods, for returning all matches at once, the number of matches, the first match, or the range of the first match.  Each match is specified by an instance of NSTextCheckingResult (of type NSTextCheckingTypeRegularExpression) in which the overall match range is given by the range property (equivalent to rangeAtIndex:0) and any capture group ranges are given by rangeAtIndex: for indexes from 1 to numberOfCaptureGroups.  {NSNotFound, 0} is used if a particular capture group does not participate in the match.
 */
 
+#if defined(__clang__)
 - (void)enumerateMatchesInString:(NSString *)string options:(NSMatchingOptions)options range:(NSRange)range usingBlock:(void (^)(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop))block;
+#else
+- (void)enumerateMatchesInString:(NSString *)string options:(NSMatchingOptions)options range:(NSRange)range usingBlock:(void *(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop))block;
+#endif
 
 - (NSArray *)matchesInString:(NSString *)string options:(NSMatchingOptions)options range:(NSRange)range;
 - (NSUInteger)numberOfMatchesInString:(NSString *)string options:(NSMatchingOptions)options range:(NSRange)range;
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSSet.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSSet.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSSet.h
@@ -38,12 +38,19 @@
 - (NSSet *)setByAddingObjectsFromSet:(NSSet *)other NS_AVAILABLE(10_5, 2_0);
 - (NSSet *)setByAddingObjectsFromArray:(NSArray *)other NS_AVAILABLE(10_5, 2_0);
 
+#if defined(__clang__)
 - (void)enumerateObjectsUsingBlock:(void (^)(id obj, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
 - (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (^)(id obj, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
 
 - (NSSet *)objectsPassingTest:(BOOL (^)(id obj, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
 - (NSSet *)objectsWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL (^)(id obj, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
+#else
+- (void)enumerateObjectsUsingBlock:(void *(id obj, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
+- (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void *(id obj, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
 
+- (NSSet *)objectsPassingTest:(BOOL *(id obj, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
+- (NSSet *)objectsWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL *(id obj, BOOL *stop))predicate NS_AVAILABLE(10_6, 4_0);
+#endif
 @end
 
 @interface NSSet (NSSetCreation)
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSString.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSString.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSString.h
@@ -184,8 +184,14 @@
 
 /* In the enumerate methods, the blocks will be invoked inside an autorelease pool, so any values assigned inside the block should be retained.
 */
+#if defined(__clang__)
 - (void)enumerateSubstringsInRange:(NSRange)range options:(NSStringEnumerationOptions)opts usingBlock:(void (^)(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
 - (void)enumerateLinesUsingBlock:(void (^)(NSString *line, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
+#else
+- (void)enumerateSubstringsInRange:(NSRange)range options:(NSStringEnumerationOptions)opts usingBlock:(void *(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
+- (void)enumerateLinesUsingBlock:(void *(NSString *line, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
+#endif
+
 
 @property (readonly, copy) NSString *description;
 
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSTask.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSTask.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSTask.h
@@ -52,7 +52,11 @@
 /*
 A block to be invoked when the process underlying the NSTask terminates.  Setting the block to nil is valid, and stops the previous block from being invoked, as long as it hasn't started in any way.  The NSTask is passed as the argument to the block so the block does not have to capture, and thus retain, it.  The block is copied when set.  Only one termination handler block can be set at any time.  The execution context in which the block is invoked is undefined.  If the NSTask has already finished, the block is executed immediately/soon (not necessarily on the current thread).  If a terminationHandler is set on an NSTask, the NSTaskDidTerminateNotification notification is not posted for that task.  Also note that -waitUntilExit won't wait until the terminationHandler has been fully executed.  You cannot use this property in a concrete subclass of NSTask which hasn't been updated to include an implementation of the storage and use of it.  
 */
+#if defined(__clang__)
 @property (copy) void (^terminationHandler)(NSTask *) NS_AVAILABLE(10_7, NA);
+#else
+@property void *terminationHandler NS_AVAILABLE(10_7, NA);
+#endif
 
 @property NSQualityOfService qualityOfService NS_AVAILABLE(10_10, 8_0); // read-only after the task is launched
 
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSURLCache.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSURLCache.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSURLCache.h
@@ -255,6 +255,11 @@
 
 @interface NSURLCache (NSURLSessionTaskAdditions)
 - (void)storeCachedResponse:(NSCachedURLResponse *)cachedResponse forDataTask:(NSURLSessionDataTask *)dataTask NS_AVAILABLE(10_10, 8_0);
+#if defined(__clang__)
 - (void)getCachedResponseForDataTask:(NSURLSessionDataTask *)dataTask completionHandler:(void (^) (NSCachedURLResponse *cachedResponse))completionHandler NS_AVAILABLE(10_10, 8_0);
+#else
+- (void)getCachedResponseForDataTask:(NSURLSessionDataTask *)dataTask completionHandler:(void *(NSCachedURLResponse *cachedResponse))completionHandler NS_AVAILABLE(10_10, 8_0);
+#endif
 - (void)removeCachedResponseForDataTask:(NSURLSessionDataTask *)dataTask NS_AVAILABLE(10_10, 8_0);
+
 @end
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSURLConnection.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSURLConnection.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSURLConnection.h
@@ -449,9 +449,15 @@
     @param
          handler   A block which receives the results of the resource load.
  */
+#if defined(__clang__) 
 + (void)sendAsynchronousRequest:(NSURLRequest*) request
                           queue:(NSOperationQueue*) queue
               completionHandler:(void (^)(NSURLResponse* response, NSData* data, NSError* connectionError)) handler NS_AVAILABLE(10_7, 5_0);
+#else
++ (void)sendAsynchronousRequest:(NSURLRequest*) request
+                          queue:(NSOperationQueue*) queue
+              completionHandler:(void *(NSURLResponse* response, NSData* data, NSError* connectionError)) handler NS_AVAILABLE(10_7, 5_0);
+#endif
            
 @end
                    
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSURLCredentialStorage.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSURLCredentialStorage.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSURLCredentialStorage.h
@@ -104,10 +104,18 @@
 @end
 
 @interface NSURLCredentialStorage (NSURLSessionTaskAdditions)
+#if defined(__clang__)
 - (void)getCredentialsForProtectionSpace:(NSURLProtectionSpace *)protectionSpace task:(NSURLSessionTask *)task completionHandler:(void (^) (NSDictionary *credentials))completionHandler NS_AVAILABLE(10_10, 8_0);
+#else
+- (void)getCredentialsForProtectionSpace:(NSURLProtectionSpace *)protectionSpace task:(NSURLSessionTask *)task completionHandler:(void *(NSDictionary *credentials))completionHandler NS_AVAILABLE(10_10, 8_0);
+#endif
 - (void)setCredential:(NSURLCredential *)credential forProtectionSpace:(NSURLProtectionSpace *)protectionSpace task:(NSURLSessionTask *)task NS_AVAILABLE(10_10, 8_0);
 - (void)removeCredential:(NSURLCredential *)credential forProtectionSpace:(NSURLProtectionSpace *)protectionSpace options:(NSDictionary *)options task:(NSURLSessionTask *)task NS_AVAILABLE(10_10, 8_0);
+#if defined(__clang__)
 - (void)getDefaultCredentialForProtectionSpace:(NSURLProtectionSpace *)space task:(NSURLSessionTask *)task completionHandler:(void (^) (NSURLCredential *credential))completionHandler NS_AVAILABLE(10_10, 8_0);
+#else
+- (void)getDefaultCredentialForProtectionSpace:(NSURLProtectionSpace *)space task:(NSURLSessionTask *)task completionHandler:(void *(NSURLCredential *credential))completionHandler NS_AVAILABLE(10_10, 8_0);
+#endif
 - (void)setDefaultCredential:(NSURLCredential *)credential forProtectionSpace:(NSURLProtectionSpace *)protectionSpace task:(NSURLSessionTask *)task NS_AVAILABLE(10_10, 8_0);
 @end
 
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSURLSession.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSURLSession.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSURLSession.h
@@ -146,11 +146,17 @@
  */
 - (void)invalidateAndCancel;
 
+#if defined(__clang__)
 - (void)resetWithCompletionHandler:(void (^)(void))completionHandler;    /* empty all cookies, cache and credential stores, removes disk files, issues -flushWithCompletionHandler:. Invokes completionHandler() on the delegate queue if not nil. */
 - (void)flushWithCompletionHandler:(void (^)(void))completionHandler;    /* flush storage to disk and clear transient network caches.  Invokes completionHandler() on the delegate queue if not nil. */
 
 - (void)getTasksWithCompletionHandler:(void (^)(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks))completionHandler; /* invokes completionHandler with outstanding data, upload and download tasks. */
+#else
+- (void)resetWithCompletionHandler:(void *(void))completionHandler;    /* empty all cookies, cache and credential stores, removes disk files, issues -flushWithCompletionHandler:. Invokes completionHandler() on the delegate queue if not nil. */
+- (void)flushWithCompletionHandler:(void *(void))completionHandler;    /* flush storage to disk and clear transient network caches.  Invokes completionHandler() on the delegate queue if not nil. */
 
+- (void)getTasksWithCompletionHandler:(void *(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks))completionHandler; /* invokes completionHandler with outstanding data, upload and download tasks. */
+#endif
 /* 
  * NSURLSessionTask objects are always created in a suspended state and
  * must be sent the -resume message before they will execute.
@@ -200,24 +206,41 @@
  * see <Foundation/NSURLError.h>.  The delegate, if any, will still be
  * called for authentication challenges.
  */
+#if defined(__clang__)
 - (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request completionHandler:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler NS_CLASS_AVAILABLE(NSURLSESSION_AVAILABLE, 7_0);
 - (NSURLSessionDataTask *)dataTaskWithURL:(NSURL *)url completionHandler:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler NS_CLASS_AVAILABLE(NSURLSESSION_AVAILABLE, 7_0);
+#else
+- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request completionHandler:(void *(NSData *data, NSURLResponse *response, NSError *error))completionHandler NS_CLASS_AVAILABLE(NSURLSESSION_AVAILABLE, 7_0);
+- (NSURLSessionDataTask *)dataTaskWithURL:(NSURL *)url completionHandler:(void *(NSData *data, NSURLResponse *response, NSError *error))completionHandler NS_CLASS_AVAILABLE(NSURLSESSION_AVAILABLE, 7_0);
+#endif
 
 /*
  * upload convenience method.
  */
+#if defined(__clang__)
 - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request fromFile:(NSURL *)fileURL completionHandler:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler NS_CLASS_AVAILABLE(NSURLSESSION_AVAILABLE, 7_0);
 - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request fromData:(NSData *)bodyData completionHandler:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler NS_CLASS_AVAILABLE(NSURLSESSION_AVAILABLE, 7_0);
+#else
+- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request fromFile:(NSURL *)fileURL completionHandler:(void *(NSData *data, NSURLResponse *response, NSError *error))completionHandler NS_CLASS_AVAILABLE(NSURLSESSION_AVAILABLE, 7_0);
+- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request fromData:(NSData *)bodyData completionHandler:(void *(NSData *data, NSURLResponse *response, NSError *error))completionHandler NS_CLASS_AVAILABLE(NSURLSESSION_AVAILABLE, 7_0);
 
+#endif
 /*
  * download task convenience methods.  When a download successfully
  * completes, the NSURL will point to a file that must be read or
  * copied during the invocation of the completion routine.  The file
  * will be removed automatically.
  */
+ 
+#if defined(__clang__)
 - (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request completionHandler:(void (^)(NSURL *location, NSURLResponse *response, NSError *error))completionHandler NS_CLASS_AVAILABLE(NSURLSESSION_AVAILABLE, 7_0);
 - (NSURLSessionDownloadTask *)downloadTaskWithURL:(NSURL *)url completionHandler:(void (^)(NSURL *location, NSURLResponse *response, NSError *error))completionHandler NS_CLASS_AVAILABLE(NSURLSESSION_AVAILABLE, 7_0);
 - (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData completionHandler:(void (^)(NSURL *location, NSURLResponse *response, NSError *error))completionHandler NS_CLASS_AVAILABLE(NSURLSESSION_AVAILABLE, 7_0);
+#else
+- (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request completionHandler:(void *(NSURL *location, NSURLResponse *response, NSError *error))completionHandler NS_CLASS_AVAILABLE(NSURLSESSION_AVAILABLE, 7_0);
+- (NSURLSessionDownloadTask *)downloadTaskWithURL:(NSURL *)url completionHandler:(void *(NSURL *location, NSURLResponse *response, NSError *error))completionHandler NS_CLASS_AVAILABLE(NSURLSESSION_AVAILABLE, 7_0);
+- (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData completionHandler:(void *(NSURL *location, NSURLResponse *response, NSError *error))completionHandler NS_CLASS_AVAILABLE(NSURLSESSION_AVAILABLE, 7_0);
+#endif
 
 @end
 
@@ -347,7 +370,11 @@
  * If resume data cannot be created, the completion handler will be
  * called with nil resumeData.
  */
+#if defined(__clang__)
 - (void)cancelByProducingResumeData:(void (^)(NSData *resumeData))completionHandler;
+#else
+- (void)cancelByProducingResumeData:(void *(NSData *resumeData))completionHandler;
+#endif
 
 @end
 
@@ -497,8 +524,13 @@
  * behavior will be to use the default handling, which may involve user
  * interaction. 
  */
+#if defined(__clang__)
 - (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge
                                              completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler;
+#else
+- (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge
+                                             completionHandler:(void *(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler;
+#endif                                             
 
 /* If an application has received an
  * -application:handleEventsForBackgroundURLSession:completionHandler:
@@ -527,26 +559,44 @@
  *
  * For tasks in background sessions, redirections will always be followed and this method will not be called.
  */
+#if defined(__clang__) 
 - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task
                      willPerformHTTPRedirection:(NSHTTPURLResponse *)response
                                      newRequest:(NSURLRequest *)request
                               completionHandler:(void (^)(NSURLRequest *))completionHandler;
+#else
+- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task
+                     willPerformHTTPRedirection:(NSHTTPURLResponse *)response
+                                     newRequest:(NSURLRequest *)request
+                              completionHandler:(void *(NSURLRequest *))completionHandler;
+#endif
 
 /* The task has received a request specific authentication challenge.
  * If this delegate is not implemented, the session specific authentication challenge
  * will *NOT* be called and the behavior will be the same as using the default handling
  * disposition. 
  */
+#if defined(__clang__) 
 - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task
                             didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge 
                               completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler;
+#else
+- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task
+                            didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge 
+                              completionHandler:(void *(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler;
+#endif
 
 /* Sent if a task requires a new, unopened body stream.  This may be
  * necessary when authentication has failed for any request that
  * involves a body stream. 
  */
+#if defined(__clang__)
 - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task
                               needNewBodyStream:(void (^)(NSInputStream *bodyStream))completionHandler;
+#else
+- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task
+                              needNewBodyStream:(void *(NSInputStream *bodyStream))completionHandler;
+#endif
 
 /* Sent periodically to notify the delegate of upload progress.  This
  * information is also available as properties of the task.
@@ -578,9 +628,15 @@
  *
  * This method will not be called for background upload tasks (which cannot be converted to download tasks).
  */
+#if defined(__clang__)
 - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask
                                  didReceiveResponse:(NSURLResponse *)response
                                   completionHandler:(void (^)(NSURLSessionResponseDisposition disposition))completionHandler;
+#else
+- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask
+                                 didReceiveResponse:(NSURLResponse *)response
+                                  completionHandler:(void *(NSURLSessionResponseDisposition disposition))completionHandler;
+#endif
 
 /* Notification that a data task has become a download task.  No
  * future messages will be sent to the data task.
@@ -602,10 +658,15 @@
  * attempted for a given resource, and you should not rely on this
  * message to receive the resource data.
  */
+#if defined(__clang__)
 - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask
                                   willCacheResponse:(NSCachedURLResponse *)proposedResponse 
                                   completionHandler:(void (^)(NSCachedURLResponse *cachedResponse))completionHandler;
-
+#else
+- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask
+                                  willCacheResponse:(NSCachedURLResponse *)proposedResponse 
+                                  completionHandler:(void *(NSCachedURLResponse *cachedResponse))completionHandler;
+#endif
 @end
 
 /*
@@ -652,7 +713,11 @@
 - (NSURLSessionDataTask *)dataTaskWithHTTPGetRequest:(NSURL *)url NS_DEPRECATED(NSURLSESSION_AVAILABLE, NSURLSESSION_AVAILABLE, 7_0, 7_0);
 
 /* Use -dataTaskWithURL:completionHandler: instead */
+#if defined(__clang__)
 - (NSURLSessionDataTask *)dataTaskWithHTTPGetRequest:(NSURL *)url completionHandler:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler NS_DEPRECATED(NSURLSESSION_AVAILABLE, NSURLSESSION_AVAILABLE, 7_0, 7_0);
+#else
+- (NSURLSessionDataTask *)dataTaskWithHTTPGetRequest:(NSURL *)url completionHandler:(void *(NSData *data, NSURLResponse *response, NSError *error))completionHandler NS_DEPRECATED(NSURLSESSION_AVAILABLE, NSURLSESSION_AVAILABLE, 7_0, 7_0);
+#endif
 @end
 
 @interface NSURLSessionConfiguration (NSURLSessionDeprecated)
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSUserScriptTask.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSUserScriptTask.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSUserScriptTask.h
@@ -34,7 +34,11 @@
 @property (readonly, copy) NSURL *scriptURL;
 
 // Execute the script with no input and ignoring any result.  This and the other "execute" methods below may be called at most once on any given instance.  If the script completed normally, the completion handler's "error" parameter will be nil.
+#if defined(__clang__)
 typedef void (^NSUserScriptTaskCompletionHandler)(NSError *error);
+#else
+typedef void *NSUserScriptTaskCompletionHandler;
+#endif
 - (void)executeWithCompletionHandler:(NSUserScriptTaskCompletionHandler)handler;
 
 @end
@@ -51,9 +55,12 @@
 @property (retain) NSFileHandle *standardError;
 
 // Execute the file with the given arguments.  "arguments" is an array of NSStrings.  The arguments do not undergo shell expansion, so you do not need to do special quoting, and shell variables are not resolved.
+#if defined(__clang__)
 typedef void (^NSUserUnixTaskCompletionHandler)(NSError *error);
+#else
+typedef void *NSUserUnixTaskCompletionHandler;
+#endif
 - (void)executeWithArguments:(NSArray *)arguments completionHandler:(NSUserUnixTaskCompletionHandler)handler;
-
 @end
 
 
@@ -66,7 +73,11 @@
 }
 
 // Execute the AppleScript script by sending it the given Apple event.  Pass nil to execute the script's default "run" handler.
+#if defined(__clang__)
 typedef void (^NSUserAppleScriptTaskCompletionHandler)(NSAppleEventDescriptor *result, NSError *error);
+#else
+typedef void *NSUserAppleScriptTaskCompletionHandler;
+#endif
 - (void)executeWithAppleEvent:(NSAppleEventDescriptor *)event completionHandler:(NSUserAppleScriptTaskCompletionHandler)handler;
 
 @end
@@ -84,7 +95,11 @@
 @property (copy) NSDictionary *variables;
 
 // Execute the Automator workflow, passing it the given input.
+#if defined(__clang__)
 typedef void (^NSUserAutomatorTaskCompletionHandler)(id result, NSError *error);
+#else
+typedef void *NSUserAutomatorTaskCompletionHandler;
+#endif
 - (void)executeWithInput:(id <NSSecureCoding>)input completionHandler:(NSUserAutomatorTaskCompletionHandler)handler;
 
 @end
Index: OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSXPCConnection.h
===================================================================
--- OSX-sdk.orig/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSXPCConnection.h
+++ OSX-sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSXPCConnection.h
@@ -21,7 +21,11 @@
 - (id)remoteObjectProxy;
 
 // Returns a proxy object which will invoke the error handling block if an error occurs on the connection. If the message sent to the proxy has a reply handler, then either the error handler or the reply handler will be called exactly once. This proxy object will also conform with the NSXPCProxyCreating protocol.
+#if defined(__clang__)
 - (id)remoteObjectProxyWithErrorHandler:(void (^)(NSError *error))handler;
+#else
+- (id)remoteObjectProxyWithErrorHandler:(void *(NSError *error))handler;
+#endif
 
 @end
 
@@ -42,8 +46,13 @@
     dispatch_queue_t _userQueue;
     uint32_t _state;
     uint32_t _state2;
+#if defined(__clang__)
     void (^_interruptionHandler)();
     void (^_invalidationHandler)();
+#else
+    void *_interruptionHandler;
+    void *_invalidationHandler;
+#endif
     id _exportInfo;
     id _repliesRequested;
     id _importInfo;
@@ -80,16 +89,28 @@
 // Get a proxy for the remote object (that is, the object exported from the other side of this connection). See descriptions in NSXPCProxyCreating for more details.
 @property (readonly, retain) id remoteObjectProxy;
 
+#if defined(__clang__)
 - (id)remoteObjectProxyWithErrorHandler:(void (^)(NSError *error))handler;
+#else
+- (id)remoteObjectProxyWithErrorHandler:(void *(NSError *error))handler;
+#endif
 
 // The interruption handler will be called if the remote process exits or crashes. It may be possible to re-establish the connection by simply sending another message. The handler will be invoked on the same queue as replies and other handlers, but there is no guarantee of ordering between those callbacks and this one.
 // The interruptionHandler property is cleared after the connection becomes invalid. This is to mitigate the impact of a retain cycle created by referencing the NSXPCConnection instance inside this block.
+#if defined(__clang__)
 @property (copy) void (^interruptionHandler)(void);
+#else
+@property void *interruptionHandler;
+#endif
 
 // The invalidation handler will be called if the connection can not be formed or the connection has terminated and may not be re-established. The handler will be invoked on the same queue as replies and other handlers, but there is no guarantee of ordering between those callbacks and this one.
 // You may not send messages over the connection from within an invalidation handler block.
 // The invalidationHandler property is cleared after the connection becomes invalid. This is to mitigate the impact of a retain cycle created by referencing the NSXPCConnection instance inside this block.
+#if defined(__clang__)
 @property (copy) void (^invalidationHandler)(void);
+#else
+@property void *invalidationHandler;
+#endif
 
 // All connections start suspended. You must resume them before they will start processing received messages or sending messages through the remoteObjectProxy. Note: Calling resume does not immediately launch the XPC service. The service will be started on demand when the first message is sent. However, if the name specified when creating the connection is determined to be invalid, your invalidation handler will be called immediately (and asynchronously) after calling resume.
 - (void)resume;