Stop using iostream.
iostream adds a static initialize to ever object file that includes
it, is slow to compile, and the include wasn't used in all but one
file anyways.
Bug: none
Change-Id: I5ee0e325982c7b27dc7e43cd3997f8de05a432b1
Reviewed-on: https://gn-review.googlesource.com/c/gn/+/6642
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
diff --git a/src/gn/command_help.cc b/src/gn/command_help.cc
index 68b9e3f..fdbd679 100644
--- a/src/gn/command_help.cc
+++ b/src/gn/command_help.cc
@@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <algorithm>
-#include <iostream>
-
#include "base/command_line.h"
#include "gn/args.h"
#include "gn/commands.h"
diff --git a/src/gn/function_write_file.cc b/src/gn/function_write_file.cc
index 23506d3..2c568c0 100644
--- a/src/gn/function_write_file.cc
+++ b/src/gn/function_write_file.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <iostream>
#include <sstream>
#include "base/files/file_util.h"
diff --git a/src/gn/functions.cc b/src/gn/functions.cc
index 4675ee3..57f93eb 100644
--- a/src/gn/functions.cc
+++ b/src/gn/functions.cc
@@ -6,9 +6,7 @@
#include <stddef.h>
#include <cctype>
-#include <iostream>
#include <memory>
-#include <regex>
#include <utility>
#include "base/environment.h"
diff --git a/src/gn/json_project_writer.cc b/src/gn/json_project_writer.cc
index 636dc18..6509839 100644
--- a/src/gn/json_project_writer.cc
+++ b/src/gn/json_project_writer.cc
@@ -4,7 +4,6 @@
#include "gn/json_project_writer.h"
-#include <iostream>
#include <memory>
#include "base/command_line.h"
@@ -111,8 +110,8 @@
}
if (!quiet) {
- std::cout << output;
- std::cerr << stderr_output;
+ printf("%s", output.c_str());
+ fprintf(stderr, "%s", stderr_output.c_str());
}
if (exit_code != 0) {
diff --git a/src/gn/output_conversion.h b/src/gn/output_conversion.h
index 127a6ca..09ca254 100644
--- a/src/gn/output_conversion.h
+++ b/src/gn/output_conversion.h
@@ -5,7 +5,7 @@
#ifndef TOOLS_GN_OUTPUT_CONVERSION_H_
#define TOOLS_GN_OUTPUT_CONVERSION_H_
-#include <iostream>
+#include <iosfwd>
#include <string>
class Err;
diff --git a/src/gn/parser_unittest.cc b/src/gn/parser_unittest.cc
index fcb4197..8cfdb8d 100644
--- a/src/gn/parser_unittest.cc
+++ b/src/gn/parser_unittest.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <iostream>
#include <sstream>
#include "gn/input_file.h"