Liste des Groupes | Revenir à cl c |
On 2024-12-19, BlueManedHawk <bluemanedhawk@invalid.invalid> wrote:The ‘asprintf’ subroutine is standardized by POSIX.1-2024, meaning
that you can use it now and blame somebody else if it doesn't work.
If you
Regardless of how it is made visible, you can detect it via a compile
test in a configure script, and provide your own if it wasn't found:
#if !HAVE_ASPRINTF
int asprintf(char **out, const char *fmt, ...)
{
... // more or less trivial to implement using malloc, realloc and
vsprintf
}
#endif
BTW, is there no wchar_t version of this?
can't target POSIX, the subroutine is also _theoretically_
available through the feature-test macro ‘__STDC_WANT_LIB_EXT2__’,
assuming that ‘__STDC_ALLOC_LIB__’ is a predefined macro, but gLibC
does not pay
When would it be the case that you can't target POSIX, but *can* mess
around with some the internal feature test macros of some specific
POSIX vendor? :)
Les messages affichés proviennent d'usenet.