summaryrefslogtreecommitdiff
path: root/errlog.c
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2021-03-09 14:40:03 -0500
committerPeter Jones <pjones@redhat.com>2021-03-10 15:54:20 -0500
commit9beca885c29c77bb901547321a5ce6fd3c9c8ee3 (patch)
treeb61a67de468dfdff2225d52b03f280b807714215 /errlog.c
parent766aac4d5cfbe76026be5ce718b0883ee211f323 (diff)
downloadefi-boot-shim-9beca885c29c77bb901547321a5ce6fd3c9c8ee3.tar.gz
efi-boot-shim-9beca885c29c77bb901547321a5ce6fd3c9c8ee3.zip
Fix stdarg to work the same everywhere.
This gets us the same working definition for VA_* va_* etc everywhere, and it's the same definition edk2 is using. Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'errlog.c')
-rw-r--r--errlog.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/errlog.c b/errlog.c
index 16af23b0..ac657151 100644
--- a/errlog.c
+++ b/errlog.c
@@ -10,24 +10,26 @@ static CHAR16 **errs = NULL;
static UINTN nerrs = 0;
EFI_STATUS EFIAPI
-vdprint_(const CHAR16 *fmt, const char *file, int line, const char *func, elf_va_list args)
+vdprint_(const CHAR16 *fmt, const char *file, int line, const char *func,
+ va_list args)
{
- elf_va_list args2;
+ va_list args2;
EFI_STATUS efi_status = EFI_SUCCESS;
if (verbose) {
- elf_va_copy(args2, args);
+ va_copy(args2, args);
console_print(L"%a:%d:%a() ", file, line, func);
efi_status = VPrint(fmt, args2);
- elf_va_end(args2);
+ va_end(args2);
}
return efi_status;
}
EFI_STATUS EFIAPI
-VLogError(const char *file, int line, const char *func, const CHAR16 *fmt, elf_va_list args)
+VLogError(const char *file, int line, const char *func, const CHAR16 *fmt,
+ va_list args)
{
- elf_va_list args2;
+ va_list args2;
CHAR16 **newerrs;
newerrs = ReallocatePool(errs, (nerrs + 1) * sizeof(*errs),
@@ -38,11 +40,11 @@ VLogError(const char *file, int line, const char *func, const CHAR16 *fmt, elf_v
newerrs[nerrs] = PoolPrint(L"%a:%d %a() ", file, line, func);
if (!newerrs[nerrs])
return EFI_OUT_OF_RESOURCES;
- elf_va_copy(args2, args);
+ va_copy(args2, args);
newerrs[nerrs+1] = VPoolPrint(fmt, args2);
if (!newerrs[nerrs+1])
return EFI_OUT_OF_RESOURCES;
- elf_va_end(args2);
+ va_end(args2);
nerrs += 2;
newerrs[nerrs] = NULL;
@@ -54,12 +56,12 @@ VLogError(const char *file, int line, const char *func, const CHAR16 *fmt, elf_v
EFI_STATUS EFIAPI
LogError_(const char *file, int line, const char *func, const CHAR16 *fmt, ...)
{
- elf_va_list args;
+ va_list args;
EFI_STATUS efi_status;
- elf_va_start(args, fmt);
+ va_start(args, fmt);
efi_status = VLogError(file, line, func, fmt, args);
- elf_va_end(args);
+ va_end(args);
return efi_status;
}