Fix compilation

This commit is contained in:
Sasha Szpakowski
2022-12-26 22:29:50 -04:00
parent 7137c3ffb7
commit 5fe40be724
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -129,7 +129,7 @@ static ObjectKey luax_computeloveobjectkey(lua_State *L, love::Object *object)
// use more than 53 bits if their alignment is guaranteed to be more than 1. // use more than 53 bits if their alignment is guaranteed to be more than 1.
// For example an alignment requirement of 8 means we can shift the // For example an alignment requirement of 8 means we can shift the
// pointer's bits by 3. // pointer's bits by 3.
const size_t minalign = LOVE_ALIGNOF(std::max_align_t); const size_t minalign = alignof(std::max_align_t);
uintptr_t key = (uintptr_t) object; uintptr_t key = (uintptr_t) object;
if ((key & (minalign - 1)) != 0) if ((key & (minalign - 1)) != 0)
@@ -138,7 +138,7 @@ static ObjectKey luax_computeloveobjectkey(lua_State *L, love::Object *object)
"(pointer is %p but alignment should be %d)", object, minalign); "(pointer is %p but alignment should be %d)", object, minalign);
} }
static const size_t shift = (size_t) log2(LOVE_ALIGNOF(std::max_align_t)); static const size_t shift = (size_t) log2(alignof(std::max_align_t));
key >>= shift; key >>= shift;
+1 -1
View File
@@ -141,7 +141,7 @@ static uintptr_t compute_peer_key(lua_State *L, ENetPeer *peer)
// pointers that use more than 53 bits if their alignment is guaranteed to // pointers that use more than 53 bits if their alignment is guaranteed to
// be more than 1. For example an alignment requirement of 8 means we can // be more than 1. For example an alignment requirement of 8 means we can
// shift the pointer's bits by 3. // shift the pointer's bits by 3.
const size_t minalign = std::min(ENET_ALIGNOF(ENetPeer), ENET_ALIGNOF(std::max_align_t)); const size_t minalign = std::min(alignof(ENetPeer), alignof(std::max_align_t));
uintptr_t key = (uintptr_t) peer; uintptr_t key = (uintptr_t) peer;
if ((key & (minalign - 1)) != 0) if ((key & (minalign - 1)) != 0)