Previous mail
Next mail
Unformatted/full headers
Overview 10 days
Subject
Date
Thread
Author
From: Gale Paeper
Subject: Ada calling Pascal (not working)
Date: 18 Jan 2006, 21:54:06
lanceboyle@qwest.net wrote: [snip] > > I have not been able to solve the problem when calling _p_initialize > from Ada. I still get the Ada compiler telling me, "too many > arguments in call." I suspect that I might be passing the wrong > _kinds_ of arguments but not the wrong number. Does GNAT support the Interfaces.C package as described in the Ada 95 LRM "B.3 Interfacing with C" <http://www.adahome.com/LRM/95/rm95html/rm9x-B-03.html>? If GNAT does support it, that seems to me to be the easiest way to get your Pascal interfacing going. It looks like all the necessary C types and conversions going to and from C are pre-canned for relatively easy Ada usage. (At the bottom of the reference web page, there's also an example of interfacing to C's "strcpy" function which might give a few tips on getting p_initialize working.) > procedure p_initialize; > pragma Import(Convention => C, Entity => p_initialize, > External_Name => "_p_initialize"); > I think you need to declare p_initialize with Ada to C equivalents of the four parameters for p_initialize that Adriaan has already discussed. Ada isn't assembly language you know. Ada was designed so that "shot your foot off" errors like passing more (or fewer) parameters to external routines would be caught at compile time instead of at "really embarrassing" times like aircraft in flight. With that declaration, you've told the compiler p_initialize doesn't take any parameters. So, the compiler isn't going to let you "shot your foot off" by passing parameters to an external routine that you've declared takes no parameters. Gale Paeper gpaeper@empirenet.com
Previous mail
Next mail
Unformatted/full headers
Overview 10 days
Subject
Date
Thread
Author
| Author | Subject | Date |
|---|---|---|
| lanceboyle@qwest.net | Ada calling Pascal (working) : (was Ada calling Pascal (not working)) | 2 Feb 2006, 23:54:38 |
| Author | Subject | Date |
|---|---|---|
| lanceboyle@qwest.net | Ada calling Pascal (not working) | 18 Jan 2006, 01:53:21 |
Note: This page contains information that does not originate from the owner of this web site, but from the authors of the mails archived. The owner of this web site is not responsible for the content of such information. Any use of that infomation requires the consent of the respective author.
Where WWW addresses (URLs) in the mails archived are marked as hyperlinks, this is only for the comfort of the reader. The content of the web pages linked to like this does not necessarily reflect the opinion of the owner of this web site or of the authors of the mails archived. The owner of this web site is not responsible for the content of such web pages. Those pages are explicitly not to be considered as part of the content of this page, but merely as references.
This page was created by Crystal 0.999 (Linux 2.4.27/i686).