Browse Source

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

master
Reece H. Dunn 9 years ago
parent
commit
1042d88f56
3 changed files with 3 additions and 5 deletions
  1. 1
    1
      src/espeak.c
  2. 1
    2
      src/libespeak-ng/speak_lib.c
  3. 1
    2
      src/speak.c

+ 1
- 1
src/espeak.c 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
src/libespeak-ng/speak_lib.c 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
src/speak.c 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);

Loading…
Cancel
Save