Files
sdk/runtime/vm/version_in.cc
T
Zachary Anderson 16393ee9c6 Uses SNPRINT macro where possible. Otherwise uses #define for format.
I was able to convert 49 SNPrint(NULL, 0, ...) patterns to use the
macro. I had to use a #define for the format string 5 times due to
uses that didn't fit the macro.

2 occurences of SNPrint(NULL, 0, ...) had >=2 possibilities for the
format string based on runtime values, and I didn't try to convert
them.

Fixed ~10 format strings.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1331623002 .
2015-09-11 00:18:14 -07:00

33 lines
851 B
C++

// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "vm/version.h"
#include "vm/cpu.h"
#include "vm/os.h"
namespace dart {
// TODO(iposva): Avoid racy initialization.
static const char* formatted_version = NULL;
const char* Version::String() {
if (formatted_version == NULL) {
const char* os = OS::Name();
const char* arch = CPU::Id();
formatted_version = OS::SCreate(NULL, "%s on \"%s_%s\"", str_, os, arch);
}
return formatted_version;
}
const char* Version::SnapshotString() {
return snapshot_hash_;
}
const char* Version::snapshot_hash_ = "{{SNAPSHOT_HASH}}";
const char* Version::str_ = "{{VERSION_STR}} ({{BUILD_TIME}})";
} // namespace dart