[fpc-pascal] libusb header translation and OOP wrapper
Johann Glaser
Johann.Glaser at gmx.at
Sun Sep 30 18:57:54 CEST 2012
Hi!
Am Mittwoch, den 26.09.2012, 08:56 +0200 schrieb Sven Barth:
> 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).
Thank you for all your valuable suggestions!
I've now relicensed the units under the modified LGPL (as used by
Lazarus) and the examples as public domain.
Additionally I've included the above macro (using "extdecl").
https://github.com/hansiglaser/pas-libusb/tree/libusb-1.0
I also updated my other Pascal translations for the GNU Readline library
https://github.com/hansiglaser/pas-readline and the TCL interpreter
https://github.com/hansiglaser/pas-tcl . Note that the GNU Readline
library is pure GPL itself, therefore my stuff is GPL too.
Bye
Hansi
More information about the fpc-pascal
mailing list