File tree Expand file tree Collapse file tree 4 files changed +73
-9
lines changed
Expand file tree Collapse file tree 4 files changed +73
-9
lines changed Original file line number Diff line number Diff line change @@ -70,18 +70,18 @@ public typealias CFloat = Float
7070public typealias CInt = Int32
7171public typealias CLong = Int
7272public typealias CLongLong = Int64
73- #if COCOA || ISLAND
74- //UnsafeMutablePointer
75- //UnsafePointer
73+
74+ #if !JAVA
75+ // UnsafeMutablePointer and UnsafePointer are defined by the compiler
7676public typealias UnsafeMutableBufferPointer < T> = UnsafeMutablePointer < T >
7777public typealias UnsafeBufferPointer < T> = UnsafePointer < T >
78- public typealias UnsafeMutableRawPointer < T> = UnsafeMutablePointer < T >
79- public typealias UnsafeRawPointer < T> = UnsafePointer < T >
80- public typealias UnsafeMutableRawBufferPointer < T> = UnsafeMutablePointer < T >
81- public typealias UnsafeRawBufferPointer < T> = UnsafePointer < T >
82-
78+ public typealias UnsafeMutableRawPointer = UnsafeMutablePointer < Void >
79+ public typealias UnsafeRawPointer = UnsafePointer < Void >
80+ public typealias UnsafeMutableRawBufferPointer = UnsafeMutablePointer < Void >
81+ public typealias UnsafeRawBufferPointer = UnsafePointer < Void >
8382public typealias OpaquePointer = UnsafePointer < Void >
8483#endif
84+
8585public typealias CShort = Int16
8686public typealias CSignedChar = Int8
8787public typealias CUnsignedChar = UInt8
Original file line number Diff line number Diff line change 1+ //public struct MemoryLayout<T> {
2+
3+ //var size: Byte { sizeOf<T> }
4+ //var alignment: Byte { sizeOf<T> }
5+ //var stride: Byte { sizeOf<T> }
6+
7+ //}
Original file line number Diff line number Diff line change 1+ #if !JAVA
2+ public extension OpaquePointer {
3+
4+ //init<T>(_ pointer: UnsafePointer<T>) {
5+
6+ //}
7+ //init<T>(_ pointer: UnsafeMutablePointer<T>) {
8+
9+ //}
10+ //init?<T>(_ pointer: UnsafePointer<T>?) {
11+
12+ //}
13+ //init?<T>(_ pointer: UnsafeMutablePointer<T>?) {
14+
15+ //}
16+ init ( _ pointer: UnsafeRawPointer ? ) {
17+ return pointer
18+ }
19+ init ? ( bitPattern: Int ) {
20+ return bitPattern as! OpaquePointer
21+ }
22+ init ? ( bitPattern: UInt ) {
23+ return bitPattern as! OpaquePointer
24+ }
25+
26+ //@ToString // E201 Attributes of type "ToStringAspect!" are not allowed on this member
27+ var description : String {
28+ return " 0x " + ( self as! UInt ) . toHexString ( )
29+ }
30+
31+ var debugDescription : String {
32+ return " 0x " + ( self as! UInt ) . toHexString ( )
33+ }
34+
35+ //func hash(into: inout Hasher) {
36+
37+ //}
38+ //static func != (_ rhs: OpaquePointer, _lhs: OpaquePointer) -> Bool {
39+ // handled by compiler
40+ //}
41+ //static func == (OpaquePointer, OpaquePointer) -> Bool {
42+ // handled by compiler
43+ //}
44+ }
45+
46+ #endif
Original file line number Diff line number Diff line change 9494 <Compile Include =" $(MSBuildThisFileDirectory)Dictionary.Java.swift" />
9595 <Compile Include =" $(MSBuildThisFileDirectory)Operators.swift" />
9696 <Compile Include =" $(MSBuildThisFileDirectory)Errors.swift" />
97- <Compile Include =" $(MSBuildThisFileDirectory)Unmanaged.swift" />
97+ <Compile Include =" $(MSBuildThisFileDirectory)Unmanaged.swift" >
98+ <VirtualFolder >Memory</VirtualFolder >
99+ </Compile >
100+ <Compile Include =" $(MSBuildThisFileDirectory)MemoryLayout.swift" >
101+ <VirtualFolder >Memory</VirtualFolder >
102+ </Compile >
103+ <Compile Include =" $(MSBuildThisFileDirectory)Pointers.swift" >
104+ <VirtualFolder >Memory</VirtualFolder >
105+ </Compile >
98106 </ItemGroup >
99107 <ItemGroup >
100108 <Folder Include =" Sequences" >
112120 <Folder Include =" Cocoa" >
113121 <Virtual >True</Virtual >
114122 </Folder >
123+ <Folder Include =" Memory" >
124+ <Virtual >True</Virtual >
125+ </Folder >
115126 </ItemGroup >
116127</Project >
You can’t perform that action at this time.
0 commit comments