Subject: __NetBSD_Version__ sucks
To: None <tech-kern@NetBSD.ORG>
From: Charles M. Hannum <mycroft@mit.edu>
List: tech-kern
Date: 05/10/1998 21:17:13
Consider an interface change in 1.4E.  I change __NetBSD_Version__ to
104050000.  Now I import the same change into 1.4.1, changing
__NetBSD_Version__ to 104000100.  In order to make this work, I have
to have #ifs like:

#if __NetBSD_Version__ >= 104050000 || \
    (__NetBSD_Version__ >= 104000100 && __NetBSD_Version__ < 104010000)

I dare say this is stupid.


What we really need is two independent variables -- one that changes
with releases, and one that tracks -current.

In the release branch, you'd have:

#define	__NetBSD_release__	10401	/* 1.4.1 */
#define	__NetBSD_current__	10400	/* 1.4 */

In -current, you'd have:

#define	__NetBSD_release__	10400	/* 1.4 */
#define	__NetBSD_current__	10405	/* 1.4E */

Then I can do:

#if __NetBSD_current__ >= 10405 || __NetBSD_release__ >= 10401