[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Tinycc-devel] Re: Versioning
From: |
Christian Jullien |
Subject: |
RE: [Tinycc-devel] Re: Versioning |
Date: |
Fri, 22 May 2009 17:12:10 +0200 |
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: address@hidden
[mailto:address@hidden On Behalf Of Mark
Wooding
Sent: Friday, May 22, 2009 15:27
To: address@hidden
Subject: [Tinycc-devel] Re: Versioning
lostgallifreyan <address@hidden> writes:
> "Christian Jullien" <address@hidden> 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
address@hidden
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] TCC 0.9.25 is out, grischka, 2009/05/20
- Re: [Tinycc-devel] TCC 0.9.25 is out, lostgallifreyan, 2009/05/20
- RE: [Tinycc-devel] TCC 0.9.25 is out, Christian Jullien, 2009/05/20
- Versioning (was Re: [Tinycc-devel] TCC 0.9.25 is out), Anton Rolls, 2009/05/22
- RE: Versioning (was Re: [Tinycc-devel] TCC 0.9.25 is out), Christian Jullien, 2009/05/22
- Re: Versioning (was Re: [Tinycc-devel] TCC 0.9.25 is out), lostgallifreyan, 2009/05/22
- RE: Versioning (was Re: [Tinycc-devel] TCC 0.9.25 is out), Christian Jullien, 2009/05/22
- Re: Versioning (was Re: [Tinycc-devel] TCC 0.9.25 is out), Anton Rolls, 2009/05/23
- RE: Versioning (was Re: [Tinycc-devel] TCC 0.9.25 is out), Christian Jullien, 2009/05/23
- [Tinycc-devel] Re: Versioning, Mark Wooding, 2009/05/22
- RE: [Tinycc-devel] Re: Versioning,
Christian Jullien <=
- Re: [Tinycc-devel] Re: Versioning, lostgallifreyan, 2009/05/22