From 8c1aa2c24d5984c2258a839f61e3bab40f865947 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Sun, 10 Apr 2011 19:46:55 +0000 Subject: [PATCH] Changes to cerrno to protect against the case the ELAST is not defined. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@129255 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/cerrno | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/include/cerrno b/include/cerrno index 0d101882..e8c2e578 100644 --- a/include/cerrno +++ b/include/cerrno @@ -30,25 +30,43 @@ Macros: #if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) +#ifdef ELAST + const int __elast1 = ELAST+1; const int __elast2 = ELAST+2; -#undef ELAST + +#else + +const int __elast1 = 104; +const int __elast2 = 105; + +#endif #ifdef ENOTRECOVERABLE #define EOWNERDEAD __elast1 + +#ifdef ELAST +#undef ELAST #define ELAST EOWNERDEAD +#endif #elif defined(EOWNERDEAD) #define ENOTRECOVERABLE __elast1 +#ifdef ELAST +#undef ELAST #define ELAST ENOTRECOVERABLE +#endif #else // defined(EOWNERDEAD) #define EOWNERDEAD __elast1 #define ENOTRECOVERABLE __elast2 +#ifdef ELAST +#undef ELAST #define ELAST ENOTRECOVERABLE +#endif #endif // defined(EOWNERDEAD)