From: Waldemar Schultz Newsgroups: comp.os.msdos.djgpp Subject: MINGW vs DJGPP Date: Tue, 17 Apr 2001 16:29:25 +0200 Organization: [posted via] Leibniz-Rechenzentrum, Muenchen (Germany) Lines: 62 Message-ID: <3ADC5345.8D25094F@ma.tum.de> References: <9bhhqg$bfo$1 AT talia DOT mad DOT ttd DOT net> NNTP-Posting-Host: pcritter14.mathematik.tu-muenchen.de Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: wsc10.lrz-muenchen.de 987517753 5526 131.159.68.151 (17 Apr 2001 14:29:13 GMT) X-Complaints-To: news AT lrz-muenchen DOT de NNTP-Posting-Date: 17 Apr 2001 14:29:13 GMT X-Mailer: Mozilla 4.75 [de] (Win98; U) X-Accept-Language: de,en-US To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I'm trying to port a DJGPP C-Program to MINGW32. Problem: reading binary data into structures. example: typedef unsigned long ulg; typedef unsigned int uint; typedef double real; typedef float sreal; typedef long double lreal; typedef unsigned char byte; typedef signed char sbyte; typedef signed char bool; typedef struct vp { short vpi; /*Variablen-Index*/ char kenn; /*Kennung 'P'aram | 'K'onst | 'H'? */ short bs; /*zugeordnet zu Modul 'bs'*/ short opt; /*fuer BS-Option*/ short nr; /*als 'nr'*/ short me; /*Masseinheit*/ char * nam; /*Name*/ char * dsc; /*Beschreibung*/ real min; /*Minimalwert*/ real dft; /*default*/ real max; /*Maximalwert*/ ulg src; /*Herkunft aus Modul (bitcodiert)*/ ulg dst; /*Verwendung in Modul (bitcodiert)*/ ulg typ; /*findet Anwendung bei Knotentyp 'typ' (bitcodiert)*/ ulg kmb; /*findet Anwendung bei Modul-Kombination 'kmb' (bitcodiert)*/ short brch; /*findet Anwendung bei Bereich 'brch' (bitcodiert)*/ short otyp; /**/ short omod; /**/ short odat; /**/ short olam; /**/ short ower; /**/ short imen; /**/ short imod; /**/ short idat; /**/ short na; /**/ /* dta -> alt */ }VP; ... if(fread(vorp[i],sizeof(struct vp),nel=1,fp)!=nel) return ERROR ... this leads to vorp[] containing garbage, because of some alignment(?) issue: printing `sizeof(struct vp)' gives me _80_ under DJGPP, but _88_ under MINGW32. Does anybody know how to force the MINGW-gcc to use the same structure alignment / data storage scheme as DJGPP_GCC does, please? -- Gruss Waldemar Schultz. Technische Universität München, Zentrum Mathematik M1, D 80290 München Tel: +49 (0)89 2892 8226 FAX: +49 (0)89 2892 8228