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-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
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: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)

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 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

[fpc-pascal] Calling C functions from FPC

2009-01-25 Thread Ken G. Brown
On MacOS X 10.5.6 Intel targeting 10.3.9 PPC: What are the gotchas with respect to calling C functions from FPC? For example if I wanted to be able to make use some of Apple's Serial example code http://developer.apple.com/samplecode/SerialPortSample/index.html but don't want to go to all the

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