Use S_ISDIR instead of S_IFMT/S_IFDIR to fix building with gcc in c11 mode.

This commit is contained in:
Reece H. Dunn
2015-12-10 22:20:51 +00:00
parent ca5f651d1d
commit 1042d88f56
3 changed files with 3 additions and 5 deletions
+1 -1
View File
@@ -114,7 +114,7 @@ int GetFileLength(const char *filename)
if(stat(filename,&statbuf) != 0)
return(0);
if((statbuf.st_mode & S_IFMT) == S_IFDIR)
if(S_ISDIR(statbuf.st_mode))
return(-2); // a directory
return(statbuf.st_size);
+1 -2
View File
@@ -298,8 +298,7 @@ int GetFileLength(const char *filename)
if(stat(filename,&statbuf) != 0)
return(0);
if((statbuf.st_mode & S_IFMT) == S_IFDIR)
// if(S_ISDIR(statbuf.st_mode))
if(S_ISDIR(statbuf.st_mode))
return(-2); // a directory
return(statbuf.st_size);
+1 -2
View File
@@ -138,8 +138,7 @@ int GetFileLength(const char *filename)
if(stat(filename,&statbuf) != 0)
return(0);
if((statbuf.st_mode & S_IFMT) == S_IFDIR)
// if(S_ISDIR(statbuf.st_mode))
if(S_ISDIR(statbuf.st_mode))
return(-2); // a directory
return(statbuf.st_size);