mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-29 19:37:06 -05:00
Address some portability issues
This commit is contained in:
parent
d25b55d393
commit
496971e9c9
18 changed files with 248 additions and 247 deletions
8
util.h
8
util.h
|
|
@ -46,7 +46,11 @@ static inline int strgets(char* s, unsigned size, FILE* f)
|
|||
int c;
|
||||
|
||||
while (1) {
|
||||
#if HAVE_FGETC_UNLOCKED
|
||||
c = fgetc_unlocked(f);
|
||||
#else
|
||||
c = fgetc(f);
|
||||
#endif
|
||||
|
||||
if (c == EOF || c == '\n')
|
||||
break;
|
||||
|
|
@ -59,7 +63,11 @@ static inline int strgets(char* s, unsigned size, FILE* f)
|
|||
}
|
||||
|
||||
if (c == EOF) {
|
||||
#if HAVE_FERROR_UNLOCKED
|
||||
if (ferror_unlocked(f)) {
|
||||
#else
|
||||
if (ferror(f)) {
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
if (i == s)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue