Browse Source

Wrap platform methods to prevent accidentally calling

onevcat 1 year ago
parent
commit
7dcfd1f744
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Sources/Image/GraphicsContext.swift

+ 3 - 0
Sources/Image/GraphicsContext.swift

@@ -24,6 +24,8 @@
 //  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 //  THE SOFTWARE.
 
+#if os(macOS) || os(watchOS)
+
 #if canImport(AppKit) && !targetEnvironment(macCatalyst)
 import AppKit
 #endif
@@ -93,3 +95,4 @@ enum GraphicsContext {
     }
 }
 
+#endif