| 1 | // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 | // for details. All rights reserved. Use of this source code is governed by a |
| 3 | // BSD-style license that can be found in the LICENSE file. |
| 4 | |
| 5 | #include "vm/version.h" |
| 6 | |
| 7 | #include "vm/cpu.h" |
| 8 | #include "vm/os.h" |
| 9 | |
| 10 | namespace dart { |
| 11 | |
| 12 | // TODO(iposva): Avoid racy initialization. |
| 13 | static const char* formatted_version = NULL; |
| 14 | |
| 15 | const char* Version::String() { |
| 16 | if (formatted_version == NULL) { |
| 17 | const char* os = OS::Name(); |
| 18 | const char* arch = CPU::Id(); |
| 19 | formatted_version = OS::SCreate(NULL, "%s on \"%s_%s\"" , str_, os, arch); |
| 20 | } |
| 21 | return formatted_version; |
| 22 | } |
| 23 | |
| 24 | const char* Version::SnapshotString() { |
| 25 | return snapshot_hash_; |
| 26 | } |
| 27 | |
| 28 | const char* Version::CommitString() { |
| 29 | return commit_; |
| 30 | } |
| 31 | |
| 32 | const char* Version::SdkHash() { |
| 33 | return git_short_hash_; |
| 34 | } |
| 35 | |
| 36 | const char* Version::snapshot_hash_ = "af33cdc679c2614004885065e697545a" ; |
| 37 | const char* Version::str_ = "2.10.0-23.0.dev (dev) (Thu Aug 13 07:28:19 2020 -0700)" ; |
| 38 | const char* Version::commit_ = "2.10.0-23.0.dev" ; |
| 39 | const char* Version::git_short_hash_ = "6d15e04622" ; |
| 40 | |
| 41 | } // namespace dart |
| 42 | |