From a6a81b8de2478023b325f0b670de224b8cad01c0 Mon Sep 17 00:00:00 2001 From: Amy While <26681721+elihwyma@users.noreply.github.com> Date: Mon, 3 Mar 2025 19:41:19 +0000 Subject: [PATCH] fix: xcode16 release compilation --- framework/Source/FillMode.swift | 1 + framework/Source/OpenGLRendering.swift | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/framework/Source/FillMode.swift b/framework/Source/FillMode.swift index 865fae75..7f45ffe4 100644 --- a/framework/Source/FillMode.swift +++ b/framework/Source/FillMode.swift @@ -14,6 +14,7 @@ import OpenGLES import COpenGL #endif +import Foundation public enum FillMode { case stretch diff --git a/framework/Source/OpenGLRendering.swift b/framework/Source/OpenGLRendering.swift index 1a935433..832c18ab 100755 --- a/framework/Source/OpenGLRendering.swift +++ b/framework/Source/OpenGLRendering.swift @@ -277,10 +277,10 @@ extension String { } func withGLChar(_ operation:(UnsafePointer) -> ()) { - if let value = self.cString(using:String.Encoding.utf8) { - operation(UnsafePointer(value)) - } else { - fatalError("Could not convert this string to UTF8: \(self)") + let cString = self.utf8CString + cString.withUnsafeBytes { ptr -> Void in + let bind = ptr.bindMemory(to: CChar.self) + operation(bind.baseAddress!) } } }