Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Side by Side Diff: src/version.cc

Issue 959713003: Add public version macros. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/v8-version.h ('k') | tools/release/common_includes.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "include/v8-version.h"
5 #include "src/v8.h" 6 #include "src/v8.h"
6
7 #include "src/version.h" 7 #include "src/version.h"
8 8
9 // These macros define the version number for the current version.
10 // NOTE these macros are used by some of the tool scripts and the build
11 // system so their names cannot be changed without changing the scripts.
12 #define MAJOR_VERSION 4
13 #define MINOR_VERSION 3
14 #define BUILD_NUMBER 0
15 #define PATCH_LEVEL 0
16 // Use 1 for candidates and 0 otherwise.
17 // (Boolean macro values are not supported by all preprocessors.)
18 #define IS_CANDIDATE_VERSION 1
19
20 // Define SONAME to have the build system put a specific SONAME into the 9 // Define SONAME to have the build system put a specific SONAME into the
21 // shared library instead the generic SONAME generated from the V8 version 10 // shared library instead the generic SONAME generated from the V8 version
22 // number. This define is mainly used by the build system script. 11 // number. This define is mainly used by the build system script.
23 #define SONAME "" 12 #define SONAME ""
24 13
25 #if IS_CANDIDATE_VERSION 14 #if V8_IS_CANDIDATE_VERSION
26 #define CANDIDATE_STRING " (candidate)" 15 #define CANDIDATE_STRING " (candidate)"
27 #else 16 #else
28 #define CANDIDATE_STRING "" 17 #define CANDIDATE_STRING ""
29 #endif 18 #endif
30 19
31 #define SX(x) #x 20 #define SX(x) #x
32 #define S(x) SX(x) 21 #define S(x) SX(x)
33 22
34 #if PATCH_LEVEL > 0 23 #if V8_PATCH_LEVEL > 0
35 #define VERSION_STRING \ 24 #define VERSION_STRING \
36 S(MAJOR_VERSION) "." S(MINOR_VERSION) "." S(BUILD_NUMBER) "." S(PATCH_LEVEL) \ 25 S(V8_MAJOR_VERSION) "." S(V8_MINOR_VERSION) "." S(V8_BUILD_NUMBER) "." S( \
26 V8_PATCH_LEVEL) CANDIDATE_STRING
27 #else
28 #define VERSION_STRING \
29 S(V8_MAJOR_VERSION) "." S(V8_MINOR_VERSION) "." S(V8_BUILD_NUMBER) \
37 CANDIDATE_STRING 30 CANDIDATE_STRING
38 #else
39 #define VERSION_STRING \
40 S(MAJOR_VERSION) "." S(MINOR_VERSION) "." S(BUILD_NUMBER) CANDIDATE_STRING
41 #endif 31 #endif
42 32
43 namespace v8 { 33 namespace v8 {
44 namespace internal { 34 namespace internal {
45 35
46 int Version::major_ = MAJOR_VERSION; 36 int Version::major_ = V8_MAJOR_VERSION;
47 int Version::minor_ = MINOR_VERSION; 37 int Version::minor_ = V8_MINOR_VERSION;
48 int Version::build_ = BUILD_NUMBER; 38 int Version::build_ = V8_BUILD_NUMBER;
49 int Version::patch_ = PATCH_LEVEL; 39 int Version::patch_ = V8_PATCH_LEVEL;
50 bool Version::candidate_ = (IS_CANDIDATE_VERSION != 0); 40 bool Version::candidate_ = (V8_IS_CANDIDATE_VERSION != 0);
51 const char* Version::soname_ = SONAME; 41 const char* Version::soname_ = SONAME;
52 const char* Version::version_string_ = VERSION_STRING; 42 const char* Version::version_string_ = VERSION_STRING;
53 43
54 // Calculate the V8 version string. 44 // Calculate the V8 version string.
55 void Version::GetString(Vector<char> str) { 45 void Version::GetString(Vector<char> str) {
56 const char* candidate = IsCandidate() ? " (candidate)" : ""; 46 const char* candidate = IsCandidate() ? " (candidate)" : "";
57 #ifdef USE_SIMULATOR 47 #ifdef USE_SIMULATOR
58 const char* is_simulator = " SIMULATOR"; 48 const char* is_simulator = " SIMULATOR";
59 #else 49 #else
60 const char* is_simulator = ""; 50 const char* is_simulator = "";
(...skipping 22 matching lines...) Expand all
83 SNPrintF(str, "libv8-%d.%d.%d%s.so", 73 SNPrintF(str, "libv8-%d.%d.%d%s.so",
84 GetMajor(), GetMinor(), GetBuild(), candidate); 74 GetMajor(), GetMinor(), GetBuild(), candidate);
85 } 75 }
86 } else { 76 } else {
87 // Use specific SONAME. 77 // Use specific SONAME.
88 SNPrintF(str, "%s", soname_); 78 SNPrintF(str, "%s", soname_);
89 } 79 }
90 } 80 }
91 81
92 } } // namespace v8::internal 82 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8-version.h ('k') | tools/release/common_includes.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698