From b1f53e7eb5c470dd3d2afbc840c2712956366de7 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Sun, 17 Mar 2024 18:29:42 -0500 Subject: [PATCH] src: filesystem: move includes out of the FileSys namespace The previous situation is unfortunately not sustainable; header pollution isn't consistent across all non-Windows platforms. As a result, some of the earlier includes may pull functions/types into the global namespace too soon, and the later includes will have no visibility of them because they're in a different namespace. Re-including the necessary one doesn't work because include guards will prevent their re-inclusion, and it's not a good idea to try and #undefine include guards now that we're in a new namespace. This fixes the build on FreeBSD, and likely some other systems as well. --- src/common/filesystem/source/fs_findfile.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/common/filesystem/source/fs_findfile.cpp b/src/common/filesystem/source/fs_findfile.cpp index 06d9b69f1..1f8824fc7 100644 --- a/src/common/filesystem/source/fs_findfile.cpp +++ b/src/common/filesystem/source/fs_findfile.cpp @@ -36,6 +36,18 @@ #include #include +#ifndef _WIN32 + +#include +#include +#include +#include +#include + +#include + +#endif + namespace FileSys { enum @@ -63,14 +75,6 @@ enum #ifndef _WIN32 -#include -#include -#include -#include -#include - -#include - struct findstate_t { std::string path;