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.
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
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
visualc) works great.
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
stdint.h. If you manually edit the WinSDK header files to change the
#pragma once guards to
#define pairs it should work.
https://bugs.llvm.org/show_bug.cgi?id=39206 is the (preexisting) Clang bug that seems to reference the same issue.
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
@jrose, what do you think of adding this in the frontend based on the triple?
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.
The macros are in the reserved namespace, so, if they collide I'm not too worried.