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:
Andreas Kling 2019-02-26 22:40:35 +01:00
commit 424368034b
Notes: sideshowbarker 2024-07-19 15:37:06 +09:00
4 changed files with 146 additions and 87 deletions

View file

@ -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; }