You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Jesse Pelton <js...@PKC.com> on 2002/07/11 20:59:24 UTC

RE: Xerces versioning policies: re version definition in XercesD e fs.hpp && Outstanding Bug 9154

Someone pointed out that it would be helpful to have a macro to build a
version number from its components, so code could do something like:

#if XERCES_VERSION < XERCES_MAKE_VERSION(2,0,0)

This has the advantage of isolating users' code from changes in the version
format. (Based on these discussions, I'd wager that it will change at some
point.) This would dictate at least one macro, something like:

#define XERCES_MAKE_VERSION (a, b, c) ((x##a) << 24 & (x##b) << 12 & (x##c))

which, if the token pasting is legitimate and I've done my math right, would
generate versions in the format Tinny proposes given decimal values for a,
b, and c. Of course, the point of such a macro is to avoid dependency on the
format, so the macro definition could change from rev to rev.

-----Original Message-----
From: jason@openinformatics.com [mailto:jason@openinformatics.com]
Sent: Thursday, July 11, 2002 1:03 PM
To: xerces-c-dev@xml.apache.org
Subject: Re: Xerces versioning policies: re version definition in
XercesDe fs.hpp && Outstanding Bug 9154


tng-xml@ca.ibm.com writes:

> I don't think we need both hex and non-hex version.  There are too many
> macros / constants already.   For simplicity, I prefer the hex version,
for
> example:
> 
>     // these are existing constants
>     #define Xerces_DLLVersionStr "1_7_0"
>     const char* const    gXercesVersionStr = "1_7";
>     const char* const    gXercesFullVersionStr = "1_7_0";
>     const unsigned int   gXercesMajVersion = 1;
>     const unsigned int   gXercesMinVersion = 7;
>     const unsigned int   gXercesRevision   = 0;
> 
>     // these are newly introduced
>     #define XERCES_VERSION_MAJOR 1
>     #define XERCES_VERSION_MINOR 7
>     #define XERCES_VERSION_REVISION 0
> 
>     #define XERCES_VERSION 0x01070000  // where it is 0xAAMMMRRR (A:
major,
> M: minor, R: revision)
> 
> so that in future we may have, say
> 
>     #define Xerces_DLLVersionStr "2_74_109"
>     const char* const    gXercesVersionStr = "2_74";
>     const char* const    gXercesFullVersionStr = "2_74_109";
>     const unsigned int   gXercesMajVersion = 2;
>     const unsigned int   gXercesMinVersion = 74;
>     const unsigned int   gXercesRevision   = 109;
>     #define XERCES_VERSION_MAJOR 2
>     #define XERCES_VERSION_MINOR 74
>     #define XERCES_VERSION_REVISION 109
> 
>     #define XERCES_VERSION 0x02074109

Agreed.

I would also like to see all the other non-critical macros removed
from version.hpp, like all the concat macros, and just maintain these
numbers by hand - after all they don't change very often...

jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org