mirror of
https://github.com/love2d/love.git
synced 2026-08-20 12:40:20 +02:00
Fix compilation
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user