diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2015-04-04 16:21:52 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2015-04-04 16:21:52 +0000 |
| commit | 36385a4b56975756a1ceb55ce29852f4d6fdb574 (patch) | |
| tree | a8dd0f69fb11cb5a1f96009ed7712378a8922c9e | |
| parent | 94ddbc199577885bd998d1f9e95692da391fc907 (diff) | |
Add Fl::abi_check() method to test if the runtime ABI version is correct.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10674 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | FL/Fl.H | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -268,6 +268,32 @@ public: // ABI version number static int abi_version(); + /* + Returns whether the runtime library ABI version is correct. + + This enables you to check the ABI version of the linked FLTK + library at runtime. + + Returns 1 (true) if the compiled ABI version (in the header files) + and the linked library ABI version (used at runtime) are the same, + 0 (false) otherwise. + + Argument \p val can be used to query a particular library ABI version. + Use for instance 10303 to query if the runtime library is compatible + with FLTK ABI version 1.3.3. This is rarely useful. + + The default \val argument is FL_ABI_VERSION, which checks the version + defined at configure time (i.e. in the header files at program + compilation time) against the linked library version used at runtime. + This is particularly useful if you linked with a shared object library, + but it also concerns static linking. + + \see Fl::abi_version() + */ + static inline int abi_check(const int val = FL_ABI_VERSION) { + return val == abi_version(); + } + // argument parsers: static int arg(int argc, char **argv, int& i); static int args(int argc, char **argv, int& i, Fl_Args_Handler cb = 0); |
