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 { |