[libcxx-commits] [PATCH] D56398: Add new EINTEGRITY errno

Dimitry Andric via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 21 11:43:01 PDT 2019


dim updated this revision to Diff 225929.
dim added a comment.

Get rid of the ELAST trickery, which is hard to maintain, and does not
appear to serve any purpose.  There is no mention of ELAST in the C or
C++ standards, as far as I know.

Then, simply add the new EINTEGRITY define at the end with a unique
value, if it does not yet exist.


Repository:
  rCXX libc++

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56398/new/

https://reviews.llvm.org/D56398

Files:
  include/errno.h


Index: include/errno.h
===================================================================
--- include/errno.h
+++ include/errno.h
@@ -32,50 +32,6 @@
 
 #ifdef __cplusplus
 
-#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
-
-#ifdef ELAST
-
-static const int __elast1 = ELAST+1;
-static const int __elast2 = ELAST+2;
-
-#else
-
-static const int __elast1 = 104;
-static 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)
-
-#endif  // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
-
 //  supply errno values likely to be missing, particularly on Windows
 
 #ifndef EAFNOSUPPORT
@@ -392,6 +348,8 @@
 #define EMLINK 9979
 #endif
 
-#endif // __cplusplus
+#ifndef EINTEGRITY
+#define EINTEGRITY 9980
+#endif
 
 #endif  // _LIBCPP_ERRNO_H


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56398.225929.patch
Type: text/x-patch
Size: 1182 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20191021/5070f82e/attachment.bin>


More information about the libcxx-commits mailing list