Codetools WINAPI modifier
Original Reporter info from Mantis: dioannidis
-
Reporter name: Dimitrios Chr. Ioannidis
Original Reporter info from Mantis: dioannidis
- Reporter name: Dimitrios Chr. Ioannidis
Description:
Lazarus doesn't accept the macro WINAPI ( i.e. as used in fpc's libusb package ) ,
[code=pascal start=99]
{$macro on}
{$ifdef MSWINDOWS}
const libusb1='libusb-1.0.dll';
{$define LIBUSB_CALL := WINAPI }
{$else}
const libusb1='libusb-1.0.so';
{$define LIBUSB_CALL := cdecl }
{$endif}
[/code]
and also as calling convention modifier in procedural types ,
i.e.
[code start=1043]
libusb_transfer_cb_fn = procedure (transfer:plibusb_transfer);LIBUSB_CALL;
[/code]
Steps to reproduce:
Create an empty project in Lazarus and add the libusb unit to the uses clause.
[code=pascal]
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs,
libusb;
type
TForm1 = class(TForm)
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
end.
[/code]
Then go to a TForm keyword and press Alt-Up.
Lazarus will go to this libusb's line, instead of TForm's one :
[code start=1043]
libusb_transfer_cb_fn = procedure (transfer:plibusb_transfer);LIBUSB_CALL;
[/code]
and reports this Codetools error message :
[code]
libusb.pp(1043,81) Error: expected =, but ; found
[/code]
Additional information:
Plz, see the discussion in https://forum.lazarus.freepascal.org/index.php/topic,49371.0.html.
Mantis conversion info:
- Mantis ID: 36927
- OS: Windows 10 Pro 64-bit
- OS Build: 14393
- Platform: Intel Core 2 Duo
- Version: 2.1 (SVN)
- Fixed in revision: 63633 (#2a163831).