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

Improve portability for "dirent->d_type" #1334

Merged
merged 1 commit into from Feb 14, 2018

Conversation

Projects
None yet
2 participants
@Ghabry
Copy link
Member

Ghabry commented Feb 13, 2018

Checks now for "_DIRENT_HAVE_D_TYPE" (defined by the dirent_win.h header, checked this) which is the documented way to test for this extension.

DT_UNKNOWN is handled now correctly for filesystem that don't provide the file type without stat'ing.

if (has_fast_dir_stat) {
#ifdef PSP2
is_directory = S_ISDIR(ent.d_stat.st_mode);
#elif defined(_DIRENT_HAVE_D_TYPE)
if (ent->d_type == DT_UNKNOWN) {
has_fast_dir_stat = false;

This comment has been minimized.

@Ghabry

Ghabry Feb 13, 2018

Author Member

I could move the deleted output::debug lines here but I question there usefulness

This comment has been minimized.

@carstene1ns

carstene1ns Feb 13, 2018

Member

At least they are an indicator when porting to a new platform... but could be left out, right.

@carstene1ns
Copy link
Member

carstene1ns left a comment

Looks good to me.

if (has_fast_dir_stat) {
#ifdef PSP2
is_directory = S_ISDIR(ent.d_stat.st_mode);
#elif defined(_DIRENT_HAVE_D_TYPE)
if (ent->d_type == DT_UNKNOWN) {
has_fast_dir_stat = false;

This comment has been minimized.

@carstene1ns

carstene1ns Feb 13, 2018

Member

At least they are an indicator when porting to a new platform... but could be left out, right.

@carstene1ns carstene1ns merged commit 3f180aa into EasyRPG:master Feb 14, 2018

7 checks passed

Android (armeabi-v7a) Build finished.
Details
GCW0 Build finished.
Details
GNU/Linux Build finished.
Details
OSX Build finished.
Details
Windows (x64) Build finished.
Details
Windows (x86) Build finished.
Details
web Build finished.
Details

@carstene1ns carstene1ns added this to the 0.5.4 milestone Feb 14, 2018

@Ghabry Ghabry deleted the Ghabry:dt-supp branch Feb 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.