diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-07-30 08:50:15 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-07-30 08:50:15 +0100 |
| commit | 1c8c5cff67b20d86c442b0917d6c1fc6407140df (patch) | |
| tree | 53ebea660bef14cdc2ff5b7ebefb4049f705f997 /dev/LibCompiler/ErrorOr.h | |
| parent | 073811d89c98d6e1c078a032ca2eedefebf80384 (diff) | |
feat! Breaking API changes of NeCTI's LibCompiler and LibDebugger.
what:
- They've now become CompilerKit and DebuggerKit.
- Expanding XCoff for NeBoot PowerPC backend.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/LibCompiler/ErrorOr.h')
| -rw-r--r-- | dev/LibCompiler/ErrorOr.h | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/dev/LibCompiler/ErrorOr.h b/dev/LibCompiler/ErrorOr.h deleted file mode 100644 index 77015b1..0000000 --- a/dev/LibCompiler/ErrorOr.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * ======================================================== - * - * LibCompiler - * Copyright (C) 2024-2025 Amlal El Mahrouss, all rights reserved. - * - * ======================================================== - */ - -#pragma once - -#include <LibCompiler/Defines.h> -#include <LibCompiler/ErrorID.h> -#include <LibCompiler/Ref.h> - -namespace LibCompiler { -using ErrorT = UInt32; - -template <typename T> -class ErrorOr final { - public: - ErrorOr() = default; - ~ErrorOr() = default; - - public: - explicit ErrorOr(Int32 err) : mId(err) {} - - explicit ErrorOr(nullPtr Null) {} - - explicit ErrorOr(T Class) : mRef(Class) {} - - ErrorOr& operator=(const ErrorOr&) = default; - ErrorOr(const ErrorOr&) = default; - - Ref<T> Leak() { return mRef; } - - Int32 Error() { return mId; } - - BOOL HasError() { return mId != LIBCOMPILER_SUCCESS; } - - operator bool() { return mRef; } - - private: - Ref<T> mRef; - Int32 mId{0}; -}; - -using ErrorOrAny = ErrorOr<voidPtr>; - -} // namespace LibCompiler |
