Skip to content

Commit

Permalink
src: filesystem: move includes out of the FileSys namespace
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kevans91 authored and madame-rachelle committed Mar 18, 2024
1 parent 458d81c commit b1f53e7
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/common/filesystem/source/fs_findfile.cpp
Expand Up @@ -36,6 +36,18 @@
#include <string.h>
#include <vector>

#ifndef _WIN32

#include <limits.h>
#include <stdlib.h>
#include <unistd.h>
#include <fnmatch.h>
#include <sys/stat.h>

#include <dirent.h>

#endif

namespace FileSys {

enum
Expand Down Expand Up @@ -63,14 +75,6 @@ enum

#ifndef _WIN32

#include <limits.h>
#include <stdlib.h>
#include <unistd.h>
#include <fnmatch.h>
#include <sys/stat.h>

#include <dirent.h>

struct findstate_t
{
std::string path;
Expand Down

0 comments on commit b1f53e7

Please sign in to comment.