PATCH BUNDLE: 2
Index: /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/ConditionalMacros.h
Flags: nowarn
===================================================================
--- ConditionalMacros.h
+++ ConditionalMacros.h
@@ -182,7 +182,9 @@
     /*
      Unknown compiler, perhaps set up from the command line
     */
+#if !defined(__CODEGEARC__)
    #error unknown compiler
+#endif
     #ifndef PRAGMA_IMPORT
   #define PRAGMA_IMPORT               0
   #endif
Index: /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/FSEvents.h
===================================================================
--- FSEvents.h
+++ FSEvents.h
@@ -384,9 +384,13 @@
  */
 typedef UInt64                          FSEventStreamEventId;
 
+#if defined(__CODEGEARC__)
+const unsigned __int64 kFSEventStreamEventIdSinceNow = 0xFFFFFFFFFFFFFFFFULL;
+#else
 enum {
     kFSEventStreamEventIdSinceNow = 0xFFFFFFFFFFFFFFFFULL
 };
+#endif
 
 
 /*
Index: /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/FixMath.h
===================================================================
--- FixMath.h
+++ FixMath.h
@@ -89,8 +89,9 @@
     #define _IntSaturate(x) ((int) (x))
 
 #else
-
+#if !defined(__CODEGEARC__)
     #error "Unknown architecture."
+#endif
     // To use unoptimized standard C code, remove above line.
     #define _IntSaturate(x) ((x) <= -0x1p31f ? (int) -0x80000000 : \
         0x1p31f <= (x) ? (int) 0x7fffffff : (int) (x))
Index: /usr/include/libkern/machine/OSByteOrder.h
===================================================================
--- /usr/include/libkern/machine/OSByteOrder.h
+++ /usr/include/libkern/machine/OSByteOrder.h
@@ -43,6 +43,9 @@
 
 /* Generic byte swapping functions. */
 
+#if !defined(__CODEGEARC__SWAPINT__)
+#define __CODEGEARC__SWAPINT__
+
 OS_INLINE
 uint16_t
 _OSSwapInt16(
@@ -70,6 +73,8 @@
     return OSSwapConstInt64(data);
 }
 
+#endif /* __CODEGEARC__SWAPINT__ */
+
 /* Functions for byte reversed loads. */
 
 OS_INLINE
Index: /usr/include/libkern/_OSByteOrder.h
Flags: nowarn
===================================================================
--- /usr/include/libkern/_OSByteOrder.h
+++ /usr/include/libkern/_OSByteOrder.h
@@ -94,6 +94,9 @@
 # endif
 #endif
 
+#if !defined(__CODEGEARC__SWAPINT__)
+#define __CODEGEARC__SWAPINT__
+
 __DARWIN_OS_INLINE
 uint16_t
 _OSSwapInt16(
@@ -120,6 +123,9 @@
 {
     return __DARWIN_OSSwapConstInt64(data);
 }
+
+#endif /* __CODEGEARC__SWAPINT__ */
+
 #endif
 
 #define __DARWIN_OSSwapInt16(x) _OSSwapInt16(x)
Index: /usr/include/ConditionalMacros.h
===================================================================
--- ConditionalMacros.h
+++ ConditionalMacros.h
@@ -201,7 +201,9 @@
     /*
      Unknown compiler, perhaps set up from the command line
     */
+#if !defined(__CODEGEARC__)
    #error unknown compiler
+#endif
     #ifndef PRAGMA_IMPORT
   #define PRAGMA_IMPORT               0
   #endif
Index: /usr/include/xpc/base.h
===================================================================
--- base.h
+++ base.h
@@ -87,6 +87,10 @@
 #define XPC_NOINLINE
 /*! @parseOnly */
 #define XPC_NOIMPL
+#if defined(__CODEGEARC__)
+/*! @parseOnly */
+#define XPC_DEBUGGER_EXCL
+#endif
 /*! @parseOnly */
 #define XPC_EXPORT extern
 /*! @parseOnly */
Index: /usr/include/sys/cdefs.h
Flags: nowarn
===================================================================
--- cdefs.h
+++ cdefs.h
@@ -78,8 +78,10 @@
 /* This SDK is designed to work with clang and specific versions of
  * gcc >= 4.0 with Apple's patch sets */
 #if !defined(__GNUC__) || __GNUC__ < 4
+#if !defined(__CODEGEARC__)
 #warning "Unsupported compiler detected"
 #endif
+#endif
Index: /usr/include/TargetConditionals.h
===================================================================
--- TargetConditionals.h
+++ TargetConditionals.h
@@ -220,6 +220,11 @@
  *   unknown compiler
  */
 #else
+#if defined(__CODEGEARC__)
+    #define TARGET_CPU_X86 1
+    #define TARGET_OS_MAC  1
+    #define TARGET_OS_OSX  1
+#endif
     #if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC
         #define TARGET_CPU_PPC64    0
         #define TARGET_CPU_68K      0
Index: /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h
Flags: nowarn
===================================================================
--- MachineExceptions.h
+++ MachineExceptions.h
@@ -18,7 +18,7 @@
 #endif
 
 
-#if TARGET_CPU_X86 || TARGET_CPU_X86_64
+#if (TARGET_CPU_X86 || TARGET_CPU_X86_64) && !defined(__CODEGEARC__)
 #include <emmintrin.h>
 #endif
 
@@ -206,9 +206,11 @@
 
 #if TARGET_CPU_X86 || TARGET_CPU_X86_64
 union Vector128Intel {
+#if !defined(__CODEGEARC__)
   __m128              s;
   __m128i             si;
   __m128d             sd;
+#endif
   unsigned char       c[16];
 };
 typedef union Vector128Intel            Vector128Intel;
Index: /usr/include/dispatch/object.h
Flags: nowarn atomic
===================================================================
--- object.h
+++ object.h
@@ -140,7 +140,9 @@
  * Instead, the block literal must be copied to the heap with the Block_copy()
  * function or by sending it a -[copy] message.
  */
+#if !defined(__CODEGEARC__) || defined(__BLOCKS__)
 typedef void (^dispatch_block_t)(void);
+#endif
 
 __BEGIN_DECLS
 
@@ -318,6 +320,7 @@
  * @result
  * Returns zero on success or non-zero on error (i.e. timed out).
  */
+#if !defined(__CODEGEARC__) || defined(__BLOCKS__)
 DISPATCH_UNAVAILABLE
 DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
 long
@@ -330,6 +333,7 @@
 			dispatch_semaphore_t:dispatch_semaphore_wait \
 		)((object),(timeout))
 #endif
