This set of macros could do the job: #include <stdio.h>
#undef TCC_VERSION #undef __TINYC__ #define TCC_STRINGIFY(major, minor, patch) #major "." #minor "." #patch #define TCC_TOSTRING(major, minor, patch) TCC_STRINGIFY(major, minor, patch) #define __TINYC_MAJOR__ 0 #define __TINYC_MINOR__ 9 #define __TINYC_PATCH__ 25 #define __TINYC__ (__TINYC_MAJOR__ * 10000 \ + __TINYC_MINOR__ * 100 \ + __TINYC_PATCH__) #define TCC_VERSION TCC_TOSTRING(__TINYC_MAJOR__, __TINYC_MINOR__, __TINYC_PATCH__) int main() { const char * version = TCC_VERSION; printf("<Version %s>\n", version); return( 0 ); } -----Original Message----- From: tinycc-devel-bounces+eligis=wanadoo...@nongnu.org [mailto:tinycc-devel-bounces+eligis=wanadoo...@nongnu.org] On Behalf Of Mark Wooding Sent: Friday, May 22, 2009 15:27 To: tinycc-devel@nongnu.org Subject: [Tinycc-devel] Re: Versioning lostgallifreyan <lostgallifre...@gmail.com> writes: > "Christian Jullien" <eli...@wanadoo.fr> wrote: > >#elif (__TINYC__ >= 926 || __TINYC__ <= 928) > > If an arithmetical comparison is to be made, why not first treat the > value as a string then strip out all but the digits and convert to > number? I don't know how to do that in the C preprocessor. Do you? -- [mdw] _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/tinycc-devel ---------------------------------------------------------------------------- ----------- Orange vous informe que cet e-mail a ete controle par l'anti-virus mail. Aucun virus connu a ce jour par nos services n'a ete detecte. _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/tinycc-devel