Re: [fpc-pascal] Calling C functions from FPC

2009-01-26 Thread Ken G. Brown
wrote: >Date: Mon, 26 Jan 2009 09:20:29 +0200 >From: Jonas Maebe >Subject: Re: [fpc-pascal] Calling C functions from FPC >To: FPC-Pascal users discussions >Message-ID: >Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes > > >On 26 Jan 2009, at 01:24,

Re: [fpc-pascal] Calling C functions from FPC

2009-01-26 Thread Jonas Maebe
On 26 Jan 2009, at 11:44, dmitry boyarintsev wrote: huh?!! well thanks! because i always thought that 'mwpascal' is the same as 'fastcall' (register), except for 'const' parameters. On non-i386, all calling conventions are identical (to the standard calling convention defined in the ABI) ex

Re: [fpc-pascal] Calling C functions from FPC

2009-01-26 Thread dmitry boyarintsev
huh?!! well thanks! because i always thought that 'mwpascal' is the same as 'fastcall' (register), except for 'const' parameters. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Calling C functions from FPC

2009-01-26 Thread Jonas Maebe
On 26 Jan 2009, at 11:22, dmitry boyarintsev wrote: procedure cTest; cdecl; external; it's true for unix functions, but Carbon functions are using mwpascal convention, right? mwpascal is the same as cdecl, except that it always passes "const" parameters that are record types by reference (

Re: [fpc-pascal] Calling C functions from FPC

2009-01-26 Thread dmitry boyarintsev
> procedure cTest; cdecl; external; it's true for unix functions, but Carbon functions are using mwpascal convention, right? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Calling C functions from FPC

2009-01-25 Thread Jonas Maebe
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 issu