www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/09/29/17:34:21

Message-ID: <3BB63CCF.F1B365E7@worldnet.att.net>
From: Les Cargill <lcargill AT worldnet DOT att DOT net>
X-Mailer: Mozilla 4.72 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: what's #include <alloc.h>?
References: <o1at7.26464$2H2 DOT 2100965 AT e3500-atl1 DOT usenetserver DOT com> <3BB5378E DOT 8E596BC8 AT worldnet DOT att DOT net> <3BB56F83 DOT 5DD6EEAB AT yahoo DOT com> <3BB5FAAD DOT AB8B09C1 AT worldnet DOT att DOT net> <fLot7.27530$2H2 DOT 2208945 AT e3500-atl1 DOT usenetserver DOT com>
Lines: 116
Date: Sat, 29 Sep 2001 21:25:17 GMT
NNTP-Posting-Host: 12.86.208.75
X-Complaints-To: abuse AT worldnet DOT att DOT net
X-Trace: bgtnsc04-news.ops.worldnet.att.net 1001798717 12.86.208.75 (Sat, 29 Sep 2001 21:25:17 GMT)
NNTP-Posting-Date: Sat, 29 Sep 2001 21:25:17 GMT
Organization: AT&T Worldnet
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com


cwg wrote:
> 
> Alright you acronymizers, GREP?

General Regular Expression Parser, an old timey Unix utility which 
allows for pattern searching throug directories full of files. 

> Have no idea yet where to relocate the 'C Standard', 

Boy, me too. I still do significant 'C' work, but the includes are GNU
specific. 

> done been eight years
> since I last coded, now I find myself in a bit of a crunch because I needs
> to create a com port driven version of a SB recording/playback program I
> found out there, mainly,
> S B 1 6   S o u n d  Written by Ethan Brodsky
> Copyright 1995 by Ethan Brodsky.  All rights reserved.
> 
> Did locate a disk which contained Borland C/C++, in ALLOC.H:
> void  _FAR *_Cdecl calloc(size_t __nitems, size_t __size);
> void        _Cdecl free(void _FAR *__block);
> void  _FAR *_Cdecl malloc(size_t __size);
> void  _FAR *_Cdecl realloc(void _FAR *__block, size_t __size);
> 
> So, in the below header, I comment out the unused include;
> #include <alloc.h>
> #include <conio.h>
> #include <dos.h>
> #include <mem.h>
> #include <stdlib.h>
> 

I would be very sure to use *only* DJGPP specific include files. 
It's not like Borland where they're code-neutral - the DJGPP ones
very much affect compiler output. 

> using Rhide, Make, and I get this:
> sbio.c(78) Error: parse error before `*'
> sbio.c(78) Error: `interrupt' declared as function returning a function
> sbio.c(78) Error: function `interrupt' is initialized like a variable
> sbio.c(247) Error: parse error before `inthandler'
> 
> (78) void interrupt (*oldintvector)() = NULL;

"interrupt" is, I believe, a Borland specific keyword extension to the 'C' 
language. The compiler generated a little bit of extra code to
mask/unmask interrupts and PIC handling. I'd have to look back at
"Advanced MSDOS" to be sure, and that predates DPMI.  

Check the manuals for how to do interrupt handlers in DJGPP. I just got here,
so I don't really know. When I have done interrupt processing in the last 
seven years, it was throgh an RTOS, which had it's own paradigm. 

http://www.delorie.com/djgpp/doc/
and
http://www.ee.nmt.edu/~rison/ee352_spr00/supp/000128/timer_int.html

I just goodled up "DJGPP interrupt". 

Also, when I did serial port stuff on PeeCees last, it was through the Greenleaf 
serial port libraries. 

> 
> "Les Cargill" <lcargill AT worldnet DOT att DOT net> wrote in message
> news:3BB5FAAD DOT AB8B09C1 AT worldnet DOT att DOT net...
> > CBFalconer wrote:
> > > Les Cargill wrote:
> > > > cwg wrote:
> > > > > it's in the turbo-c project i'm working on.
> > > > > what would be the djgpp replacement?
> > > > Possibly <malloc.h>?  grep is our friend...
> > > No, it is in <stdlib.h>.  The C standard is your friend.
> > If he was interested in the 'C' standard, he would have looked there
> > first.
> >
> > Just to be persnickety, he asked about <alloh.h>. There are things
> > declared there other than malloc(). There is probably no direct
> > <alloc.h> replacement in GNU. I don't know. Never had to ask the
> > question before.
> >
> > I also noticed, in the Borland <malloc.h> , this:
> > File MALLOC.H:
> > /*  malloc.h
> > #if !defined(__MALLOC_H)
> > #define __MALLOC_H
> > #if !defined(__ALLOC_H)
> > #include <alloc.h>
> >
> >
> > Borland's <alloc.h> is sorta disjoint from
> > the GNU usual stuff. malloc() does get prototyped in both
> > places in Borland. There are other malloc() variants, and
> > more of them appear in <malloc.h> than in <stdlib.h> . I always
> > disliked that - it should appear in one place.
> >
> > In general, my preferred method of resolving includes when porting
> > to an unfmailiar environment is to remove the offending include,
> > making sure -Wall(or equivalent) is on, and making a list of all
> > the prototype errors.
> >
> > grep for those, then massage until warnings disappear.
> >
> >
> > > --
> > > Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT XXXXworldnet DOT att DOT net)
> > >    (Remove "XXXX" from reply address. yahoo works unmodified)
> > >    mailto:uce AT ftc DOT gov  (for spambots to harvest)
> >
> > --
> > http://home.att.net/~lcargill

--
http://home.att.net/~lcargill

- Raw text -


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