[fpc-pascal] libusb header translation and OOP wrapper
Sven Barth
pascaldragon at googlemail.com
Wed Sep 26 08:56:16 CEST 2012
Am 25.09.2012 23:16, schrieb Henry Vermaak:
> On 25 September 2012 20:57, Christo <christo.crause at gmail.com> wrote:
>> Any ideas on how to define the calling convention in the import unit so
>> that it is either stdcall or cdecl depending on the target OS?
>
> I've used a macro for this in the past. E.g. :
>
> {$macro on}
> {$ifdef windows}
> {$define CCONV:=stdcall}
> {$else}
> {$define CCONV:=cdecl}
> {$endif}
>
> Then use CCONV where you would specify the calling convention.
I would use "extdecl" instead of "CCONV" as the IDE and fpdoc has
special code to handle this (as they don't support macros).
Regards,
Sven
More information about the fpc-pascal
mailing list