Skip to content

Commit

Permalink
Make macros usable in preprocessor context
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Feb 14, 2023
1 parent 8cba1a5 commit b13b0d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions EDM4hepVersion.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// necessary

/// Define a version to be used in edm4hep.
#define EDM4HEP_VERSION(major, minor, patch) (((unsigned long)(major) << 32) | ((unsigned long)(minor) << 16) | ((unsigned long)(patch)))
#define EDM4HEP_VERSION(major, minor, patch) ((UINT64_C(major) << 32) | (UINT64_C(minor) << 16) | (UINT64_C(patch)))
/// Get the major version from a preprocessor defined version
#define EDM4HEP_MAJOR_VERSION(v) (((v) & (-1UL >> 16)) >> 32)
/// Get the minor version from a preprocessor defined version
Expand All @@ -21,10 +21,10 @@
#define EDM4HEP_PATCH_VERSION(v) ((v) & (-1UL >> 48))

// Some helper constants that are populated by the cmake configure step
#define edm4hep_VERSION @edm4hep_VERSION@
#define EDM4HEP_VERSION_MAJOR @EDM4HEP_VERSION_MAJOR@
#define EDM4HEP_VERSION_MINOR @EDM4HEP_VERSION_MINOR@
#define EDM4HEP_VERSION_PATCH @EDM4HEP_VERSION_PATCH@
#define edm4hep_VERSION EDM4HEP_VERSION(EDM4HEP_VERSION_MAJOR, EDM4HEP_VERSION_MINOR, EDM4HEP_VERSION_PATCH)

/// The encoded version with which edm4hep has been built
#define EDM4HEP_BUILD_VERSION EDM4HEP_VERSION(EDM4HEP_VERSION_MAJOR, EDM4HEP_VERSION_MINOR, EDM4HEP_VERSION_PATCH)
Expand Down

0 comments on commit b13b0d6

Please sign in to comment.