From: Erik Verbruggen Date: Mon, 10 Dec 2012 08:56:30 +0000 (+0100) Subject: Fix compilation on posix-compliant systems. X-Git-Tag: upstream/5.2.1~669^2~659^2~730 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49108716ea5b751cacc2492da81d5556c7b00ecc;p=platform%2Fupstream%2Fqtdeclarative.git Fix compilation on posix-compliant systems. memalign is deprecated and linux-only, and malloc.h does not exist on non-glibc systems. Change-Id: I44942378b7514c2a3fb6cb5f60256bbcc8ffe370 Reviewed-by: Simon Hausmann --- diff --git a/qv4mm.cpp b/qv4mm.cpp index 60c6180..fe72551 100644 --- a/qv4mm.cpp +++ b/qv4mm.cpp @@ -37,7 +37,7 @@ #include #include -#include +#include using namespace QQmlJS::VM; @@ -127,7 +127,8 @@ MemoryManager::MMObject *MemoryManager::alloc(std::size_t size) return alloc(size - sizeof(MMInfo)); std::size_t allocSize = std::max(size, CHUNK_SIZE); - char *ptr = (char*)memalign(16, allocSize); + char *ptr = 0; + posix_memalign(reinterpret_cast(&ptr), 16, allocSize); m_d->heapChunks.append(qMakePair(ptr, allocSize)); // qDebug("Allocated new chunk of %lu bytes @ %p", allocSize, ptr);