Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#9 BUG and FIX: Core does not build with GCC/Mingw

closed
nobody
None
5
2009-08-04
2007-01-13
Anonymous
No

Building package from scratch produces compiler errors:
In file included from d:/upp/out/Core/MINGW.Debug_full.Gui.Shared\$blitz.cpp:11:
d:\upp\uppsrc\Core\heap.cpp:60: error: expected `,' or `...' before "char"
d:\upp\uppsrc\Core\heap.cpp: In function `void Upp::MemorySum(int&)':
d:\upp\uppsrc\Core\heap.cpp:62: error: expected primary-expression before "char"
d:\upp\uppsrc\Core\heap.cpp:62: error: expected `;' before "char"
d:\upp\uppsrc\Core\heap.cpp:63: error: `large' undeclared (first use this function)
d:\upp\uppsrc\Core\heap.cpp:63: error: (Each undeclared identifier is reported only once for each function it appears in.)
d:\upp\uppsrc\Core\heap.cpp: At global scope:
d:\upp\uppsrc\Core\heap.cpp:168: error: `int Upp::large' used prior to declaration
d:\upp\uppsrc\Core\heap.cpp: In function `void* Upp::MemoryAlloc(size_t)':
d:\upp\uppsrc\Core\heap.cpp:589: error: `_msize' undeclared (first use this function)
d:\upp\uppsrc\Core\heap.cpp: In function `void Upp::MemoryFree(void*)':
d:\upp\uppsrc\Core\heap.cpp:611: error: `_msize' undeclared (first use this function)

I fixed this in Core/heap.cpp:

fix #1:
add malloc.h for mingw build option

#ifdef COMPILER_MSC
#include <malloc.h>
#else
#include <stdlib.h>
#include <malloc.h>
#endif

fix#2:
name clash, rename parameter "small":
void MemorySum(int& smallx, int& large)
{
smallx = sSmallKb;
large = (int) (sLarge >> 10);
}

Discussion

  • Mirek Fidler
    Mirek Fidler
    2009-08-04

    • status: open --> closed