Skip to content

Commit fc3b5e8

Browse files
committed
stdlib: define typealias CLongDouble for FreeBSD on i386, x86_64
This fixes a failure compiling the stdlib where the importer cannot find (i.e., refuses to import) functions _stdlib_remainderl and _stdlib_squareRootl.
1 parent 4603c84 commit fc3b5e8

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

stdlib/public/core/CTypes.swift

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ public typealias CLongDouble = Double
8686
// which we don't yet have in Swift.
8787
#if arch(x86_64) || arch(i386)
8888
public typealias CLongDouble = Float80
89-
#endif
90-
// TODO: Fill in definitions for other OSes.
91-
#if arch(s390x)
89+
#elseif arch(s390x)
9290
// On s390x '-mlong-double-64' option with size of 64-bits makes the
9391
// Long Double type equivalent to Double type.
9492
public typealias CLongDouble = Double
@@ -100,7 +98,19 @@ public typealias CLongDouble = Double
10098
public typealias CLongDouble = Double
10199
#endif
102100
#elseif os(OpenBSD)
101+
#if arch(x86_64)
102+
public typealias CLongDouble = Float80
103+
#else
104+
#error("CLongDouble needs to be defined for this OpenBSD architecture")
105+
#endif
106+
#elseif os(FreeBSD)
107+
#if arch(x86_64) || arch(i386)
103108
public typealias CLongDouble = Float80
109+
#else
110+
#error("CLongDouble needs to be defined for this FreeBSD architecture")
111+
#endif
112+
#else
113+
#error("CLongDouble needs to be defined for this OS")
104114
#endif
105115

106116
// FIXME: Is it actually UTF-32 on Darwin?

0 commit comments

Comments
 (0)