-
Notifications
You must be signed in to change notification settings - Fork 10.5k
stdlib: define typealias CLongDouble for FreeBSD #61756
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 |
---|---|---|
|
@@ -86,9 +86,7 @@ public typealias CLongDouble = Double | |
// which we don't yet have in Swift. | ||
#if arch(x86_64) || arch(i386) | ||
public typealias CLongDouble = Float80 | ||
#endif | ||
// TODO: Fill in definitions for other OSes. | ||
#if arch(s390x) | ||
#elseif arch(s390x) | ||
// On s390x '-mlong-double-64' option with size of 64-bits makes the | ||
// Long Double type equivalent to Double type. | ||
public typealias CLongDouble = Double | ||
|
@@ -100,7 +98,19 @@ public typealias CLongDouble = Double | |
public typealias CLongDouble = Double | ||
#endif | ||
#elseif os(OpenBSD) | ||
#if arch(x86_64) | ||
public typealias CLongDouble = Float80 | ||
#else | ||
#error("CLongDouble needs to be defined for this OpenBSD architecture") | ||
#endif | ||
#elseif os(FreeBSD) | ||
#if arch(x86_64) || arch(i386) | ||
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. My preference would be to swap the architectures here, but that is low priority. 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. Happy to—I was just matching the Darwin and Linux branches. |
||
public typealias CLongDouble = Float80 | ||
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. This seems wrong. FP80 is X86 only according to https://www.freebsd.org/cgi/man.cgi?query=arch&sektion=7&format=html. This should be similar to what we have for Darwin. 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. Good point, thanks! I think that's also true for OpenBSD:
I've added an x86_64 || i386 conditional to the FreeBSD branch. @compnerd & @3405691582, would you like me to do the same for OpenBSD, or would you prefer I leave it alone (or just add a comment)? 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. A separate PR for fixing O/BSD would be appreciated! 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. Currently it is an error to attempt to build Swift on anything but amd64-openbsd so it's not strictly necessary to fix for this platform right now. It might be worthwhile doing, but it might be misleading if you see the conditional and yet get a cmake error trying to bring up the platform on the architecture though. |
||
#else | ||
#error("CLongDouble needs to be defined for this FreeBSD architecture") | ||
compnerd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#endif | ||
#else | ||
// TODO: define CLongDouble for other OSes | ||
#endif | ||
|
||
// FIXME: Is it actually UTF-32 on Darwin? | ||
|
Uh oh!
There was an error while loading. Please reload this page.