Looking for some random-functions ... and maybe a bug report_(re)

Mon, 22 Sep 1997 14:44:40 +0200



Kevin A. Foss wrote:

> >{$IFDEF __DJGPP__}{$DEFINE DOS}{$ENDIF}
> >{$IFDEF __EMX__}{$DEFINE DOS}{$ENDIF}
>
> IMHO, this isn't a good way to do things in a portable unit.  Remember
> that the EMX version of GCC also works under OS/2.   Trying to DOS-ish
> things won't go over well if you only check for __EMX__.

I assumed such interrupts would be eumlated, but if not...

> Unfortunately, I know of no easy way to test for what operating system
> EMX is currently using.

Neither do I, that's the problem...

> >{$W-}
> >FUNCTION __DPMI_Simulate_Real_Mode_Interrupt(Vector:Integer;VAR Regs:TDPMIRegs):Integer; C;
> >{$W+}
>
> Does this even work with the DOS version of EMX?

Don't know. I've only got Linux and DJGPP.

> It looks like some
> type of DPMI call but EMX doesn't DPMI without the RSX extender.

Oh! I didn't know that.

Well anyway, it's not a serious thing at all. This last section of the
units only deals with how the random number seed is initialized. If it
doesn't work on any system, one can simply do it another way. (My way
of doing it exactly the same way as BP under Dos was just a kind of fun,
anyway; I don't think anyone would ever care.) If OS/2 has something like
GetPID, one can use this or other "pseudo-random" data (such as the system
time, received by other means than a Dos interrupt, but I don't know how).

> [C:\kevin\pascal]gpc -c rand.pas
> gpc: Internal compiler error: program gpc1 got fatal signal 11
> (I also get an OS/2 popup with a generic 3171 error -- this "program...
> can not continue.")
>
> I take it the compiler should reply with some error and not a fatal
> signal?  Or this one of the things that has been fixed in the later
> betas?

Probably. I got such errors a lot with betas from Jul/Aug when compiling
units. The latest developer version (to be published soon) doesn't seem
to cause such problems any more.

Oh yes, and there was a bug that caused a serious crash of the DJGPP GPC
with the type declarations in the random unit. Perhaps that was in the
version you're using, I don't remember exactly. Again, this is fixed in
the current GPC.

--
Frank Heckenbach, Erlangen, Germany
heckenb@mi.uni-erlangen.de
http://home.pages.de/~fjf/links.htm


Frank Heckenbach (heckenb@mi.uni-erlangen.de)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es