libCom: epicsVersion.h changes

Make version numbers easier to compare.
This commit is contained in:
Andrew Johnson
2011-08-30 17:50:53 -05:00
parent 86c373370f
commit c5212ea23c
3 changed files with 29 additions and 1 deletions

View File

@@ -15,6 +15,26 @@ EPICS Base 3.15.0.x releases are not intended for use in production systems.</p>
<h2 align="center">Changes between 3.14.x and 3.15.0.x</h2>
<!-- Insert new items immediately below here ... -->
<h3>
Changes to epicsVersion.h</h3>
<p>
The two macros <tt>EPICS_UPDATE_LEVEL</tt> and <tt>EPICS_CVS_SNAPSHOT</tt> have
been deleted from the epicsVersion.h file; they were deprecated in R3.14 and can
be replaced with <tt>EPICS_PATCH_LEVEL</tt> and <tt>EPICS_DEV_SNAPSHOT</tt>
respectively.</p>
<p>
A new pair of macros has been added to make version number comparisons easier.
Code that will not work with a version of Base before 3.15.0 can now be
written like this to prevent it from compiling:</p>
<pre style="margin: 0 2em;">
#if defined(VERSION_INT) && EPICS_VERSION_INT < VERSION_INT(3,15,0,0)
# error EPICS Base R3.15.0 or later is required
#endif
</pre>
<h3>
Added support for iocLogPrefix</h3>

View File

@@ -7,6 +7,7 @@
# This is a Makefile fragment, see src/libCom/Makefile.
$(COMMON_DIR)/epicsVersion.h: $(CONFIG)/CONFIG_BASE_VERSION $(CONFIG)/CONFIG_SITE
$(COMMON_DIR)/epicsVersion.h: $(CONFIG)/CONFIG_BASE_VERSION \
$(CONFIG)/CONFIG_SITE $(LIBCOM)/misc/makeEpicsVersion.pl
$(PERL) $(LIBCOM)/misc/makeEpicsVersion.pl $(CONFIG)/CONFIG_BASE_VERSION $(@D) $(EPICS_SITE_VERSION)

View File

@@ -55,6 +55,9 @@ open my $OUT, '>', $epicsVersion
print $OUT <<"END_OUTPUT";
/* Generated epicsVersion.h */
#ifndef INC_epicsVersion_H
#define INC_epicsVersion_H
#define EPICS_VERSION $ver
#define EPICS_REVISION $rev
#define EPICS_MODIFICATION $mod
@@ -64,10 +67,14 @@ print $OUT <<"END_OUTPUT";
#define EPICS_VERSION_STRING "EPICS $ver_str"
#define epicsReleaseVersion "EPICS R$ver_str $commit_date"
#define VERSION_INT(V,R,M,P) ( ((V)<<24) | ((R)<<16) | ((M)<<8) | (P))
#define EPICS_VERSION_INT VERSION_INT($ver, $rev, $mod, $patch)
/* The following names are deprecated, use the equivalent name above */
#define EPICS_UPDATE_LEVEL EPICS_PATCH_LEVEL
#define EPICS_CVS_SNAPSHOT EPICS_DEV_SNAPSHOT
#endif /* INC_epicsVersion_H */
END_OUTPUT
close $OUT;