- avoid name clashing with C11 function

src/rendering/swrenderer/r_memory.cpp:78:14: error: ‘void* aligned_alloc(size_t, size_t)’ was declared ‘extern’ and later ‘static’ [-fpermissive]
This commit is contained in:
alexey.lysiuk 2019-11-23 11:17:34 +02:00
parent b7745aaa8b
commit c75233a842

View file

@ -75,7 +75,7 @@ void RenderMemory::Clear()
}
}
static void* aligned_alloc(size_t alignment, size_t size)
static void* AlignedAlloc(size_t alignment, size_t size)
{
void* ptr;
#if defined _MSC_VER
@ -93,7 +93,7 @@ static void* aligned_alloc(size_t alignment, size_t size)
return ptr;
}
static void aligned_free(void* ptr)
static void AlignedFree(void* ptr)
{
if (ptr)
{
@ -105,11 +105,11 @@ static void aligned_free(void* ptr)
}
}
RenderMemory::MemoryBlock::MemoryBlock() : Data(static_cast<uint8_t*>(aligned_alloc(16, BlockSize))), Position(0)
RenderMemory::MemoryBlock::MemoryBlock() : Data(static_cast<uint8_t*>(AlignedAlloc(16, BlockSize))), Position(0)
{
}
RenderMemory::MemoryBlock::~MemoryBlock()
{
aligned_free(Data);
AlignedFree(Data);
}