From: Tom Tromey Date: Mon, 9 Nov 2020 13:55:39 +0000 (-0700) Subject: Move include block to pathstuff.h X-Git-Tag: binutils-2_36~641 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6c51cf513d98adcf34a342c7e9d885a6c788cda8;p=thirdparty%2Fbinutils-gdb.git Move include block to pathstuff.h A recent commit caused pathstuff.cc to fail to compile on mingw, like: ../../binutils-gdb/gdbsupport/pathstuff.cc:324:1: error: no previous declaration for 'std::string find_gdb_home_config_file(const char*, _stati64*)' [-Werror=missing-declarations] Some newly-added #includes were changing which "stat" was being seen by the compiler. This patch moves the includes to the header, so that the declaration and definition now agree. 2020-11-10 Tom Tromey PR build/26848: * pathstuff.h: Move include block here... * pathstuff.cc: ... from here. --- diff --git a/gdbsupport/ChangeLog b/gdbsupport/ChangeLog index 1d83cbb505e..2e5b3fa8004 100644 --- a/gdbsupport/ChangeLog +++ b/gdbsupport/ChangeLog @@ -1,3 +1,9 @@ +2020-11-10 Tom Tromey + + PR build/26848: + * pathstuff.h: Move include block here... + * pathstuff.cc: ... from here. + 2020-11-02 Tom Tromey * pathstuff.h (get_standard_config_dir): Declare. diff --git a/gdbsupport/pathstuff.cc b/gdbsupport/pathstuff.cc index a52e53b8671..311456720e4 100644 --- a/gdbsupport/pathstuff.cc +++ b/gdbsupport/pathstuff.cc @@ -23,10 +23,6 @@ #include "filenames.h" #include "gdb_tilde_expand.h" -#include -#include -#include - #ifdef USE_WIN32API #include #endif diff --git a/gdbsupport/pathstuff.h b/gdbsupport/pathstuff.h index 996c8f2bbf6..7e35f62c78c 100644 --- a/gdbsupport/pathstuff.h +++ b/gdbsupport/pathstuff.h @@ -22,6 +22,10 @@ #include "gdbsupport/byte-vector.h" +#include +#include +#include + /* Path utilities. */ /* Return the real path of FILENAME, expanding all the symbolic links.