Re: Something like string-streams existing in "C"?

Liste des GroupesRevenir à cl c  
Sujet : Re: Something like string-streams existing in "C"?
De : already5chosen (at) *nospam* yahoo.com (Michael S)
Groupes : comp.lang.c
Date : 19. Dec 2024, 21:04:35
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20241219220435.00001140@yahoo.com>
References : 1 2 3
User-Agent : Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
On Thu, 19 Dec 2024 19:47:28 -0000 (UTC)
Kaz Kylheku <643-408-1753@kylheku.com> wrote:

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

Don't you mean, vsnprintf ?


}
 
#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? :)
 
 



Date Sujet#  Auteur
19 Dec 24 * Something like string-streams existing in "C"?15Janis Papanagnou
19 Dec 24 +- Re: Something like string-streams existing in "C"?1Keith Thompson
19 Dec 24 +- Re: Something like string-streams existing in "C"?1Lawrence D'Oliveiro
19 Dec 24 +* Re: Something like string-streams existing in "C"?11BlueManedHawk
19 Dec 24 i`* Re: Something like string-streams existing in "C"?10Kaz Kylheku
19 Dec 24 i `* Re: Something like string-streams existing in "C"?9Michael S
19 Dec 24 i  `* Re: Something like string-streams existing in "C"?8Kaz Kylheku
20 Dec 24 i   +* Re: Something like string-streams existing in "C"?6Thiago Adams
20 Dec 24 i   i`* Re: Something like string-streams existing in "C"?5Michael S
20 Dec 24 i   i +* Re: Something like string-streams existing in "C"?3Thiago Adams
20 Dec 24 i   i i+- Re: Something like string-streams existing in "C"?1Michael S
20 Dec 24 i   i i`- Re: Something like string-streams existing in "C"?1Lawrence D'Oliveiro
20 Dec 24 i   i `- Re: Something like string-streams existing in "C"?1Keith Thompson
20 Dec 24 i   `- Re: Something like string-streams existing in "C"?1Michael S
20 Dec 24 `- Re: Something like string-streams existing in "C"?1Janis Papanagnou

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal