bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vasnprintf.c Android bug?


From: Bruno Haible
Subject: Re: vasnprintf.c Android bug?
Date: Wed, 25 Jan 2023 13:44:20 +0100

Hi,

Po Lu wrote:
> With the build API version set to 21 on the NDK r26b, vasnprintf.c needs
> to include:
> 
> #include <wchar.h>
> 
> or else it cannot find mbstate_t.

Thanks for the report. This patch should fix it.


2023-01-25  Bruno Haible  <bruno@clisp.org>

        vasnprintf: Fix compilation error on Android NDK r26b.
        Reported by Po Lu <luangruo@yahoo.com>.
        * lib/vasnprintf.c: Include <wchar.h>.

diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
index ab11ad026e..277c39e3e0 100644
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -83,6 +83,7 @@
 #include <stdio.h>      /* snprintf(), sprintf() */
 #include <stdlib.h>     /* abort(), malloc(), realloc(), free() */
 #include <string.h>     /* memcpy(), strlen() */
+#include <wchar.h>      /* mbstate_t, mbrtowc(), mbrlen(), wcrtomb() */
 #include <errno.h>      /* errno */
 #include <limits.h>     /* CHAR_BIT */
 #include <float.h>      /* DBL_MAX_EXP, LDBL_MAX_EXP */






reply via email to

[Prev in Thread] Current Thread [Next in Thread]