mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:17:35 +00:00
LibC: Make errno codes be #defines instead of enum values.
It turns out that a lot of 3rd party software does things like: #ifdef EINTR ... #endif This won't work if EINTR is an enum. So much for that nice idea.
This commit is contained in:
parent
83e78648e4
commit
424368034b
4 changed files with 146 additions and 87 deletions
|
@ -7,7 +7,6 @@ enum KSuccessTag { KSuccess };
|
|||
|
||||
class KResult {
|
||||
public:
|
||||
explicit KResult(__errno_value e) : m_error(-e) { }
|
||||
explicit KResult(int negative_e) : m_error(negative_e) { ASSERT(negative_e <= 0); }
|
||||
KResult(KSuccessTag) : m_error(0) { }
|
||||
operator int() const { return m_error; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue