diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2025-05-06 19:10:00 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2025-05-06 19:25:53 +0200 |
| commit | 53491f2ca0f197a84f15cf10949f13450ce7d021 (patch) | |
| tree | 9e6f700bbc1e568eed41b74fdea066e5f0705988 /FL/Enumerations.H | |
| parent | 9ba11949ca58537c1f511e0919243ede7b86507d (diff) | |
Remove hardcoded version numbers: part 1
The goal is to change the version number for a new release only in
CMakeLists.txt. This is the first step.
Details:
- CMake/gen_config.cmake: this new file is included to generate the
header files config.h (private, root directory), and FL/fl_config.h
(public, can be installed). This file implements also ABI version
checks (removed from FL/Enumerations.H and with more checks).
Warnings are issued if the chosen ABI version is invalid.
- CMake/export.cmake: code to generate 'config.h' was moved to
CMake/gen_config.cmake.
- CMake/options.cmake: set default of FLTK_BUILD_FORMS=OFF + comments
- CMakeLists.txt: move generation of FL/fl_config.h to gen_config.cmake,
add API and ABI versions to CMake summary,
- FL/Enumerations.H: remove most of the version number details which
are now included in FL/fl_config.h. This needed also some doxygen
related changes.
- README.CMake.txt: improve docs of FL_ABI_VERSION and some more.
Reflect the new default of CMake option FLTK_BUILD_FORMS (OFF).
- documentation/Doxyfile.in: add FL/fl_config.h to file list. This
file is created in the build tree (and may be "installed").
- fl_config.h.in: add version number details that have been moved here
from Enumerations.H (used to generate FL/fl_config.h).
Diffstat (limited to 'FL/Enumerations.H')
| -rw-r--r-- | FL/Enumerations.H | 112 |
1 files changed, 12 insertions, 100 deletions
diff --git a/FL/Enumerations.H b/FL/Enumerations.H index 5bc2951aa..6674e7463 100644 --- a/FL/Enumerations.H +++ b/FL/Enumerations.H @@ -23,8 +23,10 @@ /* ****************************************************************************** - * FL_ABI_VERSION is defined by configure or CMake since FLTK 1.3.4. + * FL_ABI_VERSION is defined by CMake since FLTK 1.3.4. * It is written to FL/fl_config.h and #included here. + * Since FLTK 1.5.0 all version checks of FL_ABI_VERSION are done by CMake + * in CMake/gen_config.cmake. ****************************************************************************** * For more informations on FL_ABI_VERSION see README.abi-version.txt. ****************************************************************************** @@ -32,41 +34,16 @@ #include <FL/fl_config.h> -# include "Fl_Export.H" -# include "fl_types.h" -# include <FL/platform_types.h> // for FL_COMMAND and FL_CONTROL +#include "Fl_Export.H" +#include "fl_types.h" +#include <FL/platform_types.h> // for FL_COMMAND and FL_CONTROL -// Keep the following comment in sync with the values below for searching -// Current FLTK version: 1.5.0 +// Doxygen group 'version_numbers' is defined in file FL/fl_config.h +// which is generated by CMake from fl_config.h.in and included above. -/** \name Version Numbers - - FLTK defines some constants to help the programmer to - find out, for which FLTK version a program is compiled. - - The following constants are defined: - */ -/**@{*/ - -/** - The major release version of this FLTK library. - \see FL_VERSION - */ -#define FL_MAJOR_VERSION 1 - -/** - The minor release version for this library. - - FLTK remains mostly source-code compatible between minor version changes. - */ -#define FL_MINOR_VERSION 5 - -/** - The patch version for this library. - - FLTK remains binary compatible between patches. - */ -#define FL_PATCH_VERSION 0 +/** \addtogroup version_numbers + @{ +*/ /** The FLTK version number as a \em double. @@ -113,73 +90,8 @@ */ #define FL_API_VERSION (FL_MAJOR_VERSION*10000 + FL_MINOR_VERSION*100 + FL_PATCH_VERSION) -/** - The FLTK ABI (Application Binary Interface) version number as an \em int. - - FL_ABI_VERSION is an \em int that describes the major, minor, and patch - ABI version numbers in the same format as FL_API_VERSION. - - The ABI version number \p FL_ABI_VERSION is usually the same as the - API version \p FL_API_VERSION with the last two digits set to '00'. - - FLTK retains the ABI (Application Binary Interface) during patch - releases of the same major and minor versions. Examples: - - \verbatim - FLTK Version FL_API_VERSION FL_ABI_VERSION FL_VERSION (deprecated) - 1.3.0 10300 10300 1.0300 - 1.3.4 10304 10300 1.0304 - \endverbatim - - Version 1.2.3 is actually stored as 10203 to allow for more than 9 - minor and patch releases. - - The FL_MAJOR_VERSION, FL_MINOR_VERSION, and FL_PATCH_VERSION constants - give the integral values for the major, minor, and patch releases - respectively. - - To enable new ABI-breaking features in patch releases you can configure - FLTK to use a higher FL_ABI_VERSION. - - \see README.abi-version.txt - */ -#ifndef FL_ABI_VERSION -#define FL_ABI_VERSION (FL_MAJOR_VERSION*10000 + FL_MINOR_VERSION*100) -#endif - -/* - Check if FL_ABI_VERSION is out of allowed range; redefine if necessary. - - This is done to prevent users from defining an illegal ABI version. - - Rule: FL_MAJOR_VERSION * 10000 + FL_MINOR_VERSION * 100 - <= FL_ABI_VERSION <= FL_API_VERSION + 1. - - Since FLTK 1.4.2+ (Git commits after release 1.4.2) FL_ABI_VERSION is - allowed to be one higher than FL_API_VERSION so ABI changes in Git - targeted at the *next* release (e.g. 1.4.3) can be used. - - Example: Commits after release FLTK 1.4.2 (before release 1.4.3): - - 10400 <= FL_ABI_VERSION <= 10403 - - Note: configure + CMake can be used to define FL_ABI_VERSION, but they - do not check validity. This is done here. -*/ - -#if FL_ABI_VERSION < FL_MAJOR_VERSION*10000 + FL_MINOR_VERSION*100 - -# undef FL_ABI_VERSION -# define FL_ABI_VERSION (FL_MAJOR_VERSION*10000 + FL_MINOR_VERSION*100) - -#elif FL_ABI_VERSION > FL_API_VERSION + 1 - -# undef FL_ABI_VERSION -# define FL_ABI_VERSION FL_API_VERSION + 1 - -#endif -/**@}*/ // group: Version Numbers +/** @} */ // end of group 'version_numbers' /** Every time a user moves the mouse pointer, clicks a button, |
