Просмотр исходного кода

Wrap platform methods to prevent accidentally calling

onevcat 1 год назад
Родитель
Сommit
7dcfd1f744
1 измененных файлов с 3 добавлено и 0 удалено
  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