diff options
author | Ladislav Zezula <zezula@volny.cz> | 2021-05-17 15:24:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-17 15:24:11 +0200 |
commit | 18e92b75928995dbd93be9a5774a62aa19042614 (patch) | |
tree | 75f88398ff1014d6e5cef83524dac00332e680f2 /src/StormCommon.h | |
parent | a3332c7c9bc36f13aace6543ebc719f833882dfc (diff) | |
parent | 26b2f0e8b6e711aa05b67bf2466a715a063b2517 (diff) |
Merge pull request #225 from ladislav-zezula/AlignmentAware
Alignment aware
Diffstat (limited to 'src/StormCommon.h')
-rw-r--r-- | src/StormCommon.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/StormCommon.h b/src/StormCommon.h index ff14a32..e9187f9 100644 --- a/src/StormCommon.h +++ b/src/StormCommon.h @@ -67,8 +67,11 @@ #define STORMLIB_MAX(a, b) ((a > b) ? a : b)
#define STORMLIB_UNUSED(p) ((void)(p))
+// Checks for data pointers aligned to 4-byte boundary
+#define STORMLIB_DWORD_ALIGNED(ptr) (((size_t)(ptr) & 0x03) == 0)
+
// Macro for building 64-bit file offset from two 32-bit
-#define MAKE_OFFSET64(hi, lo) (((ULONGLONG)hi << 32) | (ULONGLONG)lo)
+#define MAKE_OFFSET64(hi, lo) (((ULONGLONG)hi << 32) | (ULONGLONG)lo)
//-----------------------------------------------------------------------------
// MTYPE definition - specifies what kind of MPQ is the map type
|