Thank you, that helps. And I have found documentation in the FPC 2.2.2 download that talks about the Xcode integration templates that handle initial project setup. I was wondering about that as well.
Ken G. Brown At 8:53 AM +0100 1/26/09, fpc-pascal-requ...@lists.freepascal.org apparently wrote: >Date: Mon, 26 Jan 2009 09:20:29 +0200 >From: Jonas Maebe <jonas.ma...@elis.ugent.be> >Subject: Re: [fpc-pascal] Calling C functions from FPC >To: FPC-Pascal users discussions <fpc-pascal@lists.freepascal.org> >Message-ID: <b0cfa4ed-a184-4cc4-b446-ccb67d9fc...@elis.ugent.be> >Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes > > >On 26 Jan 2009, at 01:24, Ken G. Brown wrote: > >> On MacOS X 10.5.6 Intel targeting 10.3.9 PPC: >> >> What are the gotchas with respect to calling C functions from FPC? > >Mark the external C functions you import in your Pascal code as >"cdecl", e.g. > >procedure cTest; cdecl; external; > >> What other issues might I have to watch out for? > >Make sure that the types in your Pascal and C code match. The easiest >is to use the ctypes unit. Then you can use the common C-types by >prefixing them with "c" (e.g., cint, clong, clonglong, cuint, culong, >culonglong, cfloat, ...). And don't try to free pointers allocated in >the C code in Pascal code and vice versa. > >Jonas _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal