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 7, 2025
1 parent cf65f2e commit 15f26db
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/Zydis/Zydis.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ extern "C" {
/**
* A macro that defines the zydis version.
*/
#define ZYDIS_VERSION (ZyanU64)0x0005000000000000
#define ZYDIS_VERSION 0x0005000000000000ULL

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

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

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

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

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

Expand Down

0 comments on commit 15f26db

Please sign in to comment.