www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/15/18:19:40

Xref: news2.mv.net comp.os.msdos.djgpp:2734
From: malcolm AT manawatu DOT gen DOT nz (Malcolm Taylor)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: dir.h problem
Date: Mon, 15 Apr 1996 09:26:15 GMT
Organization: Grafik Software
Lines: 35
Message-ID: <4kt899$njn@news.manawatu.gen.nz>
References: <199604121413 DOT KAA20749 AT delorie DOT com>
Reply-To: malcolm AT manawatu DOT gen DOT nz
NNTP-Posting-Host: malcolm.manawatu.gen.nz
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Nick Burton <nmr AT doc DOT ntu DOT ac DOT uk> wrote:

>Please I realy, realy need help with this one as an applicaltion
>I wrote for DJGPP 2.6.3 dosent work because of this error, when
>I compile it under 2.7.2, and it must now be compiled under this!

>        struct ffblk f;
>        int done = findfirst("*.tga",&f,FA_ARCH|FA_RDONLY);

This is a known bug in the gcc2.7.2 sources. When compiling with C++
structures with the packed attribute on their members don't get packed
properly. One solution is to compile the code that requires findfirst
and findnext in C (I have used this soln). However a better solution
is to edit the dir.h file (I think, the one with struct ffblk) and
add:

#ifdef __cplusplus
#pragma pack(1)
#endif

struct ffblk ...
    ...

#ifdef __cplusplus
#pragma pack(0)
#endif

Which will fix the problem (if there is an error in the above then
feel free to correct me :)
Whenever gcc 2.7.3 comes out this problem will no longer exist.

Malcolm



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019