Skip to content
Permalink
Browse files

- 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]
  • Loading branch information
alexey-lysiuk committed Nov 23, 2019
1 parent b7745aa commit c75233a8422a44760c4ca3c693aca230cb8e8396
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/rendering/swrenderer/r_memory.cpp
@@ -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);
}

0 comments on commit c75233a

Please sign in to comment.
You can’t perform that action at this time.