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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,95d036084078aa89 X-Google-Attributes: gid103376,public From: fjh@cs.mu.oz.au (Fergus Henderson) Subject: Re: Compiling, binding, and linking an Ada prog. interfaced with C Date: 1998/07/29 Message-ID: <6pn02g$2ue$1@mulga.cs.mu.OZ.AU>#1/1 X-Deja-AN: 375961788 References: <1998072706002200.CAA02664@ladder01.news.aol.com> <35BD28BF.A5B@atlas.otago.ac.nz> Organization: Computer Science, The University of Melbourne Newsgroups: comp.lang.ada Date: 1998-07-29T00:00:00+00:00 List-Id: "Dr Richard A. O'Keefe" writes: >You4818 wrote: >> I am trying to interface an Ada program to C, such that the main >> program is in Ada and some entities are being imported from a >> C header file (e.g. constant variables). >> >> For example, consider the following >> >> C_File.h : #define Max_Val 100 > >I see no constant variable here. All I see is a macro. This is true. It's a constant value, implemented using a macro, rather than a constant variable. The original poster's terminology was not quite right. Nevertheless, it is still an "entity", and it is still something which it makes sense to import into another language. This is one respect in which Ada's otherwise excellent C interface features are not quite as good as those of Mercury or ISE Eiffel, which both allow you to import C macros without having to write a separate C file containing glue code. -- Fergus Henderson | "I have always known that the pursuit WWW: | of excellence is a lethal habit" PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.