xref: /netbsd-src/external/bsd/ntp/dist/sntp/libpkgver/pkgver.h (revision cdfa2a7ef92791ba9db70a584a1d904730e6fb46)
1 /*	$NetBSD: pkgver.h,v 1.2 2020/05/25 20:47:35 christos Exp $	*/
2 
3 /*
4  *
5  *   Copyright 2015 Harlan Stenn.  Used by NTP with permission.
6  *
7  *   Author: Harlan Stenn <harlan@pfcs.com>
8  *
9  *   Copying and distribution of this file, with or without modification, are
10  *   permitted in any medium without royalty provided the copyright notice
11  *   and this notice are preserved. This file is offered as-is, without any
12  *   warranty.
13  */
14 
15 extern int colcomp(char *s1, char *s2);
16 
17 #define PKG_VER_LT(x)	(colcomp((x), PACKAGE_VERSION) < 0)
18 #define PKG_VER_LE(x)	(colcomp((x), PACKAGE_VERSION) <= 0)
19 #define PKG_VER_EQ(x)	(colcomp((x), PACKAGE_VERSION) == 0)
20 #define PKG_VER_GE(x)	(colcomp((x), PACKAGE_VERSION) >= 0)
21 #define PKG_VER_GT(x)	(colcomp((x), PACKAGE_VERSION) > 0)
22