Fix more gflag namespace issues

This commit is contained in:
Igor Canadi
2014-05-09 08:34:18 -07:00
parent a1068c91a1
commit fec4269966
4 changed files with 58 additions and 8 deletions

View File

@@ -3,6 +3,14 @@
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
#ifndef GFLAGS
#include <cstdio>
int main() {
fprintf(stderr, "Please install gflags to run rocksdb tools\n");
return 1;
}
#else
#include <gflags/gflags.h>
#include "rocksdb/db.h"
@@ -18,6 +26,9 @@
#include "util/testharness.h"
#include "util/testutil.h"
using GFLAGS::ParseCommandLineFlags;
using GFLAGS::SetUsageMessage;
namespace rocksdb {
namespace {
@@ -232,9 +243,9 @@ DEFINE_string(time_unit, "microsecond",
"`microsecond` (default) or `nanosecond`");
int main(int argc, char** argv) {
google::SetUsageMessage(std::string("\nUSAGE:\n") + std::string(argv[0]) +
" [OPTIONS]...");
google::ParseCommandLineFlags(&argc, &argv, true);
SetUsageMessage(std::string("\nUSAGE:\n") + std::string(argv[0]) +
" [OPTIONS]...");
ParseCommandLineFlags(&argc, &argv, true);
rocksdb::TableFactory* tf = new rocksdb::BlockBasedTableFactory();
rocksdb::Options options;
@@ -269,3 +280,5 @@ int main(int argc, char** argv) {
delete tf;
return 0;
}
#endif // GFLAGS