[fpc-pascal] libusb header translation and OOP wrapper

Henry Vermaak henry.vermaak at gmail.com
Tue Sep 25 23:16:29 CEST 2012


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.

Henry



More information about the fpc-pascal mailing list