Discussion:
Submitting a gcc4.0.2 patch for winex
Matej Urbas
2005-12-19 22:23:16 UTC
Permalink
Hi

I was having problems compiling winex with gcc 4.0.2, so I've decided to
take the hard way and fix them to a point where it would compile.

I have attached a patch file containing all the necessary changes to
winex' source in order to successfully compile it with gcc 4.0.2.

Mostly, the patches convert strings like '(type*)something =' into
'*((type**)&something) ='. This was the first thing that stopped gcc
from complaining. There are some other problems too, most notably the
problem of a forward declaration of AVoption in
./dlls/quartz/ffmpeg/libavcodec/common.h.old. The forwardly declared
structure is used as the base type of an array in common.h. Gcc would
complain that using incomplete types in arrays is not allowed. So I had
to move the definition of AVoption from avcodec.h into common.h (I find
it reasonable too, since that array is extern anyhow).

I've compiled winex with such a configuration:
export CFLAGS="-march=athlonxp -mfpmath=sse -O2"
export CXXFLAGS=$CFLAGS
./configure --disable-debug --disable-trace --enable-opengl
--enable-pthreads --disable-remote-gdb --with-x

I think the configuration is a little overdone, but at least it
compiles. I've been able to run System Shock 2 with it, but the 3D
graphics were totally obscure. The walls clipped one over the other - it
was impossible to play the game... but at least it runned (and with a
high FPS too).

Here is a list of the files I've changed:
./dlls/commdlg/filedlg95.c.old
./dlls/ddraw/dsurface/dib.c.old
./dlls/dplayx/dplay.c.old
./dlls/kernel/thunk.c.old
./dlls/msvideo/msrle32/msrle32.c.old
./dlls/ole32/ifs.c.old
./dlls/ole32/proxy.c.old
./dlls/ole32/storage.c.old
./dlls/oleaut32/oaidl_p.c.old
./dlls/quartz/ffmpeg/libavcodec/common.h.old
./dlls/quartz/ffmpeg/libavcodec/avcodec.h.old
./dlls/quartz/ffmpeg/libavcodec/huffyuv.c.old
./dlls/quartz/ffmpeg/libavformat/mpeg.c.old
./dlls/rpcrt4/cproxy.c.old
./dlls/shell32/iconcache.c.old
./dlls/x11drv/executebuffer.c.old
./graphics/x11drv/dib.c.old
./loader/ne/convert.c.old
./loader/ne/module.c.old
./loader/ne/segment.c.old
./miscemu/preloader.c.old
./msdos/int21.c.old
./msdos/int2f.c.old
./objects/enhmetafile.c.old
./tools/wrc/newstruc.c.old
./windows/winproc.c.old
Changed 27 files

Hope it helps somehow - it certainly helped me to compile with gcc 4.0.2.

Bye

matej

Loading...