TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender: "Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
Date: Tue, 20 Feb 2001 16:37:09 -0800
Reply-To: Tom Moran <[log in to unmask]>
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii
Organization: Decision Aids
From: Tom Moran <[log in to unmask]>
Parts/Attachments: text/plain (13 lines)
> Does anyone know how to call an Ada 95 function by address
> (if possible)? I
> know you can
> in C/C++.
    type Trig_Spec is access function(Theta : Radians) return Float;
    pragma Convention(StdCall, Trig_Spec); -- StdCall or whatever
    A_Function : Trig_Spec;
    A_Function := -- get a pointer from C program, "access
xyz",                                       --
System.Address_To_Access_Conversions, or whatever
    Y := A_Function(X);