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

#252 Fix compilation error in GCC 4.6.x

open
nobody
None
5
2012-09-07
2012-03-10
h3xx
No

Including <stddef.h> fixes the following compilation error that comes from the "offsetof" macro not being defined by default anymore:

g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -g -O2 -MT paging.o -MD -MP -MF .deps/paging.Tpo -c -o paging.o paging.cpp
In file included from ../../include/programs.h:28:0,
from cpu.cpp:29:
../../include/dos_inc.h: In member function 'void DOS_MCB::SetFileName(const char)':
../../include/dos_inc.h:543:78: error: expected primary-expression before ',' token
../../include/dos_inc.h:543:79: error: 'filename' was not declared in this scope
../../include/dos_inc.h:543:87: error: 'offsetof' was not declared in this scope
../../include/dos_inc.h: In member function 'void DOS_MCB::GetFileName(char
)':
../../include/dos_inc.h:544:71: error: expected primary-expression before ',' token
../../include/dos_inc.h:544:72: error: 'filename' was not declared in this scope
../../include/dos_inc.h:544:80: error: 'offsetof' was not declared in this scope
cpu.cpp: In member function 'void TaskStateSegment::Get_SSx_ESPx(Bitu, Bitu&, Bitu&)':
cpu.cpp:294:37: error: expected primary-expression before ',' token
cpu.cpp:294:38: error: 'esp0' was not declared in this scope
cpu.cpp:294:42: error: 'offsetof' was not declared in this scope
cpu.cpp:298:37: error: expected primary-expression before ',' token
cpu.cpp:298:38: error: 'sp0' was not declared in this scope
cpu.cpp:298:41: error: 'offsetof' was not declared in this scope
cpu.cpp: In function 'bool CPU_SwitchTask(Bitu, TSwitchType, Bitu)':
cpu.cpp:362:49: error: expected primary-expression before ',' token
cpu.cpp:362:50: error: 'cr3' was not declared in this scope
cpu.cpp:362:53: error: 'offsetof' was not declared in this scope
cpu.cpp:363:49: error: expected primary-expression before ',' token
cpu.cpp:363:50: error: 'eip' was not declared in this scope
cpu.cpp:364:52: error: expected primary-expression before ',' token
cpu.cpp:364:53: error: 'eflags' was not declared in this scope
cpu.cpp:365:49: error: expected primary-expression before ',' token
cpu.cpp:365:50: error: 'eax' was not declared in this scope
cpu.cpp:366:49: error: expected primary-expression before ',' token
cpu.cpp:366:50: error: 'ecx' was not declared in this scope
cpu.cpp:367:49: error: expected primary-expression before ',' token
cpu.cpp:367:50: error: 'edx' was not declared in this scope
cpu.cpp:368:49: error: expected primary-expression before ',' token
cpu.cpp:368:50: error: 'ebx' was not declared in this scope
cpu.cpp:369:49: error: expected primary-expression before ',' token
cpu.cpp:369:50: error: 'esp' was not declared in this scope

Discussion

  • h3xx
    h3xx
    2012-03-10

    dosbox-0.74_gcc4.6_compat.patch