src/Pure/System/platform.scala
changeset 69726 461f0615faa3
parent 69410 c071fcec4323
child 71383 8313dca6dee9
--- a/src/Pure/System/platform.scala	Wed Jan 23 20:27:00 2019 +0100
+++ b/src/Pure/System/platform.scala	Wed Jan 23 20:45:03 2019 +0100
@@ -36,30 +36,23 @@
 
   /* platform identifiers */
 
-  private val Linux = """Linux""".r
-  private val Darwin = """Mac OS X""".r
-  private val Windows = """Windows.*""".r
-
   private val X86 = """i.86|x86""".r
   private val X86_64 = """amd64|x86_64""".r
 
-  lazy val jvm_platform: String =
-  {
-    val arch =
-      System.getProperty("os.arch", "") match {
-        case X86() => "x86"
-        case X86_64() => "x86_64"
-        case _ => error("Failed to determine CPU architecture")
-      }
-    val os =
-      System.getProperty("os.name", "") match {
-        case Linux() => "linux"
-        case Darwin() => "darwin"
-        case Windows() => "windows"
-        case _ => error("Failed to determine operating system platform")
-      }
-    arch + "-" + os
-  }
+  def cpu_arch: String =
+    System.getProperty("os.arch", "") match {
+      case X86() => "x86"
+      case X86_64() => "x86_64"
+      case _ => error("Failed to determine CPU architecture")
+    }
+
+  def os_name: String =
+    family match {
+      case Family.macos => "darwin"
+      case _ => family.toString
+    }
+
+  lazy val jvm_platform: String = cpu_arch + "-" + os_name
 
 
   /* JVM version */