这是indexloc提供的服务,不要输入任何密码
Skip to content

windows: stat::st_mode and S_IFMT are of different type #3161

@cgzones

Description

@cgzones

On windows stat::st_mode

pub st_mode: u16,
and S_IFMT (and other mode flags)
pub const S_IFMT: ::c_int = 61440;
are of different type, resulting in code like

fn is_regular(stat: &libc::stat) -> bool {
    stat.st_mode & libc::S_IFMT == libc::S_IFREG
}

to not be portable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.breakage-candidate

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions