From dd70d19267ac343adae7bf15fe15c08fa604e5e1 Mon Sep 17 00:00:00 2001 From: grischka Date: Mon, 25 May 2009 02:07:30 +0200 Subject: [PATCH] #define __TINYC__ = version-number --- libtcc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libtcc.c b/libtcc.c index 8e43fe2..5208ea5 100644 --- a/libtcc.c +++ b/libtcc.c @@ -1834,6 +1834,8 @@ static void tcc_cleanup(void) TCCState *tcc_new(void) { TCCState *s; + char buffer[100]; + int a,b,c; tcc_cleanup(); @@ -1889,7 +1891,9 @@ TCCState *tcc_new(void) #endif #endif /* tiny C specific defines */ - tcc_define_symbol(s, "__TINYC__", NULL); + sscanf(TCC_VERSION, "%d.%d.%d", &a, &b, &c); + sprintf(buffer, "%d", a*10000 + b*100 + c); + tcc_define_symbol(s, "__TINYC__", buffer); /* tiny C & gcc defines */ tcc_define_symbol(s, "__SIZE_TYPE__", "unsigned long");