-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[stdlib] Explicitly mark Float80 unavailable, when it is #13305
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
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 |
---|---|---|
|
@@ -1354,7 +1354,9 @@ extension ${Self} : _ExpressibleByBuiltinIntegerLiteral, ExpressibleByIntegerLit | |
} | ||
} | ||
|
||
% if bits != 80: | ||
#if !os(Windows) && (arch(i386) || arch(x86_64)) | ||
% end | ||
|
||
% builtinFloatLiteralBits = 80 | ||
extension ${Self} : _ExpressibleByBuiltinFloatLiteral { | ||
|
@@ -1373,6 +1375,7 @@ extension ${Self} : _ExpressibleByBuiltinFloatLiteral { | |
} | ||
} | ||
|
||
% if bits != 80: | ||
#else | ||
|
||
% builtinFloatLiteralBits = 64 | ||
|
@@ -1393,6 +1396,7 @@ extension ${Self} : _ExpressibleByBuiltinFloatLiteral { | |
} | ||
|
||
#endif | ||
% end | ||
|
||
extension ${Self} : Hashable { | ||
/// The number's hash value. | ||
|
@@ -1519,7 +1523,7 @@ extension ${Self} { | |
% srcBits = src_type.bits | ||
% That = src_type.stdlib_name | ||
|
||
% if srcBits == 80: | ||
% if (srcBits == 80) and (bits != 80): | ||
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. I don't think that this piece of the change does anything; what is your goal here? 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. I was just syntactically annoyed that the existing implementation has: 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. Hmmm, ok. Generally best to skip this sort of change-that-doesn't-really-change-anything, but it is a modest improvement and you've already done it, so let's take it. |
||
#if !os(Windows) && (arch(i386) || arch(x86_64)) | ||
% end | ||
|
||
|
@@ -1584,7 +1588,7 @@ extension ${Self} { | |
} | ||
} | ||
|
||
% if srcBits == 80: | ||
% if (srcBits == 80) and (bits != 80): | ||
#endif | ||
% end | ||
% end | ||
|
@@ -1721,6 +1725,20 @@ extension ${Self} { | |
} | ||
|
||
% if bits == 80: | ||
#else | ||
|
||
${SelfDocComment} | ||
@_fixed_layout | ||
@available(*, unavailable, message: "Float80 is only available on non-Windows x86 targets.") | ||
public struct ${Self} { | ||
/// Creates a value initialized to zero. | ||
@_inlineable // FIXME(sil-serialize-all) | ||
@_transparent | ||
public init() { | ||
fatalError("${Self} is not available") | ||
} | ||
} | ||
|
||
#endif | ||
% end | ||
% end # for bits in all_floating_point_types | ||
|
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.
What's the goal of adding the new check here?
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.
I was just syntactically annoyed that the existing gyb implementation outputs:
#if !os(windows) && (arch(i386) || arch(x86_64))
//code
#if !os(windows) && (arch(i386) || arch(x86_64))
//code
#endif
#endif
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.
It's difficult to see what's going on here in GitHub diff form, I'll need to look at this more carefully.