+#endif
 
 /*!
  * @function dispatch_notify
@@ -355,6 +359,7 @@
  * @param notification_block
  * The block to submit when the observed object completes.
  */
+#if !defined(__CODEGEARC__) || defined(__BLOCKS__)
 DISPATCH_UNAVAILABLE
 DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
 void
@@ -367,6 +372,7 @@
 			dispatch_group_t:dispatch_group_notify \
 		)((object),(queue), (notification_block))
 #endif
+#endif
 
 /*!
  * @function dispatch_cancel
@@ -384,6 +390,7 @@
  * The object to cancel.
  * The result of passing NULL in this parameter is undefined.
  */
+#if !defined(__CODEGEARC__) || defined(__BLOCKS__)
 DISPATCH_UNAVAILABLE
 DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
 void
@@ -395,6 +402,7 @@
 			dispatch_source_t:dispatch_source_cancel \
 		)((object))
 #endif
+#endif
 
 /*!
  * @function dispatch_testcancel
@@ -415,6 +423,7 @@
  * @result
  * Non-zero if canceled and zero if not canceled.
  */
+#if !defined(__CODEGEARC__) || defined(__BLOCKS__)
 DISPATCH_UNAVAILABLE
 DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE
 DISPATCH_NOTHROW
@@ -427,6 +436,7 @@
 			dispatch_source_t:dispatch_source_testcancel \
 		)((object))
 #endif
+#endif
 
 /*!
  * @function dispatch_debug
Index: /System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h
===================================================================
--- FSEvents.h
+++ FSEvents.h
@@ -492,11 +492,14 @@
  */
 typedef UInt64                          FSEventStreamEventId;
 
+#if defined(__CODEGEARC__)
+const unsigned __int64 kFSEventStreamEventIdSinceNow = 0xFFFFFFFFFFFFFFFFULL;
+#else
 enum {
     kFSEventStreamEventIdSinceNow = 0xFFFFFFFFFFFFFFFFULL
 };
+#endif
 
-
 /*
  *  FSEventStreamRef
  *  
Index: /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGPath.h
===================================================================
--- CGPath.h
+++ CGPath.h
@@ -388,10 +388,12 @@
     CGPathApplierFunction cg_nullable function)
     CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_2_0);
 
+#if !defined(__CODEGEARC__)
 typedef void (^CGPathApplyBlock)(const CGPathElement * element);
 
 CG_EXTERN void CGPathApplyWithBlock(CGPathRef path, CGPathApplyBlock CF_NOESCAPE block)
     CG_AVAILABLE_STARTING(__MAC_10_13, __IPHONE_11_0);
+#endif
 
 CF_ASSUME_NONNULL_END
 
