summaryrefslogtreecommitdiffstats
path: root/m4/rtems-verscheck.m4
blob: c678f9c08965e7cf43f6fe6e9e2699e0296fed50 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Emit two macros
#
#   'RTEMS_VERSION_LATER_THAN(major,minor,revision)'
#
# and
#
#   'RTEMS_VERSION_ATLEAST(major,minor,revision)'
#
# in config.h so applications can test for a particular
# RTEMS version and conditionally deal with API changes
# and other stuff.
# Note that sometimes (mostly during x.y.99  pre-release
# phases) such changes happen w/o an associated change in
# revision number ;-(.
#
#dnl TILLAC_RTEMS_VERSTEST
AC_DEFUN([TILLAC_RTEMS_VERSTEST],
	[AH_VERBATIM([RTEMS_VERSION_TEST],
				[
#ifndef RTEMS_VERSION_LATER_THAN
#define RTEMS_VERSION_LATER_THAN(ma,mi,re) \
	(    __RTEMS_MAJOR__  > (ma)	\
	 || (__RTEMS_MAJOR__ == (ma) && __RTEMS_MINOR__  > (mi))	\
	 || (__RTEMS_MAJOR__ == (ma) && __RTEMS_MINOR__ == (mi) && __RTEMS_REVISION__ > (re)) \
    )
#endif
#ifndef RTEMS_VERSION_ATLEAST
#define RTEMS_VERSION_ATLEAST(ma,mi,re) \
	(    __RTEMS_MAJOR__  > (ma)	\
	|| (__RTEMS_MAJOR__ == (ma) && __RTEMS_MINOR__  > (mi))	\
	|| (__RTEMS_MAJOR__ == (ma) && __RTEMS_MINOR__ == (mi) && __RTEMS_REVISION__ >= (re)) \
	)
#endif
	            ]dnl
	)]dnl
)