TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

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

Print Reply
Tom Moran <[log in to unmask]>
Tue, 20 Feb 2001 16:37:09 -0800
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);