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.cra...@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 _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal