summaryrefslogtreecommitdiff
path: root/lib/vsprintf.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-12-29 11:57:35 -0700
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2021-12-31 06:45:01 +0100
commit726cd9836db0d698f1f409e9522828e985c912e2 (patch)
treea62a7183cf2f52ac6dbc5299ac87ce42dc40a408 /lib/vsprintf.c
parenteaaa5fbbe421c75dbf2319615f95e0484b330b87 (diff)
downloadu-boot-726cd9836db0d698f1f409e9522828e985c912e2.tar.gz
u-boot-726cd9836db0d698f1f409e9522828e985c912e2.tar.bz2
u-boot-726cd9836db0d698f1f409e9522828e985c912e2.zip
efi: Make unicode printf available to the app
This is needed to show unicode strings. Enable this code in the app. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r--lib/vsprintf.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index e634bd70b6..de9f236b90 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -276,9 +276,8 @@ static char *string(char *buf, char *end, char *s, int field_width,
}
/* U-Boot uses UTF-16 strings in the EFI context only. */
-#if CONFIG_IS_ENABLED(EFI_LOADER) && !defined(API_BUILD)
-static char *string16(char *buf, char *end, u16 *s, int field_width,
- int precision, int flags)
+static __maybe_unused char *string16(char *buf, char *end, u16 *s,
+ int field_width, int precision, int flags)
{
const u16 *str = s ? s : L"<NULL>";
ssize_t i, len = utf16_strnlen(str, precision);
@@ -317,7 +316,6 @@ static char *device_path_string(char *buf, char *end, void *dp, int field_width,
return buf;
}
#endif
-#endif
static char *mac_address_string(char *buf, char *end, u8 *addr, int field_width,
int precision, int flags)
@@ -616,7 +614,8 @@ repeat:
case 's':
/* U-Boot uses UTF-16 strings in the EFI context only. */
-#if CONFIG_IS_ENABLED(EFI_LOADER) && !defined(API_BUILD)
+#if (CONFIG_IS_ENABLED(EFI_LOADER) || CONFIG_IS_ENABLED(EFI_APP)) && \
+ !defined(API_BUILD)
if (qualifier == 'l') {
str = string16(str, end, va_arg(args, u16 *),
field_width, precision, flags);