Skip to content

Commit fe80df6

Browse files
zoecarvercompnerd
authored andcommitted
Add UnsafePointer and UnsafeMutablePointer.
1 parent 7c35475 commit fe80df6

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

Sources/Core/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ add_library(swiftCore
2222
UInt.swift
2323
UInt8.swift
2424
UInt32.swift
25+
UnsafeMutablePointer.swift
26+
UnsafePointer.swift
2527
Void.swift)
2628
set_target_properties(swiftCore PROPERTIES
2729
Swift_MODULE_NAME Swift)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright © 2021 Zoe Carver <[email protected]>.
2+
// All Rights Reserved.
3+
// SPDX-License-Identifier: BSD-3
4+
5+
@frozen
6+
public struct UnsafeMutablePointer<Pointee> {
7+
public let _rawValue: Builtin.RawPointer
8+
9+
@_transparent
10+
public init(_ _rawValue: Builtin.RawPointer) {
11+
self._rawValue = _rawValue
12+
}
13+
}

Sources/Core/UnsafePointer.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright © 2021 Zoe Carver <[email protected]>.
2+
// All Rights Reserved.
3+
// SPDX-License-Identifier: BSD-3
4+
5+
@frozen
6+
public struct UnsafePointer<Pointee> {
7+
public let _rawValue: Builtin.RawPointer
8+
9+
@_transparent
10+
public init(_ _rawValue: Builtin.RawPointer) {
11+
self._rawValue = _rawValue
12+
}
13+
}

0 commit comments

Comments
 (0)