mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +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
Notes:
sideshowbarker
2024-07-19 15:37:06 +09:00
Author: https://github.com/awesomekling
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