projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TYPE_MAXIMUM: avoid theoretically undefined behavior
[gnulib.git]
/
lib
/
freadable.c
diff --git
a/lib/freadable.c
b/lib/freadable.c
index
b501404
..
e1420f0
100644
(file)
--- a/
lib/freadable.c
+++ b/
lib/freadable.c
@@
-1,5
+1,5
@@
/* Retrieve information about a FILE stream.
/* Retrieve information about a FILE stream.
- Copyright (C) 2007-20
08
Free Software Foundation, Inc.
+ Copyright (C) 2007-20
11
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-33,10
+33,12
@@
freadable (FILE *fp)
return (fp_->_flags & (__SRW | __SRD)) != 0;
#elif defined __EMX__ /* emx+gcc */
return (fp->_flags & (_IORW | _IOREAD)) != 0;
return (fp_->_flags & (__SRW | __SRD)) != 0;
#elif defined __EMX__ /* emx+gcc */
return (fp->_flags & (_IORW | _IOREAD)) != 0;
-#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw
, NonStop Kernel
*/
return (fp->_flag & (_IORW | _IOREAD)) != 0;
#elif defined __QNX__ /* QNX */
return (fp->_Mode & 0x1 /* _MOPENR */) != 0;
return (fp->_flag & (_IORW | _IOREAD)) != 0;
#elif defined __QNX__ /* QNX */
return (fp->_Mode & 0x1 /* _MOPENR */) != 0;
+#elif defined __MINT__ /* Atari FreeMiNT */
+ return fp->__mode.__read;
#else
#error "Please port gnulib freadable.c to your platform! Look at the definition of fopen, fdopen on your system, then report this to bug-gnulib."
#endif
#else
#error "Please port gnulib freadable.c to your platform! Look at the definition of fopen, fdopen on your system, then report this to bug-gnulib."
#endif