Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions libc/src/__support/OSUtil/uefi/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_OSUTIL_UEFI_ERROR_H
#define LLVM_LIBC_SRC___SUPPORT_OSUTIL_UEFI_ERROR_H

#include "hdr/errno_macros.h"
#include "include/llvm-libc-types/EFI_STATUS.h"
#include "src/__support/CPP/array.h"
#include "src/__support/CPP/limits.h"
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
#include <errno.h>
#include <limits.h>

namespace LIBC_NAMESPACE_DECL {

#define EFI_ERROR_MAX_BIT (1 << (sizeof(EFI_STATUS) * sizeof(char) - 1))
#define EFI_ERROR_MAX_BIT (cpp::numeric_limits<EFI_STATUS>::max())
#define EFI_ENCODE_ERROR(value) \
(EFI_ERROR_MAX_BIT | (EFI_ERROR_MAX_BIT >> 2) | (value))
#define EFI_ENCODE_WARNING(value) ((EFI_ERROR_MAX_BIT >> 2) | (value))
Expand All @@ -28,7 +28,7 @@ struct UefiStatusErrnoEntry {
int errno_value;
};

static constexpr cpp::array<UefiStatusErrnoEntry, 43> UEFI_STATUS_ERRNO_MAP = {{
static const cpp::array<UefiStatusErrnoEntry, 43> UEFI_STATUS_ERRNO_MAP = {{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this not constexpr?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it was causing a compiler error. I have about 2,370 builds to go until I can try.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, it turns out clang likes it now. 🤷

{EFI_SUCCESS, 0},
{EFI_ENCODE_ERROR(EFI_LOAD_ERROR), EINVAL},
{EFI_ENCODE_ERROR(EFI_INVALID_PARAMETER), EINVAL},
Expand Down
Loading