minwin

Walter Bright newshound at digitalmars.com
Tue Nov 28 23:49:25 PST 2006


Bill Baxter wrote:
> Here's wxWidgets version macro for checking the version of wxWidgets 
> you're compiling with.  It should be possible to get the same effect in 
> D somehow:
> 
> /*  check if the current version is at least major.minor.release */
> #define wxCHECK_VERSION(major,minor,release) \
>     (wxMAJOR_VERSION > (major) || \
>     (wxMAJOR_VERSION == (major) && wxMINOR_VERSION > (minor)) || \
>     (wxMAJOR_VERSION == (major) && wxMINOR_VERSION == (minor) && 
> wxRELEASE_NUMBER >= (release)))

To ask the obvious dumb question, why? If I was to see such, I'd wonder 
what purpose wxCHECK_VERSION was being used for. I presume it is to 
enable/disable certain things.

I suggest instead to either:

1) create version identifiers for those "certain things" like 
wxFEATURE_FOO_IS_WORKING

2) create an api for those features and abstract them into other modules

3) wxVERSION_NUMER already combines the values into one integer. Use 
that integer instead as the overall version number.



More information about the Digitalmars-d-announce mailing list