Skip to content

Commit

Permalink
fixes for macros.
Browse files Browse the repository at this point in the history
  • Loading branch information
hariharan-devarajan committed May 20, 2024
1 parent b1bcd16 commit 5a25fff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set(LIBTOOL_REVISION 3)
set(LIBTOOL_AGE 2)

# VERSION is XYYYZZ X: Major Y Minor Z PATCH
set(GOTCHA_VERSION 100006)
set(GOTCHA_VERSION "(1, 0, 6)")


set(DEFAULT_SYMBOL_VISIBILITY hidden)
Expand Down
10 changes: 5 additions & 5 deletions cmake/gotcha_config.h.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef GOTCHA_CONFIG_HPP
#define GOTCHA_CONFIG_HPP
#ifndef GOTCHA_CONFIG_H
#define GOTCHA_CONFIG_H

#define GOTCHA_VERSION @GOTCHA_VERSION@
#define GOTCHA_GET_VERSION(MAJOR, MINOR, PATCH) MAJOR * 100000 + MINOR * 100 + PATCH
#define GOTCHA_VERSION GOTCHA_GET_VERSION @GOTCHA_VERSION@
#define GOTCHA_VERSION_MAJOR (GOTCHA_VERSION / 100000)
#define GOTCHA_VERSION_MINOR ((GOTCHA_VERSION / 100) % 1000)
#define GOTCHA_VERSION_PATCH (GOTCHA_VERSION % 100)
#define GOTCHA_GET_VERSION(MAJOR, MINOR, PATCH) MAJOR * 100000 + MINOR * 100 + PATCH

#endif /* HPC_AIO_CONFIG_H */
#endif /* GOTCHA_CONFIG_H */
1 change: 1 addition & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ Using Gotcha Version Macros
---------------------------

The source version of GOTCHA is defined by the `GOTCHA_VERSION` macro which uses the XYYYZZ format.
**Available since version 1.0.7.**
Here, X signifies the major version, Y is the minor version, and Z is the patch.
Additionally, we define `GOTCHA_VERSION_MAJOR`, `GOTCHA_VERSION_MINOR`, and `GOTCHA_VERSION_PATCH` macros for convienience.
The codes can use the macros like
Expand Down

0 comments on commit 5a25fff

Please sign in to comment.