From 568131a018b89f30acbeb44b40f774afaf1ae3be Mon Sep 17 00:00:00 2001 From: leitner Date: Mon, 23 Jun 2008 07:24:22 +0000 Subject: [PATCH] add fmt_strm_alloca --- fmt.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fmt.h b/fmt.h index 458b34a..2ecaf0c 100644 --- a/fmt.h +++ b/fmt.h @@ -93,4 +93,9 @@ char fmt_tohex(char c); #define fmt_strm(b,...) fmt_strm_internal(b,__VA_ARGS__,(char*)0) size_t fmt_strm_internal(char* dest,...); +#ifndef MAX_ALLOCA +#define MAX_ALLOCA 100000 +#endif +#define fmt_strm_alloca(a,...) ({ size_t len=fmt_strm((char*)0,a,__VA_ARGS__)+1; char* c=(len