diff --git a/tcc.h b/tcc.h index fe870d8..48a42f2 100644 --- a/tcc.h +++ b/tcc.h @@ -1008,7 +1008,7 @@ PUB_FUNC void cstr_cat(CString *cstr, const char *str); PUB_FUNC void cstr_wccat(CString *cstr, int ch); PUB_FUNC void cstr_new(CString *cstr); PUB_FUNC void cstr_free(CString *cstr); -#define cstr_reset(cstr) cstr_free(cstr) +PUB_FUNC void cstr_reset(CString *cstr); ST_FUNC Section *new_section(TCCState *s1, const char *name, int sh_type, int sh_flags); ST_FUNC void section_realloc(Section *sec, unsigned long new_size); diff --git a/tccpp.c b/tccpp.c index b80c986..4b7b4fa 100644 --- a/tccpp.c +++ b/tccpp.c @@ -163,6 +163,12 @@ PUB_FUNC void cstr_free(CString *cstr) cstr_new(cstr); } +/* reset string to empty */ +PUB_FUNC void cstr_reset(CString *cstr) +{ + cstr->size = 0; +} + /* XXX: unicode ? */ static void add_char(CString *cstr, int c) {