33#include < memory>
44
55#include " rocksdb/version.h"
6+ #include " rocksdb/utilities/object_registry.h"
67#include " util/string_util.h"
78
89// The build script may replace these values with real values based
910// on whether or not GIT is available and the platform settings
10- static const std::string rocksdb_build_git_sha = " rocksdb_build_git_sha:00724f43bcea4d82b371a3e43ebec91cfe8c11be" ;
11- static const std::string rocksdb_build_git_tag = " rocksdb_build_git_tag:7.1.2" ;
12- static const std::string rocksdb_build_date = " rocksdb_build_date:2022-04-21 06:19:00" ;
11+ static const std::string rocksdb_build_git_sha = " rocksdb_build_git_sha:8e0f495253f62904a4ca6d3ec6a03391a12b0a45" ;
12+ static const std::string rocksdb_build_git_tag = " rocksdb_build_git_tag:v7.3.1" ;
13+ #define HAS_GIT_CHANGES 0
14+ #if HAS_GIT_CHANGES == 0
15+ // If HAS_GIT_CHANGES is 0, the GIT date is used.
16+ // Use the time the branch/tag was last modified
17+ static const std::string rocksdb_build_date = " rocksdb_build_date:2022-06-08 12:46:15" ;
18+ #else
19+ // If HAS_GIT_CHANGES is > 0, the branch/tag has modifications.
20+ // Use the time the build was created.
21+ static const std::string rocksdb_build_date = " rocksdb_build_date:2022-06-21 21:46:08" ;
22+ #endif
23+
24+ #ifndef ROCKSDB_LITE
25+ extern " C" {
26+
27+ } // extern "C"
28+
29+ std::unordered_map<std::string, ROCKSDB_NAMESPACE::RegistrarFunc> ROCKSDB_NAMESPACE::ObjectRegistry::builtins_ = {
30+
31+ };
32+ #endif // ROCKSDB_LITE
1333
1434namespace ROCKSDB_NAMESPACE {
1535static void AddProperty (std::unordered_map<std::string, std::string> *props, const std::string& name) {
@@ -23,7 +43,7 @@ static void AddProperty(std::unordered_map<std::string, std::string> *props, con
2343 }
2444 }
2545}
26-
46+
2747static std::unordered_map<std::string, std::string>* LoadPropertiesSet () {
2848 auto * properties = new std::unordered_map<std::string, std::string>();
2949 AddProperty (properties, rocksdb_build_git_sha);
@@ -38,14 +58,14 @@ const std::unordered_map<std::string, std::string>& GetRocksBuildProperties() {
3858}
3959
4060std::string GetRocksVersionAsString (bool with_patch) {
41- std::string version = ToString (ROCKSDB_MAJOR) + " ." + ToString (ROCKSDB_MINOR);
61+ std::string version = std::to_string (ROCKSDB_MAJOR) + " ." + std::to_string (ROCKSDB_MINOR);
4262 if (with_patch) {
43- return version + " ." + ToString (ROCKSDB_PATCH);
63+ return version + " ." + std::to_string (ROCKSDB_PATCH);
4464 } else {
4565 return version;
46- }
66+ }
4767}
48-
68+
4969std::string GetRocksBuildInfoAsString (const std::string& program, bool verbose) {
5070 std::string info = program + " (RocksDB) " + GetRocksVersionAsString (true );
5171 if (verbose) {
@@ -59,4 +79,3 @@ std::string GetRocksBuildInfoAsString(const std::string& program, bool verbose)
5979 return info;
6080}
6181} // namespace ROCKSDB_NAMESPACE
62-
0 commit comments