Mail Archives: djgpp/1996/07/08/09:15:06
Alaric B. Williams wrote:
>
> Say, does anyone have any idea why:
>
> ffblk _ffblk;
> int result = findfirst("*.PPM",&_ffblk,FA_ARCH | FA_RDONLY |
> FA_HIDDEN | FA_SYSTEM);
> while(!result) {
> colours(_ffblk.ff_name);
> result = findnext(&_ffblk);
> ah.sprites++;
> }
> and
> find_t _ffblk;
> wh.length = 0;
> int result = _dos_findfirst("*.RES",_A_ARCH | _A_RDONLY,&_ffblk);
> while(!result) {
> puts(_ffblk.name);
> wh.length++;
> result = _dos_findnext(&_ffblk);
> }
> /BOTH/ give filenames with the first two characters missing???
<snip>
> The same code worked fine in DJGPP v1.x, but fails in the latest v2
> from SimTel...
>
> Thanx,
> Alaric B. Williams Internet : alaric AT abwillms DOT demon DOT co DOT uk
> <A HREF="http://www.hardcafe.co.uk/Alaric/">http://www.hardcafe.co.uk/Alaric/</A>
This is a long known bug in gcc 2.7.2. The C++ part of the compiler doesn't pack the
ffblk correctly. The C part works fine. Please edit the header file with the
ffblk and insert a
#pragma pack(1)
struct...
#pragma pack()
pragma pack pair around the struct.
Enjoy!
Joern
..
..
..
..
..
..
..
..
..
..
- Raw text -