add CALC2_COMPAT and version.h

Moved calc version definition from version.c to version.h.
Added CALC2_COMPAT, that when defined attempts to maintain calc
version 2 compatibility.  When MAJOR_VER <= 2, CALC2_COMPAT is
defined.  This is anticipation for a future calc version 3 code.
This commit is contained in:
Landon Curt Noll
2023-08-19 17:32:42 -07:00
parent a7597cdf6f
commit 91c0c99a2c
6 changed files with 285 additions and 49 deletions

View File

@@ -34,6 +34,7 @@
# include <string.h>
#endif
#include "version.h"
#if defined(CALC_VER)
# include <stdlib.h>
# include <unistd.h>
@@ -51,42 +52,6 @@ static char *program;
#include "banned.h" /* include after system header <> includes */
/*
* MAJOR_VER
*
* The MAJOR_VER remains at 2. That are concepts for version 3 calc,
* but that is a long way off. One of the main reasons why MAJOR_VER
* might incremented is if fundamental calc data objects (such as when ZVALUE
* or NUMBER or COMPLEX need to change) that would cause an incompatibility
* with existing hardware accelerators that are using fundamental calc data objects.
*
* MINOR_VER
*
* The MINOR_VER changes when there are incompatible changes to the calc library
* or calc custom library. The MINOR_VER might change if we need to make a major
* change to the math engine. For example, when the way 0^x was evaluated, we
* changed MINOR_VER from 13 to 14.
*
* MAJOR_PATCH
*
* The MAJOR_PATCH changes when there is an update to the calc library
* or calc custom library. For example, the MAJOR_PATCH might increment when there
* are new builtin functions available, or when there is a change to how existing
* builtin functions process arguments.
*
* MINOR_PATCH
*
* The MINOR_PATCH changes whenever there is any change in the calc release.
* For example, when the documentation changes, the MINOR_PATCH will increment.
* Moreover, when we are working towards a new production release,
* bug fix and improvement updates will cause MINOR_PATCH to increment.
*/
#define MAJOR_VER 2 /* major library version */
#define MINOR_VER 14 /* minor library version */
#define MAJOR_PATCH 3 /* major software version level */
#define MINOR_PATCH 5 /* minor software version level */
/*
* calc version constants
*/