-
Notifications
You must be signed in to change notification settings - Fork 1.2k
WIP/Foundation: port to Windows #1812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -374,9 +374,13 @@ internal extension _EasyHandle { | |||
/// errno number from last connect failure | |||
/// - SeeAlso: https://curl.haxx.se/libcurl/c/CURLINFO_OS_ERRNO.html | |||
var connectFailureErrno: Int { | |||
#if os(Windows) && arch(x86_64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is ARM64 also LLP64? Probably a good idea to audit anywhere Windows+x86_64 is mentioned and see if it applies to ARM64 as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's a good point. Windows AArch64 is LLP64 as well, and we should account for that. I believe that I did that properly in the swift side and even the CoreFoundation side. This is still just a bunch of changes to make sure build/fill in the holes. It's going to require a second pass to actually formalise this into a patch set.
e0e512c
to
27d6f2f
Compare
27d6f2f
to
cde8f3c
Compare
Okay, so, at this point, |
What do you have in mind for adjustments to the |
5a28a40
to
78a599e
Compare
@parkera - |
Different implementations are totally fine, and even making certain API unavailable on Windows, although unfortunate, does make sense if the concept is totally unportable. What I want to make sure of is that you don't feel like you need to change the outward facing API, so that clients can remain source compatible when porting. Glancing at what you've got here so far seems like we're ok on that front. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a number of places that use some unsafe inner pointer usages for strings that need to be corrected. For the code base we like to keep it 4 space indents (not indented extra when in #ifdefs) and no line wrapping unless it is truly absurd. (The formatting is not a full blocker but would be nice).
Foundation/Data.swift
Outdated
#endif | ||
|
||
import CoreFoundation | ||
|
||
internal func __NSDataInvokeDeallocatorUnmap(_ mem: UnsafeMutableRawPointer, _ length: Int) { | ||
#if os(Windows) | ||
UnmapViewOfFile(mem) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can we make sure to keep the indentation consistent? this seems like it has an extra depth past the 4 space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch is absolutely atrocious in terms of indentation. I was playing around with Visual Studio and doing most of this in vim, so, its just an absolute disaster. This is going to require me to go through and fix that, which I don't think is worth it until I think that I have enough of this covered to break this into something more digestible. This should definitely not go in as is.
@parkera I think that most of the interfaces can be preserved, and that is something that I really would like to keep. I think that it really is important that as much of the API surface be the same as possible so that there is some possibility of portability of code. |
fee503e
to
e267ca9
Compare
7265aee
to
59f0767
Compare
030f4f8
to
618a404
Compare
c24abe5
to
b9dbf30
Compare
fa2c993
to
0292783
Compare
3ab18f9
to
e8c24da
Compare
Foundation/FileManager.swift
Outdated
@@ -82,6 +96,8 @@ open class FileManager : NSObject { | |||
} | |||
urls = mountPoints(statBuf, Int(fsCount)) | |||
} | |||
#elseif os(Windows) | |||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bleh, this seems wrong. This should be changed to throw NSUnimplemented
at the very least
e8c24da
to
b92a42e
Compare
Unformalised changes to port Foundation to Windows
b92a42e
to
6e15796
Compare
Time to say goodbye to this PR. The only thing of use left is the |
Unformalised changes to port Foundation to Windows