* GNAT equivalent for Green Hills functionality
@ 2002-04-25 14:38 Michael P. Card
2002-04-25 14:53 ` Jean-Marc Bourguet
0 siblings, 1 reply; 2+ messages in thread
From: Michael P. Card @ 2002-04-25 14:38 UTC (permalink / raw)
Hello CLA-
In the past I have developed heterogenous programs comprised of Ada and
C++ code linked together. These projects involved the use of gcc for the
C++ and Green Hills AdaMULTI for the Ada code. For cases where C++ was
the "main" program, Gren Hills provided 3 C functions that made the
integration much easier:
rts_task_init()- registers a C thread with Ada run-time so that after
this call Ada will see it as if it were an Ada task. This way the C code
can call Ada code that might make a protected object call, task
rendezvous etc and teh C thread will be suspended and restarted properly
just as if it were an Ada task
adainit()- kicks off all Ada elaboration, initialization etc just as
would happen at program start if Ada were the "main"
adafinal()- finalizes all objects just as would occur at end-of-program
if Ada were the "main"
Does GNAT provide similar capability for cases where C++ is the "main"?
Note that it may be that we will be using a C++ compiler other than gcc,
I have heard that Ada/C++ integration is easy with GNAT if the C++ code
is compiled with gcc.
- Mike
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: GNAT equivalent for Green Hills functionality
2002-04-25 14:38 GNAT equivalent for Green Hills functionality Michael P. Card
@ 2002-04-25 14:53 ` Jean-Marc Bourguet
0 siblings, 0 replies; 2+ messages in thread
From: Jean-Marc Bourguet @ 2002-04-25 14:53 UTC (permalink / raw)
michael.p.card@lmco.com (Michael P. Card) writes:
[Gren Hills provided 3 C functions]
> rts_task_init()- registers a C thread with Ada run-time so that after
> this call Ada will see it as if it were an Ada task. This way the C code
> can call Ada code that might make a protected object call, task
> rendezvous etc and teh C thread will be suspended and restarted properly
> just as if it were an Ada task
I seem to remember that there is something similar with gnat, but I've
not used it.
> adainit()- kicks off all Ada elaboration, initialization etc just as
> would happen at program start if Ada were the "main"
>
> adafinal()- finalizes all objects just as would occur at end-of-program
> if Ada were the "main"
These are defined in the standard, and I've used them with gnat.
> Does GNAT provide similar capability for cases where C++ is the "main"?
> Note that it may be that we will be using a C++ compiler other than gcc,
> I have heard that Ada/C++ integration is easy with GNAT if the C++ code
> is compiled with gcc.
From what I've understood, Ada/C++ integration is easy with GNAT,
whatever compiler is used for C++. It comes with the interface set up
for g++ but you can describe your C++ compiler. And obviously if you
are interfacing with C calling convention (using only extern "C" C++
functions), then the way of doing it is standard.
I suggest to contact ACT, your email address makes me doubt that you
should be using GNAT without support and from what I get, the quality
of their support is their main selling argument.
Yours,
--
Jean-Marc
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-04-25 14:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-25 14:38 GNAT equivalent for Green Hills functionality Michael P. Card
2002-04-25 14:53 ` Jean-Marc Bourguet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox