diff --git a/NEWS.md b/NEWS.md index 7d942c300..9d7c61a9d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,8 +2,12 @@ This document attempts to list user-visible changes and any major internal rearrangements of Notcurses. * 2.0.8 (not yet released) - * The MAJOR, MINOR, and PATH versions are now available as preprocessor - numeric defines, fit for comparisons at the cpp level. + * The major, minor, and patch versions are now available as preprocessor + numeric defines, fit for comparisons at the cpp level. The + `NOTCURSES_VERSION_COMPARABLE` macro has been added, to form a comparable + version ID from a provided major, minor, and patch level. The + `NOTCURSES_VERNUM_ORDERED` macro has been added, defined as a comparable + version ID for the current version of Notcurses. * Add new function `ncplane_reparent_family()`, which reparents a plane and its bindtree (all planes bound to the plane, recursively). `ncplane_reparent()` now reparents only the specified plane; any planes @@ -34,9 +38,6 @@ rearrangements of Notcurses. annoying for callers to deal with otherwise. Sorry for the inconvenience. * Added `ncplane_set_resizecb()` and `ncplane_resizecb()`. -* 2.0.4 (2020-11-10) - * Fixed unit tests for non UTF-8 case, brown bagger, alas. - * 2.0.3 (2020-11-09) * Add `NCBLIT_3x2` aka the SEXBLITTER, making use of Unicode 13's sextant glyphs. `notcurses_lex_blitter()` now recognizes `sexblitter`. diff --git a/tools/version.h.in b/tools/version.h.in index 6aeb9f46c..0c28019a0 100644 --- a/tools/version.h.in +++ b/tools/version.h.in @@ -7,10 +7,11 @@ #define NOTCURSES_VERNUM_PATCH @notcurses_VERSION_PATCH@ #define NOTCURSES_VERNUM_TWEAK @notcurses_VERSION_TWEAK@ -#define NOTCURSES_VERNUM_ORDERED \ - ((NOTCURSES_VERNUM_MAJOR << 16u) + \ - (NOTCURSES_VERNUM_MINOR << 8u) + \ - (NOTCURSES_VERNUM_PATCH)) +#define NOTCURSES_VERSION_COMPARABLE(major, minor, patch) \ + (((major) << 16u) + ((minor) << 8u) + (patch)) + +#define NOTCURSES_VERNUM_ORDERED NOTCURSES_VERSION_COMPARABLE( \ + NOTCURSES_VERNUM_MAJOR, NOTCURSES_VERNUM_MINOR, NOTCURSES_VERNUM_PATCH) #define NOTCURSES_VERSION_MAJOR "@notcurses_VERSION_MAJOR@" #define NOTCURSES_VERSION_MINOR "@notcurses_VERSION_MINOR@"