Skip to content

Commit

Permalink
Remove type cast in VERSION macros
Browse files Browse the repository at this point in the history
Allows preprocesser #if statements to use version macros.
  • Loading branch information
mochaaP committed Jan 9, 2025
1 parent b293f4a commit c345fe7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/Zycore/Zycore.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ extern "C" {
/**
* A macro that defines the zycore version.
*/
#define ZYCORE_VERSION (ZyanU64)0x0001000500000000
#define ZYCORE_VERSION 0x0001000500000000ULL

/* ---------------------------------------------------------------------------------------------- */
/* Helper macros */
Expand All @@ -62,28 +62,28 @@ extern "C" {
*
* @param version The zycore version value
*/
#define ZYCORE_VERSION_MAJOR(version) (ZyanU16)((version & 0xFFFF000000000000) >> 48)
#define ZYCORE_VERSION_MAJOR(version) ((version & 0xFFFF000000000000) >> 48)

/**
* Extracts the minor-part of the zycore version.
*
* @param version The zycore version value
*/
#define ZYCORE_VERSION_MINOR(version) (ZyanU16)((version & 0x0000FFFF00000000) >> 32)
#define ZYCORE_VERSION_MINOR(version) ((version & 0x0000FFFF00000000) >> 32)

/**
* Extracts the patch-part of the zycore version.
*
* @param version The zycore version value
*/
#define ZYCORE_VERSION_PATCH(version) (ZyanU16)((version & 0x00000000FFFF0000) >> 16)
#define ZYCORE_VERSION_PATCH(version) ((version & 0x00000000FFFF0000) >> 16)

/**
* Extracts the build-part of the zycore version.
*
* @param version The zycore version value
*/
#define ZYCORE_VERSION_BUILD(version) (ZyanU16)(version & 0x000000000000FFFF)
#define ZYCORE_VERSION_BUILD(version) (version & 0x000000000000FFFF)

/* ---------------------------------------------------------------------------------------------- */

Expand Down

0 comments on commit c345fe7

Please sign in to comment.