top | item 15745535

Swift code will run on Google's Fuchsia OS

5 points| aplummer | 8 years ago |theverge.com

2 comments

order
[+] wahern|8 years ago|reply
Oh, the horror!

  import SwiftPrivateLibcExtras
  #if os(OSX) || os(iOS)
  import Darwin
 -#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
 +#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Fuchsia) || os(Haiku)
  import Glibc
  #endif
(NOTE: Not the macros, but the apparent decision of early Swift developers to divide the world into two camps: OS X and Linux. Moreover, glibc is conflated with Linux. Worse, glibc is the de facto portability layer. I want to cry....)
[+] waddlesplash|8 years ago|reply
Well ... Haiku isn't exactly glibc. Our math and IO portions are indeed glibc at least in large part (although a very old version...) but there is also a large chunk (locale, wchar_t, etc.) which we have our own version of.