comp.lang.ada
 help / color / mirror / Atom feed
* C code
@ 1996-06-30  0:00 Henry the mild mannered janitor
  1996-06-30  0:00 ` Robert Dewar
  1996-07-01  0:00 ` Pascal Obry
  0 siblings, 2 replies; 6+ messages in thread
From: Henry the mild mannered janitor @ 1996-06-30  0:00 UTC (permalink / raw)



Can GNAT 3.04 compile standalone C code that's independant of an .adb
file?







^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: C code
  1996-06-30  0:00 Henry the mild mannered janitor
@ 1996-06-30  0:00 ` Robert Dewar
  1996-07-01  0:00 ` Pascal Obry
  1 sibling, 0 replies; 6+ messages in thread
From: Robert Dewar @ 1996-06-30  0:00 UTC (permalink / raw)



Henry asked

"Can GNAT 3.04 compile standalone C code that's independant of an .adb
file?"


GNAT is an Ada compiler, so certainly it cannot compile C. However GNAT is
part of the multi-language compiler gcc, and one of the other front ends
(the GNU C front end) can definitely compile C. Furthermore, all
distributions of GNAT include the C front end.

So all you have to do is gcc -c xxx.c

to compile a C file (gcc knows what front end to call by looking at the
extension of the file being compiled -- although this can be overridden
with the -x switch).





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: C code
  1996-06-30  0:00 Henry the mild mannered janitor
  1996-06-30  0:00 ` Robert Dewar
@ 1996-07-01  0:00 ` Pascal Obry
  1 sibling, 0 replies; 6+ messages in thread
From: Pascal Obry @ 1996-07-01  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 938 bytes --]


Henry the mild mannered janitor <nicnac@dial.pipex.com> wrote:

>Can GNAT 3.04 compile standalone C code that's independant of an .adb
>file?

Yes.

Pascal.



--|------------------------------------------------------------
--| Pascal Obry                               Team-Ada Member |
--|                                                           |
--| EDF-DER-IPN-SID- Ing�nierie des Syst�mes d'Informations   |
--|                                                           |
--| Bureau G1-010           e-mail: pascal.obry@der.edfgdf.fr |
--| 1 Av G�n�ral de Gaulle  voice : +33-1-47.65.50.91         |
--| 92141 Clamart CEDEX     fax   : +33-1-47.65.50.07         |
--| FRANCE                                                    |
--|------------------------------------------------------------
--|
--|   http://ourworld.compuserve.com/homepages/pascal_obry
--|
--|   "The best way to travel is by means of imagination"





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: C code
@ 2003-02-07 21:48 chris.danx
  2003-02-08  4:59 ` sk
  0 siblings, 1 reply; 6+ messages in thread
From: chris.danx @ 2003-02-07 21:48 UTC (permalink / raw)


sk wrote:

 > Also, for DLLI, the "init" and "fini" are red-herrings (not
 > deliberate)
 > these are only issues for building a dynamic-library, not the loading
 > of them thru DLLI.

So all I need to do is to detect whether the library is an Ada lib or
not and if it is call Adainit upon load and adafinal upon close?

 > Hopefully this is better

I just got a wee bit of time to work on this and hadn't done anything
for a while, so I'm sorry my reply is a bit late.  Unfortunately I
killed the wrong partition trying to install Gentoo and the binding as
was became one with the ether  (killed the backup partition :( ).  I've 
almost finished rewriting it and will do some examples including some 
with GtkAda first chance I get.


Bye,
Chris




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: C code
  2003-02-07 21:48 C code chris.danx
@ 2003-02-08  4:59 ` sk
  2003-02-08 16:08   ` Robert A Duff
  0 siblings, 1 reply; 6+ messages in thread
From: sk @ 2003-02-08  4:59 UTC (permalink / raw)
  To: comp.lang.ada mail to news gateway

Hi,

 > So all I need to do is to detect whether the library is an Ada lib or
 > not and if it is call Adainit upon load and adafinal upon close?

I guess you could, but I wouldn't.

For the DLLI interface, leave it to the called library user to know
whether the library containes "adainit" and "adafinal" because it
was developed in Ada with GNAT.

For an Ada library (GNAT developed since other compilers probably
do things differently) to be useful and transparent to C callers,
then one would try to associate the "adainit" and "adafinal" to the
automatic "init" and "fini" functions. These functions are called
by the dynamic-loader when you do a "dlopen()"

In general, I would not try to put "adainit" and "adafinal" in the
dlli package, let the user worry about it.

-- 
--
-- Merge vertically for real address
--
------------------------------------
-- s n p @ t . o
--  k i e k c c m
------------------------------------




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: C code
  2003-02-08  4:59 ` sk
@ 2003-02-08 16:08   ` Robert A Duff
  0 siblings, 0 replies; 6+ messages in thread
From: Robert A Duff @ 2003-02-08 16:08 UTC (permalink / raw)


sk <sk@noname.com> writes:

> For the DLLI interface, leave it to the called library user to know
> whether the library containes "adainit" and "adafinal" because it
> was developed in Ada with GNAT.

Adainit and adafinal are standard Ada -- not GNAT specific.

- Bob



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-02-08 16:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-07 21:48 C code chris.danx
2003-02-08  4:59 ` sk
2003-02-08 16:08   ` Robert A Duff
  -- strict thread matches above, loose matches on Subject: below --
1996-06-30  0:00 Henry the mild mannered janitor
1996-06-30  0:00 ` Robert Dewar
1996-07-01  0:00 ` Pascal Obry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox