From 9225b16d1285e620c7c13e3416bdd4099f8ff4b7 Mon Sep 17 00:00:00 2001 From: David Adam Date: Wed, 18 May 2016 22:30:21 +0000 Subject: add (or restore) config.h to all files The autoconf-generated config.h contains a number of directives which may alter the behaviour of system headers on certain platforms. Always include it in every C++ file as the first include. Closes #2993. --- src/autoload.cpp | 2 ++ src/builtin.cpp | 1 + src/builtin_commandline.cpp | 2 ++ src/builtin_complete.cpp | 2 ++ src/builtin_printf.cpp | 1 + src/builtin_set.cpp | 2 ++ src/builtin_test.cpp | 2 ++ src/builtin_ulimit.cpp | 2 ++ src/color.cpp | 2 ++ src/complete.cpp | 2 ++ src/env.cpp | 2 ++ src/event.cpp | 2 ++ src/fish_indent.cpp | 2 ++ src/fish_key_reader.cpp | 2 ++ src/fish_tests.cpp | 1 + src/function.cpp | 2 ++ src/highlight.cpp | 2 ++ src/history.cpp | 2 ++ src/intern.cpp | 2 ++ src/io.cpp | 2 ++ src/iothread.cpp | 2 ++ src/kill.cpp | 2 ++ src/pager.cpp | 2 ++ src/parse_execution.cpp | 2 ++ src/parse_productions.cpp | 2 ++ src/parse_tree.cpp | 2 ++ src/parse_util.cpp | 2 ++ src/parser.cpp | 2 ++ src/parser_keywords.cpp | 2 ++ src/path.cpp | 2 ++ src/postfork.cpp | 2 ++ src/print_help.cpp | 2 ++ src/sanity.cpp | 2 ++ src/signal.cpp | 2 ++ src/tokenizer.cpp | 2 ++ src/utf8.cpp | 2 ++ src/util.cpp | 2 ++ src/wcstringutil.cpp | 2 ++ src/wildcard.cpp | 2 ++ 39 files changed, 75 insertions(+) diff --git a/src/autoload.cpp b/src/autoload.cpp index 31f6e6df..2d404cf9 100644 --- a/src/autoload.cpp +++ b/src/autoload.cpp @@ -1,4 +1,6 @@ // The classes responsible for autoloading functions and completions. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/builtin.cpp b/src/builtin.cpp index a79f898d..336f09eb 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -15,6 +15,7 @@ // Check the other builtin manuals for proper syntax. // // 4). Use 'git add doc_src/NAME.txt' to start tracking changes to the documentation file. +#include "config.h" // IWYU pragma: keep #include #include diff --git a/src/builtin_commandline.cpp b/src/builtin_commandline.cpp index c7b82d7a..c25e6041 100644 --- a/src/builtin_commandline.cpp +++ b/src/builtin_commandline.cpp @@ -1,4 +1,6 @@ // Functions used for implementing the commandline builtin. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/builtin_complete.cpp b/src/builtin_complete.cpp index 90fc4714..f4e3b36f 100644 --- a/src/builtin_complete.cpp +++ b/src/builtin_complete.cpp @@ -1,4 +1,6 @@ // Functions used for implementing the complete builtin. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/builtin_printf.cpp b/src/builtin_printf.cpp index a755d27a..36b8e638 100644 --- a/src/builtin_printf.cpp +++ b/src/builtin_printf.cpp @@ -48,6 +48,7 @@ // David MacKenzie // This file has been imported from source code of printf command in GNU Coreutils version 6.9. +#include "config.h" // IWYU pragma: keep #include #include diff --git a/src/builtin_set.cpp b/src/builtin_set.cpp index f4f49baf..2333e0c0 100644 --- a/src/builtin_set.cpp +++ b/src/builtin_set.cpp @@ -1,4 +1,6 @@ // Functions used for implementing the set builtin. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/builtin_test.cpp b/src/builtin_test.cpp index c179952e..da63270d 100644 --- a/src/builtin_test.cpp +++ b/src/builtin_test.cpp @@ -1,6 +1,8 @@ // Functions used for implementing the test builtin. // // Implemented from scratch (yes, really) by way of IEEE 1003.1 as reference. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/builtin_ulimit.cpp b/src/builtin_ulimit.cpp index f873c385..6399cbdf 100644 --- a/src/builtin_ulimit.cpp +++ b/src/builtin_ulimit.cpp @@ -1,4 +1,6 @@ // Functions used for implementing the ulimit builtin. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/color.cpp b/src/color.cpp index 7648449d..41f41acf 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -1,4 +1,6 @@ // Color class implementation. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/complete.cpp b/src/complete.cpp index ef713bb8..8c38b266 100644 --- a/src/complete.cpp +++ b/src/complete.cpp @@ -3,6 +3,8 @@ These functions are used for storing and retrieving tab-completion data, as well as for performing tab-completion. */ +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/env.cpp b/src/env.cpp index 12eef036..433b45f9 100644 --- a/src/env.cpp +++ b/src/env.cpp @@ -1,4 +1,6 @@ // Functions for setting and getting environment variables. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/event.cpp b/src/event.cpp index 3f5d05b9..3da57dfa 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -1,4 +1,6 @@ // Functions for handling event triggers. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/fish_indent.cpp b/src/fish_indent.cpp index 53443799..7e68e310 100644 --- a/src/fish_indent.cpp +++ b/src/fish_indent.cpp @@ -15,6 +15,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/fish_key_reader.cpp b/src/fish_key_reader.cpp index ef587d3c..7908bfef 100644 --- a/src/fish_key_reader.cpp +++ b/src/fish_key_reader.cpp @@ -6,6 +6,8 @@ // carriage-return (\cM) and newline (\cJ). // // Type "exit" or "quit" to terminate the program. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp index 8c1866b1..7f1c0a7d 100644 --- a/src/fish_tests.cpp +++ b/src/fish_tests.cpp @@ -1,4 +1,5 @@ // Various bug and feature tests. Compiled and run by make test. +#include "config.h" // IWYU pragma: keep // IWYU pragma: no_include // IWYU pragma: no_include diff --git a/src/function.cpp b/src/function.cpp index 54559bee..fc397472 100644 --- a/src/function.cpp +++ b/src/function.cpp @@ -2,6 +2,8 @@ // autoloading functions in the $fish_function_path. Actual function evaluation is taken care of by // the parser and to some degree the builtin handling library. // +#include "config.h" // IWYU pragma: keep + // IWYU pragma: no_include #include #include diff --git a/src/highlight.cpp b/src/highlight.cpp index f34505cf..9dd6b224 100644 --- a/src/highlight.cpp +++ b/src/highlight.cpp @@ -1,4 +1,6 @@ // Functions for syntax highlighting. +#include "config.h" // IWYU pragma: keep + // IWYU pragma: no_include #include #include diff --git a/src/history.cpp b/src/history.cpp index c4fb1f30..ca61ed3c 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -1,4 +1,6 @@ // History functions, part of the user interface. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/intern.cpp b/src/intern.cpp index 6171bc38..d92b142a 100644 --- a/src/intern.cpp +++ b/src/intern.cpp @@ -1,4 +1,6 @@ // Library for pooling common strings. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/io.cpp b/src/io.cpp index 72bae3db..b274897f 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -1,4 +1,6 @@ // Utilities for io redirection. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/iothread.cpp b/src/iothread.cpp index 96a926a2..2780cda5 100644 --- a/src/iothread.cpp +++ b/src/iothread.cpp @@ -1,3 +1,5 @@ +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/kill.cpp b/src/kill.cpp index c3b1000e..17a10d85 100644 --- a/src/kill.cpp +++ b/src/kill.cpp @@ -2,6 +2,8 @@ // // Works like the killring in emacs and readline. The killring is cut and paste with a memory of // previous cuts. It supports integration with the X clipboard. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/pager.cpp b/src/pager.cpp index dff8b1a5..222b510f 100644 --- a/src/pager.cpp +++ b/src/pager.cpp @@ -1,3 +1,5 @@ +#include "config.h" // IWYU pragma: keep + // IWYU pragma: no_include #include #include diff --git a/src/parse_execution.cpp b/src/parse_execution.cpp index 7989597f..ee2da50d 100644 --- a/src/parse_execution.cpp +++ b/src/parse_execution.cpp @@ -6,6 +6,8 @@ // // Non-fatal errors are printed as soon as they are encountered; otherwise you would have to wait // for the execution to finish to see them. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/parse_productions.cpp b/src/parse_productions.cpp index bb5b0e5f..a9da3b32 100644 --- a/src/parse_productions.cpp +++ b/src/parse_productions.cpp @@ -1,3 +1,5 @@ +#include "config.h" // IWYU pragma: keep + #include #include "common.h" diff --git a/src/parse_tree.cpp b/src/parse_tree.cpp index 8bd7d4f9..befa104b 100644 --- a/src/parse_tree.cpp +++ b/src/parse_tree.cpp @@ -1,4 +1,6 @@ // Programmatic representation of fish code. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/parse_util.cpp b/src/parse_util.cpp index d1d92189..b78e4a8e 100644 --- a/src/parse_util.cpp +++ b/src/parse_util.cpp @@ -2,6 +2,8 @@ // // This library can be seen as a 'toolbox' for functions that are used in many places in fish and // that are somehow related to parsing the code. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/parser.cpp b/src/parser.cpp index 17d845ab..90211df1 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -1,4 +1,6 @@ // The fish parser. Contains functions for parsing and evaluating code. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/parser_keywords.cpp b/src/parser_keywords.cpp index 340a886f..4a99dd94 100644 --- a/src/parser_keywords.cpp +++ b/src/parser_keywords.cpp @@ -1,4 +1,6 @@ // Functions having to do with parser keywords, like testing if a function is a block command. +#include "config.h" // IWYU pragma: keep + #include "parser_keywords.h" #include "common.h" #include "fallback.h" // IWYU pragma: keep diff --git a/src/path.cpp b/src/path.cpp index b5ee0790..c84789ce 100644 --- a/src/path.cpp +++ b/src/path.cpp @@ -1,6 +1,8 @@ // Directory utilities. This library contains functions for locating configuration directories, for // testing if a command with a given name can be found in the PATH, and various other path-related // issues. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/postfork.cpp b/src/postfork.cpp index cb0760b4..08deb77c 100644 --- a/src/postfork.cpp +++ b/src/postfork.cpp @@ -1,4 +1,6 @@ // Functions that we may safely call after fork(). +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/print_help.cpp b/src/print_help.cpp index ad479023..03ae3859 100644 --- a/src/print_help.cpp +++ b/src/print_help.cpp @@ -1,4 +1,6 @@ // Print help message for the specified command. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/sanity.cpp b/src/sanity.cpp index 895112ca..df355935 100644 --- a/src/sanity.cpp +++ b/src/sanity.cpp @@ -1,4 +1,6 @@ // Functions for performing sanity checks on the program state. +#include "config.h" // IWYU pragma: keep + #include #include "common.h" diff --git a/src/signal.cpp b/src/signal.cpp index f232b01c..8aa55828 100644 --- a/src/signal.cpp +++ b/src/signal.cpp @@ -1,4 +1,6 @@ // The library for various signal related issues. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp index 3bc5a152..7357fd35 100644 --- a/src/tokenizer.cpp +++ b/src/tokenizer.cpp @@ -1,5 +1,7 @@ // A specialized tokenizer for tokenizing the fish language. In the future, the tokenizer should be // extended to support marks, tokenizing multiple strings and disposing of unused string segments. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/utf8.cpp b/src/utf8.cpp index afd0c764..e5a4178a 100644 --- a/src/utf8.cpp +++ b/src/utf8.cpp @@ -13,6 +13,8 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "config.h" // IWYU pragma: keep + #include // IWYU pragma: keep #include #include diff --git a/src/util.cpp b/src/util.cpp index 80c9771a..bf44feab 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,6 +1,8 @@ // Generic utilities library. // // Contains data structures such as automatically growing array lists, priority queues, etc. +#include "config.h" // IWYU pragma: keep + #include #include #include diff --git a/src/wcstringutil.cpp b/src/wcstringutil.cpp index 9fcb168e..7e208469 100644 --- a/src/wcstringutil.cpp +++ b/src/wcstringutil.cpp @@ -1,4 +1,6 @@ // Helper functions for working with wcstring. +#include "config.h" // IWYU pragma: keep + #include "wcstringutil.h" #include "common.h" diff --git a/src/wildcard.cpp b/src/wildcard.cpp index ace52a79..b48fe763 100644 --- a/src/wildcard.cpp +++ b/src/wildcard.cpp @@ -1,5 +1,7 @@ // Fish needs it's own globbing implementation to support tab-expansion of globbed parameters. Also // provides recursive wildcards using **. +#include "config.h" // IWYU pragma: keep + #include #include #include -- cgit v1.2.3