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,64a6ad02ec510120 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-01 22:02:16 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn13feed!worldnet.att.net!204.127.198.204!attbi_feed4!attbi.com!rwcrnsc51.ops.asp.att.net.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Interfacing to C library... References: X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.13.56 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc51.ops.asp.att.net 1036216935 12.234.13.56 (Sat, 02 Nov 2002 06:02:15 GMT) NNTP-Posting-Date: Sat, 02 Nov 2002 06:02:15 GMT Organization: AT&T Broadband Date: Sat, 02 Nov 2002 06:02:15 GMT Xref: archiver1.google.com comp.lang.ada:30306 Date: 2002-11-02T06:02:15+00:00 List-Id: > struct foo { ... } > long pass_by_value (struct foo); Most of the time structs are passed by copy they are probably small (it being usually unreasonable to copy large objects). So an Unchecked_Conversion to Interfaces.C.Int, or Interfaces.C.Double, will do what you want. If not, and you are using Gnat, look up Pragma C_Pass_By_Copy in the gnat_rm.html document. For other Ada compilers, look in their docs.