Windows Nightlies


(Pedro José Pereira Vieito) #41

Also, to be clear, the OSS version of Foundation is written in Swift and it is intended to be source-compatible with the Darwin Objective-C based version while not requiring the Objective-C runtime.

(Pedro José Pereira Vieito) #42

Have been trying Dispatch and it seems to work great, thanks!

I don't know if it is the same error, but when I try to import WinSDK after installing the modulemap swiftc always throws a lot of import errors referencing that some type is unknown (eg. error: "No Target Architecture" or error: unknown type name 'PSLIST_HEADER'). On the other hand, the MSVCRT module (and the underlying ucrt and visualc) works great.

(Thomas Roughton) #43

That’s the same error, although I’m a little surprised you’re not seeing it with MSVCRT; I also ran into it with importing uint64_t from stdint.h. If you manually edit the WinSDK header files to change the #pragma once guards to #ifndef/#define pairs it should work. is the (preexisting) Clang bug that seems to reference the same issue.

(Saleem Abdulrasool) #44

Great to hear that libdispatch is working great for you!

Oh, right, thats under-documented, I'm sorry. I don't know where to put such a document. You need to specify the architecture that you are targeting when you compile unfortunately (cl requires that too). Adding -Xcc -D_AMD64_ or -Xcc -D_X86_ should resolve the issue with import WinSDK.

@jrose, what do you think of adding this in the frontend based on the triple?

(Jordan Rose) #45

That definitely seems reasonable to me. Clang predefines a whole bunch of macros like that on its own, so adding these few more (on Windows only) doesn't seem harmful. I suppose there's a chance someone wants to compile for Windows without using WinSDK, and might be using these names for something else, but that seems very unlikely.

(Saleem Abdulrasool) #46

The macros are in the reserved namespace, so, if they collide I'm not too worried.