Clean up #includes in SkCFObject.

SKCFObject.h wasn't compiling without prefixing it with other includes,
so adding them into the actual file itself. Also changed to use the
more generic __APPLE__ as a guard rather than BUILD_FOR_MAC or
BUILD_FOR_IOS defines, and added the file to BUILD.gn so it will be
added to Xcode projects.

Change-Id: I67a48d0156ef1eb5c69dd045f0acadf147053eb6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/455163
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index cd64d11..eb78d8b 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1358,6 +1358,7 @@
 
   if (is_mac) {
     sources += [
+      "include/ports/SkCFObject.h",
       "src/ports/SkDebug_stdio.cpp",
       "src/ports/SkImageEncoder_CG.cpp",
       "src/ports/SkImageGeneratorCG.cpp",
@@ -1370,6 +1371,7 @@
 
   if (is_ios) {
     sources += [
+      "include/ports/SkCFObject.h",
       "src/ports/SkDebug_stdio.cpp",
       "src/ports/SkImageEncoder_CG.cpp",
       "src/ports/SkImageGeneratorCG.cpp",
diff --git a/include/ports/SkCFObject.h b/include/ports/SkCFObject.h
index ecc961a..4dc7086 100644
--- a/include/ports/SkCFObject.h
+++ b/include/ports/SkCFObject.h
@@ -8,7 +8,11 @@
 #ifndef SkCFObject_DEFINED
 #define SkCFObject_DEFINED
 
-#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
+#ifdef __APPLE__
+
+#include "include/core/SkTypes.h"
+
+#include <cstddef>      // std::nullptr_t
 
 #import <CoreFoundation/CoreFoundation.h>
 
@@ -176,5 +180,5 @@
 // TODO: migrate them away from this and remove
 template <typename T> using sk_cf_obj = sk_cfp<T>;
 
-#endif  // SK_BUILD_FOR_MAC || SK_BUILD_FOR_IOS
+#endif  // __APPLE__
 #endif  // SkCFObject_DEFINED