From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,75a7e6db6d0634b1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-11 23:27:08 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!dispose.news.demon.net!news.demon.co.uk!demon!pogner.demon.co.uk!zap!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Compiling C and Ada sources together Date: 10 Aug 2001 05:43:21 +0100 Organization: CodeFella Message-ID: References: NNTP-Posting-Host: localhost X-NNTP-Posting-Host: pogner.demon.co.uk:158.152.70.98 X-Trace: news.demon.co.uk 997597612 nnrp-02:16252 NO-IDENT pogner.demon.co.uk:158.152.70.98 X-Complaints-To: abuse@demon.net NNTP-Posting-Date: 10 Aug 2001 04:43:21 GMT X-Newsreader: Gnus v5.7/Emacs 20.7 Xref: archiver1.google.com comp.lang.ada:11810 Date: 2001-08-10T04:43:21+00:00 List-Id: writes: > I've been working on a project where we compile C source files and > Ada sources together to produce a single binary. Most of it is > automated at this point, but for debugging reasons I need to know > how to do it by hand. A long time ago, I saw an article (I thought > it was on www.adahome.com) about how to link together sources from > each language, particularly in the case where the C program makes > calls to the ada source (the main program is in C) so the > Interfaces.C functionality is not used. If you're going to call Ada from C, you need to use pragma Export -- and it's best to be simple at this interface! (just simple types). function Foo (X : Integer) return Boolean; pragma Export (C, Foo, "package_foo"); (I'm not sure whether all compilers are clever enough to set all Interfaces.C.int'Size bits of the Boolean result before returning it!)