Improve importer.cc imports on windows

This fixes that we accidentally imported absl ascii.h within the protobuf namespace, and avoids unused imports warnings for imports that are only used on windows.

PiperOrigin-RevId: 709846366
pull/19797/head
Protobuf Team Bot 2 months ago committed by Copybara-Service
parent b9ef9055ef
commit 17464cb7b6
  1. 18
      src/google/protobuf/compiler/importer.cc

@ -11,6 +11,8 @@
#include "google/protobuf/compiler/importer.h"
#include <string>
#ifdef _MSC_VER
#include <direct.h>
#else
@ -21,21 +23,27 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <algorithm>
#include <memory>
#include <vector>
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_join.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/str_split.h"
#include "absl/strings/string_view.h"
#include "google/protobuf/compiler/parser.h"
#include "google/protobuf/io/io_win32.h"
#include "google/protobuf/io/tokenizer.h"
#include "google/protobuf/io/zero_copy_stream_impl.h"
#ifdef _WIN32
#include "absl/strings/str_replace.h"
#include "google/protobuf/io/io_win32.h"
#endif
#if defined(_WIN32) || defined(__CYGWIN__)
#include "absl/strings/ascii.h"
#endif
namespace google {
namespace protobuf {
namespace compiler {
@ -47,10 +55,6 @@ using google::protobuf::io::win32::access;
using google::protobuf::io::win32::open;
#endif
#if defined(_WIN32) || defined(__CYGWIN__)
#include "absl/strings/ascii.h"
#endif
// Returns true if the text looks like a Windows-style absolute path, starting
// with a drive letter. Example: "C:\foo". TODO: Share this with
// copy in command_line_interface.cc?

Loading…
Cancel
Save