Moves away from @_exported import to add the import in the generated code (#8637)

This commit is contained in:
mustiikhalil
2025-07-16 21:07:08 +02:00
committed by GitHub
parent c7b9dc83f5
commit 07c2eb5fe7
25 changed files with 110 additions and 34 deletions

View File

@@ -14,6 +14,10 @@
* limitations under the License.
*/
#if canImport(Common)
import Common
#endif
import Foundation
/// `ByteBuffer` is the interface that stores the data for a `Flatbuffers` object
@@ -152,6 +156,7 @@ struct _InternalByteBuffer {
ensureSpace(size: writerIndex)
}
@inline(__always)
mutating func writeBytes(_ ptr: UnsafeRawPointer, len: Int) {
memcpy(
_storage.memory.advanced(by: writerIndex),
@@ -160,6 +165,7 @@ struct _InternalByteBuffer {
writerIndex = writerIndex &+ len
}
@inline(__always)
mutating func write<T>(_ v: T, len: Int) {
withUnsafePointer(to: v) {
memcpy(