-
Notifications
You must be signed in to change notification settings - Fork 10.5k
make build with MSVC #21578
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
make build with MSVC #21578
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,11 +29,19 @@ typedef __SIZE_TYPE__ __swift_size_t; | |
#endif | ||
|
||
// This selects the signed equivalent of the unsigned type chosen for size_t. | ||
#if defined(_MSC_VER) | ||
#if defined(_M_X86) || defined(_M_ARM) | ||
typedef int ssize_t; | ||
#elif defined(_M_AMD64) || defined(_M_ARM64) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whoah... its a wild @jrose-apple! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jrose-apple - nope, because this is getting indirectly included into the compiler. It is really sad that we cannot limit this header to just the stdlib/runtime which I would really prefer. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That seems…wrong. Maybe that's the thing worth tackling: figuring out which runtime / shims headers need to go into the compiler and separating them out. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jrose-apple I agree. I had tried to remove the use of the header, but @jckarter didn't want to lose the re-use of the types defined in the headers IIRC. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's what I would recommend; the only place we need to avoid using the platform headers is when importing the header to build the standard library. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's probably the same as EDIT: Or There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I meant to use the absence of |
||
typedef __int64 ssize_t; | ||
#endif | ||
#else | ||
typedef __typeof__(_Generic((__swift_size_t)0, \ | ||
unsigned long long int : (long long int)0, \ | ||
unsigned long int : (long int)0, \ | ||
unsigned int : (int)0, \ | ||
unsigned short : (short)0, \ | ||
unsigned char : (signed char)0)) __swift_ssize_t; | ||
#endif | ||
|
||
#endif // SWIFT_STDLIB_SHIMS_SWIFT_STDDEF_H |
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.
Hmm, I suppose that this should be:
#if defined(_MSC_VER) && !defined(__clang__)
...