v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
version.h
Go to the documentation of this file.
1// Copyright 2009 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_UTILS_VERSION_H_
6#define V8_UTILS_VERSION_H_
7
8#include <cstdint>
9
10#include "src/base/hashing.h"
11
12namespace v8 {
13
14namespace base {
15template <typename T>
16class Vector;
17} // namespace base
18
19namespace internal {
20
22 public:
23 // Return the various version components.
24 static int GetMajor() { return major_; }
25 static int GetMinor() { return minor_; }
26 static int GetBuild() { return build_; }
27 static int GetPatch() { return patch_; }
28 static const char* GetEmbedder() { return embedder_; }
29 static bool IsCandidate() { return candidate_; }
30 static uint32_t Hash() {
31 return static_cast<uint32_t>(
32 base::hash_combine(major_, minor_, build_, patch_));
33 }
34
35 // Calculate the V8 version string.
36 static void GetString(base::Vector<char> str);
37
38 // Calculate the SONAME for the V8 shared library.
39 static void GetSONAME(base::Vector<char> str);
40
41 static const char* GetVersion() { return version_string_; }
42
43 private:
44 // NOTE: can't make these really const because of test-version.cc.
45 static int major_;
46 static int minor_;
47 static int build_;
48 static int patch_;
49 static const char* embedder_;
50 static bool candidate_;
51 static const char* soname_;
52 static const char* version_string_;
53
54 // In test-version.cc.
55 friend void SetVersion(int major, int minor, int build, int patch,
56 const char* embedder, bool candidate,
57 const char* soname);
58};
59
60} // namespace internal
61} // namespace v8
62
63#endif // V8_UTILS_VERSION_H_
static int build_
Definition version.h:47
static const char * GetEmbedder()
Definition version.h:28
static int GetMajor()
Definition version.h:24
static int GetBuild()
Definition version.h:26
static int GetPatch()
Definition version.h:27
static int GetMinor()
Definition version.h:25
static bool candidate_
Definition version.h:50
friend void SetVersion(int major, int minor, int build, int patch, const char *embedder, bool candidate, const char *soname)
static const char * version_string_
Definition version.h:52
static const char * soname_
Definition version.h:51
static const char * embedder_
Definition version.h:49
static int minor_
Definition version.h:46
static int patch_
Definition version.h:48
static uint32_t Hash()
Definition version.h:30
static bool IsCandidate()
Definition version.h:29
static int major_
Definition version.h:45
static const char * GetVersion()
Definition version.h:41
#define V8_EXPORT
Definition v8config.h:800