aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar David Adam <zanchey@ucc.gu.uwa.edu.au>2016-05-18 22:30:21 +0000
committerGravatar David Adam <zanchey@ucc.gu.uwa.edu.au>2016-05-18 22:30:21 +0000
commit9225b16d1285e620c7c13e3416bdd4099f8ff4b7 (patch)
treea39612633828387e1c69c134a194c6d1b7a382ab
parent00e32a0909e5d0d303936eec8cb697cb67069861 (diff)
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.
-rw-r--r--src/autoload.cpp2
-rw-r--r--src/builtin.cpp1
-rw-r--r--src/builtin_commandline.cpp2
-rw-r--r--src/builtin_complete.cpp2
-rw-r--r--src/builtin_printf.cpp1
-rw-r--r--src/builtin_set.cpp2
-rw-r--r--src/builtin_test.cpp2
-rw-r--r--src/builtin_ulimit.cpp2
-rw-r--r--src/color.cpp2
-rw-r--r--src/complete.cpp2
-rw-r--r--src/env.cpp2
-rw-r--r--src/event.cpp2
-rw-r--r--src/fish_indent.cpp2
-rw-r--r--src/fish_key_reader.cpp2
-rw-r--r--src/fish_tests.cpp1
-rw-r--r--src/function.cpp2
-rw-r--r--src/highlight.cpp2
-rw-r--r--src/history.cpp2
-rw-r--r--src/intern.cpp2
-rw-r--r--src/io.cpp2
-rw-r--r--src/iothread.cpp2
-rw-r--r--src/kill.cpp2
-rw-r--r--src/pager.cpp2
-rw-r--r--src/parse_execution.cpp2
-rw-r--r--src/parse_productions.cpp2
-rw-r--r--src/parse_tree.cpp2
-rw-r--r--src/parse_util.cpp2
-rw-r--r--src/parser.cpp2
-rw-r--r--src/parser_keywords.cpp2
-rw-r--r--src/path.cpp2
-rw-r--r--src/postfork.cpp2
-rw-r--r--src/print_help.cpp2
-rw-r--r--src/sanity.cpp2
-rw-r--r--src/signal.cpp2
-rw-r--r--src/tokenizer.cpp2
-rw-r--r--src/utf8.cpp2
-rw-r--r--src/util.cpp2
-rw-r--r--src/wcstringutil.cpp2
-rw-r--r--src/wildcard.cpp2
39 files changed, 75 insertions, 0 deletions
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 <assert.h>
#include <errno.h>
#include <pthread.h>
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 <assert.h>
#include <errno.h>
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 <assert.h>
#include <errno.h>
#include <pthread.h>
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 <stdbool.h>
#include <stdlib.h>
#include <wchar.h>
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 <djm@gnu.ai.mit.edu>
// This file has been imported from source code of printf command in GNU Coreutils version 6.9.
+#include "config.h" // IWYU pragma: keep
#include <errno.h>
#include <limits.h>
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 <errno.h>
#include <stdbool.h>
#include <stdlib.h>
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 <assert.h>
#include <stdarg.h>
#include <stdbool.h>
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 <errno.h>
#include <sys/resource.h>
#include <wchar.h>
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 <assert.h>
#include <stdint.h>
#include <stdlib.h>
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 <assert.h>
#include <pthread.h>
#include <pwd.h>
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 <assert.h>
#include <errno.h>
#include <locale.h>
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 <assert.h>
#include <signal.h>
#include <stdbool.h>
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 <assert.h>
#include <getopt.h>
#include <locale.h>
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 <getopt.h>
#include <locale.h>
#include <signal.h>
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 <cstring>
// IWYU pragma: no_include <cstddef>
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 <type_traits>
#include <dirent.h>
#include <pthread.h>
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 <cstddef>
#include <dirent.h>
#include <errno.h>
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 <assert.h>
#include <ctype.h>
#include <errno.h>
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 <pthread.h>
#include <stdbool.h>
#include <stddef.h>
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 <assert.h>
#include <errno.h>
#include <stddef.h>
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 <assert.h>
#include <fcntl.h>
#include <limits.h>
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 <stdbool.h>
#include <stddef.h>
#include <algorithm>
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 <cstddef>
#include <assert.h>
#include <stddef.h>
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 <assert.h>
#include <errno.h>
#include <stdarg.h>
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 <stdio.h>
#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 <assert.h>
#include <stdarg.h>
#include <stddef.h>
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 <assert.h>
#include <stdarg.h>
#include <stdbool.h>
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 <assert.h>
#include <stdbool.h>
#include <stdio.h>
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 <assert.h>
#include <errno.h>
#include <sys/stat.h>
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 <errno.h>
#include <fcntl.h>
#include <signal.h>
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 <stdio.h>
#include <stdlib.h>
#include <string.h>
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 <unistd.h>
#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 <errno.h>
#include <signal.h>
#include <stdio.h>
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 <assert.h>
#include <fcntl.h>
#include <limits.h>
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 <stdint.h> // IWYU pragma: keep
#include <sys/types.h>
#include <limits>
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 <errno.h>
#include <stdlib.h>
#include <sys/time.h>
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 <assert.h>
#include <dirent.h>
#include <errno.h>