gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] CAST to/from procedure type


From: Gaius Mulley
Subject: Re: [Gm2] CAST to/from procedure type
Date: Sat, 04 Apr 2009 16:18:32 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

SiTex Graphics <address@hidden> writes:

> Hi Gaius,
>
> I asked how to cast an address to a procedure type last year. Would it
> be difficult to support the CAST() syntax?
>
> Thanks,
> Scott
>
>
> I have a wrapper for dlsym() that's used to obtain functions from
> user-written plugins.  The wrapper looks like:
>
> PROCEDURE GetProcAdr ( hmod : ADDRESS; procname :ARRAY OF CHAR ) :PROC;
>
> and typical usage is:
>
> VAR initproc : INITPROC;
>
> ...
> initproc:=CAST(INITPROC,GetProcAdr(mod,p^.initname));
> IF CAST(ADDRESS,initproc)=NIL THEN (* failed *)
>
> This compiles under XDS and Stonybrook.  gm2 is not happy with the CAST.
>

Hi Scott,

sorry for not fixing this sooner - yes it should be very easy to
support.  Slightly surprised it fails - will fix it soon!  Incidentally
I'm currently fixing the cyclic array -> pointer -> array declaration
bug you emailed me with 2..3 weeks ago.  I've rewritten
M2GCCDeclare.mod in the process and I hope to commit the changes in the
next couple of days,

regards,
Gaius




reply via email to

[Prev in Thread] Current Thread [Next in Thread]