Remove S_IFMT from the public FLTK API

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11609 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2016-04-15 07:33:26 +00:00
parent b9564c64cc
commit 53d7191928
3 changed files with 2 additions and 3 deletions

View File

@ -66,7 +66,6 @@ struct stat { /* the FLTK source code uses part of the stat() API */
unsigned st_mode;
unsigned st_size;
};
#define S_IFMT 0170000 /* type of file */
#define S_IFDIR 0040000 /* directory */
#define S_IFREG 0100000 /* regular */

View File

@ -1333,7 +1333,7 @@ Fl_File_Chooser::update_preview()
} else {
struct stat s;
if (fl_stat(filename, &s)==0) {
if ((s.st_mode&S_IFMT)!=S_IFREG) {
if ((s.st_mode & S_IFREG) == 0) {
// this is no regular file, probably some kind of device
newlabel = "@-3refresh"; // a cross
set = 1;

View File

@ -65,7 +65,7 @@ int Fl_System_Driver::filename_isdir(const char* n) {
fn[length] = '\0';
n = fn;
}
return !stat(n, &s) && (s.st_mode & S_IFMT) == S_IFDIR;
return !stat(n, &s) && (s.st_mode & S_IFDIR);
}
//