Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define _DIRENT_HAVE_D_TYPE in one place #332

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion encfs/DirNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
#include "Error.h"
#include "Mutex.h"

#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
#define _DIRENT_HAVE_D_TYPE
#endif

using namespace std;

namespace encfs {
Expand Down Expand Up @@ -78,7 +82,7 @@ static bool _nextName(struct dirent *&de, const std::shared_ptr<DIR> &dir,

if (de) {
if (fileType) {
#if defined(_DIRENT_HAVE_D_TYPE) || defined(__FreeBSD__) || defined(__APPLE__)
#if defined(_DIRENT_HAVE_D_TYPE)
*fileType = de->d_type;
#else
#warning "struct dirent.d_type not supported"
Expand Down