diff options
author | Gaius Mulley <gaiusmod2@gmail.com> | 2025-03-20 22:23:38 +0000 |
---|---|---|
committer | Gaius Mulley <gaiusmod2@gmail.com> | 2025-03-20 22:23:38 +0000 |
commit | 53dcff73dab134be596036e6bdd35e7b9d7a302b (patch) | |
tree | 4d2ececc2b764b174a6bd0c523dfe34a0abc4756 | |
parent | d286ece094ca52f41bf71096aa1de0a0cd954dfb (diff) | |
download | gcc-53dcff73dab134be596036e6bdd35e7b9d7a302b.zip gcc-53dcff73dab134be596036e6bdd35e7b9d7a302b.tar.gz gcc-53dcff73dab134be596036e6bdd35e7b9d7a302b.tar.bz2 |
modula2: Defend against no ENOTBLK definition
This patch defends against no ENOTBLK definition.
libgm2/ChangeLog:
* libm2iso/ErrnoCategory.cc (IsErrnoHard): Defend against
lack of ENOTBLK.
(UnAvailable): Ditto.
(GetOpenResults): Ditto.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
-rw-r--r-- | libgm2/libm2iso/ErrnoCategory.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libgm2/libm2iso/ErrnoCategory.cc b/libgm2/libm2iso/ErrnoCategory.cc index 053c75b..d1dcb15 100644 --- a/libgm2/libm2iso/ErrnoCategory.cc +++ b/libgm2/libm2iso/ErrnoCategory.cc @@ -50,7 +50,10 @@ EXPORT(IsErrnoHard) (int e) { #if defined(HAVE_ERRNO_H) || defined(HAVE_SYS_ERRNO_H) return ((e == EPERM) || (e == ENOENT) || (e == EIO) || (e == ENXIO) - || (e == EACCES) || (e == ENOTBLK) || (e == ENODEV) || (e == EINVAL) + || (e == EACCES) || (e == ENODEV) || (e == EINVAL) +#ifdef ENOTBLK + || (e == ENOTBLK) +#endif || (e == ENFILE) || (e == EROFS) || (e == EMLINK)); #else return false; @@ -79,7 +82,10 @@ EXPORT(UnAvailable) (int e) { #if defined(HAVE_ERRNO_H) || defined(HAVE_SYS_ERRNO_H) return ((e == ENOENT) || (e == ESRCH) || (e == ENXIO) || (e == ECHILD) - || (e == ENOTBLK) || (e == ENODEV) || (e == ENOTDIR)); +#ifdef ENOTBLK + || (e == ENOTBLK) +#endif + || (e == ENODEV) || (e == ENOTDIR)); #else return false; #endif @@ -108,9 +114,11 @@ EXPORT(GetOpenResults) (int e) case EACCES: return wrongPermissions; break; +#ifdef ENOTBLK case ENOTBLK: return wrongFileType; break; +#endif case EEXIST: return fileExists; break; |