www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/25/07:11:09

Date: Wed, 25 Aug 1999 09:29:11 +0200
From: Laszlo Molnar <laszlo DOT molnar AT eth DOT ericsson DOT se>
To: djgpp AT delorie DOT com
Subject: Re: DJGPP (gcc) and Borland IDE
Message-ID: <19990825092911.I14930@crater.eth.ericsson.se>
References: <37C15F25 DOT 2003401A AT inti DOT gov DOT ar>
Mime-Version: 1.0
X-Mailer: Mutt 0.95.6i
In-Reply-To: <37C15F25.2003401A@inti.gov.ar>; from salvador on Mon, Aug 23, 1999 at 11:48:05AM -0300
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> > 2. Need to configure Borland IDE to parse output from GCC (like in
> > Codewright) *OR* use a perl script to adapt GCC output to Borland
> > format. I do not think that would be a problem but sincerly haven't
> > tried it. Anyone did?

Ok, here is what I used 5 years ago. It's full of bugs. It worked for
me, don't ask me how :-)

Laszlo

---cut here with a very sharp knife---

/*
//                               GCC2MSG V1.0
//                                  ML1050
//                                   1994
*/

/*
//              GNU C Message to Borland C 3.1 Editor Message
//
//                       GNU Transfer Command line:
// -c -x c $EDNAME -o $OUTNAME $SAVE CUR $MEM(640K) $CAP MSG(GCC2MSG) $NOSWAP
//
//         OPTIONS/MAKE/After Compiling = Stop ( Don't run TLINK! )
*/

#include <stdio.h>
#include <stdlib.h>
#include <io.h>
#include <fcntl.h>
#include <string.h>

char header [] = "BI#PIP#OK";
char separ  [] = { 0,1,255,255,1,0 };
char end    [] = { 0,0x7f };

/**************************************/
void main (void)
{
    char  linein  [500];
    char  oldfile [200]="\x0\x0*";
    char  filenam [200];
    char  linenum [200];
    char  errorm  [500];
    char  *ptr;

    setmode (1,O_BINARY);
    write (1,header,9);

    while (gets (linein) != NULL)
        if (linein [strlen(linein)-1] != ':')
        {
            if ((ptr=strchr (linein,':')) != NULL && *(ptr+1)=='\\')
                *ptr=0xFF;
            sscanf (linein,"%[^:]:%[^:]:%[^\n]",filenam,linenum,errorm);
            if ((ptr=strchr (filenam,0xFF)) != NULL)
                *ptr=':';
            if (strcmp (filenam,oldfile+2))
            {
                strcpy (oldfile+2,filenam);
                write (1,oldfile,strlen (filenam)+2);
            }
            *(short*) (separ+2) = atoi (linenum);
            write (1,separ,6);
	    for (ptr=errorm; *ptr==' '; ptr++)
	        ;
	    write (1,ptr,strlen (ptr));
        }
    write (1,end,2);
    close (1);
}

- Raw text -


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