From 7c76ac1735a3b8f4523856bbd67588b6ccc7f850 Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Tue, 25 Apr 2017 17:01:28 -0700 Subject: Remove "using namespace std" from stubs/common.h This prevents the contents of the std namespace from being effectively pulled into the top-level namespace in all translation units that include common.h. I left in individual using statements for a few common things like std::set and std::map, because it did not seem worth going through the churn of updating the whole codebase to fix those right now. --- src/google/protobuf/compiler/command_line_interface.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/google/protobuf/compiler/command_line_interface.cc') diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc index f516477b..c2990779 100644 --- a/src/google/protobuf/compiler/command_line_interface.cc +++ b/src/google/protobuf/compiler/command_line_interface.cc @@ -804,8 +804,8 @@ int CommandLineInterface::Run(int argc, const char* const argv[]) { // Enforce --disallow_services. if (disallow_services_ && parsed_file->service_count() > 0) { - cerr << parsed_file->name() << ": This file contains services, but " - "--disallow_services was used." << endl; + std::cerr << parsed_file->name() << ": This file contains services, but " + "--disallow_services was used." << std::endl; return 1; } @@ -816,7 +816,7 @@ int CommandLineInterface::Run(int argc, const char* const argv[]) { if (direct_dependencies_.find(parsed_file->dependency(i)->name()) == direct_dependencies_.end()) { indirect_imports = true; - cerr << parsed_file->name() << ": " + std::cerr << parsed_file->name() << ": " << StringReplace(direct_dependencies_violation_msg_, "%s", parsed_file->dependency(i)->name(), true /* replace_all */) @@ -1221,7 +1221,7 @@ CommandLineInterface::InterpretArgument(const string& name, if (access(disk_path.c_str(), F_OK) < 0) { // Try the original path; it may have just happed to have a '=' in it. if (access(parts[i].c_str(), F_OK) < 0) { - cerr << disk_path << ": warning: directory does not exist." << endl; + std::cerr << disk_path << ": warning: directory does not exist." << std::endl; } else { virtual_path = ""; disk_path = parts[i]; @@ -1302,9 +1302,9 @@ CommandLineInterface::InterpretArgument(const string& name, if (!version_info_.empty()) { std::cout << version_info_ << std::endl; } - cout << "libprotoc " + std::cout << "libprotoc " << protobuf::internal::VersionString(GOOGLE_PROTOBUF_VERSION) - << endl; + << std::endl; return PARSE_ARGUMENT_DONE_AND_EXIT; // Exit without running compiler. } else if (name == "--disallow_services") { -- cgit v1.2.3