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

Unified Diff: src/version.cc

Issue 865153003: Make version generation robust to other user-defined tags. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/generate_version.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/version.cc
diff --git a/src/version.cc b/src/version.cc
index d7c937c7aac7e18835fbbcde311ca6889e4b2b9d..300f1731fd8ef3cd4e147762cc465d4ee5498464 100644
--- a/src/version.cc
+++ b/src/version.cc
@@ -17,15 +17,22 @@
// (Boolean macro values are not supported by all preprocessors.)
#define IS_CANDIDATE_VERSION 1
+// Used to mark a version built from a bad tag.
+#define IS_INVALID_VERSION 0
+
// Define SONAME to have the build system put a specific SONAME into the
// shared library instead the generic SONAME generated from the V8 version
// number. This define is mainly used by the build system script.
#define SONAME ""
+#if IS_INVALID_VERSION
+#define SUFFIX_STRING " (invalid)"
+#else
#if IS_CANDIDATE_VERSION
-#define CANDIDATE_STRING " (candidate)"
+#define SUFFIX_STRING " (candidate)"
#else
-#define CANDIDATE_STRING ""
+#define SUFFIX_STRING ""
+#endif
#endif
#define SX(x) #x
@@ -33,12 +40,11 @@
#if PATCH_LEVEL > 0
#define VERSION_STRING \
- S(MAJOR_VERSION) "." S(MINOR_VERSION) "." S(BUILD_NUMBER) "." \
- S(PATCH_LEVEL) CANDIDATE_STRING
+ S(MAJOR_VERSION) "." S(MINOR_VERSION) "." S(BUILD_NUMBER) "." S(PATCH_LEVEL) \
+ SUFFIX_STRING
#else
-#define VERSION_STRING \
- S(MAJOR_VERSION) "." S(MINOR_VERSION) "." S(BUILD_NUMBER) \
- CANDIDATE_STRING
+#define VERSION_STRING \
+ S(MAJOR_VERSION) "." S(MINOR_VERSION) "." S(BUILD_NUMBER) SUFFIX_STRING
#endif
namespace v8 {
« no previous file with comments | « build/generate_version.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698