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

Unified Diff: include/v8.h

Issue 23723003: Move version macros to public V8 header. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 | « no previous file | include/v8config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index c94e5105e0e5cffbc70d7a2012543dba77ee9e2f..fe715b0fecd611f1740e842ea61e030fd70383ba 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -79,6 +79,81 @@
#endif // V8_OS_WIN
/**
+ * The major version number of the V8 library.
+ */
+#define V8_MAJOR_VERSION 3
+
+/**
+ * The minor version number of the V8 library.
+ */
+#define V8_MINOR_VERSION 21
+
+/**
+ * The build number of the V8 library.
+ */
+#define V8_BUILD_NUMBER 8
+
+/**
+ * The patch level of the V8 library.
+ */
+#define V8_PATCH_LEVEL 0
+
+/**
+ * This is non-zero if the V8 library is a candidate version or zero for
+ * release versions.
+ */
+#define V8_CANDIDATE_VERSION 1
+
+/**
+ * \def V8_VERSION_STRING
+ * The version string of the V8 library.
+ */
+#if V8_CANDIDATE_VERSION && V8_PATCH_LEVEL
+# define V8_VERSION_STRING \
+ V8_STRINGIFY(V8_MAJOR_VERSION) "." \
+ V8_STRINGIFY(V8_MINOR_VERSION) "." \
+ V8_STRINGIFY(V8_BUILD_NUMBER) "." \
+ V8_STRINGIFY(V8_PATCH_LEVEL) " (candidate)"
+#elif V8_PATCH_LEVEL
+# define V8_VERSION_STRING \
+ V8_STRINGIFY(V8_MAJOR_VERSION) "." \
+ V8_STRINGIFY(V8_MINOR_VERSION) "." \
+ V8_STRINGIFY(V8_BUILD_NUMBER) "." \
+ V8_STRINGIFY(V8_PATCH_LEVEL)
+#elif V8_CANDIDATE_VERSION
+# define V8_VERSION_STRING \
+ V8_STRINGIFY(V8_MAJOR_VERSION) "." \
+ V8_STRINGIFY(V8_MINOR_VERSION) "." \
+ V8_STRINGIFY(V8_BUILD_NUMBER) " (candidate)"
+#else
+# define V8_VERSION_STRING \
+ V8_STRINGIFY(V8_MAJOR_VERSION) "." \
+ V8_STRINGIFY(V8_MINOR_VERSION) "." \
+ V8_STRINGIFY(V8_BUILD_NUMBER)
+#endif
+
+/**
+ * Checks the version of the V8 library that is being compiled against.
+ *
+ * Sample usage:
+ * \code
+ * #if V8_CHECK_VERSION(3, 21, 8, 0)
+ * // Code that requires V8 3.21.8.0 or later.
+ * ...
+ * #endif
+ * \endcode
+ */
+#define V8_CHECK_VERSION(major, minor, build, patch) \
+ ((V8_MAJOR_VERSION * 1000000 + \
+ V8_MINOR_VERSION * 10000 + \
+ V8_BUILD_NUMBER * 100 + \
+ V8_PATCH_LEVEL) >= \
+ ((major) * 1000000 + \
+ (minor) * 10000 + \
+ (build) * 100 + \
+ (patch)))
+
+/**
* The v8 JavaScript engine.
*/
namespace v8 {
« no previous file with comments | « no previous file | include/v8config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698