Hi Danijel,
Please add following fixes to eleminate compilation problems under FPC/Lazarus
1. FpcApi.inc
Please change declaration of this functions:
function WSA_GetSockName(s: TSocket; var name: TSockAddr): Integer;
function WSA_GetPeerName(s: TSocket; var name: TSockAddr): Integer;
to
function WSA_GetSockName(s: TSocket; var name: TSockAddr; PreferIP4:Boolean): Integer;
function WSA_GetPeerName(s: TSocket; var name: TSockAddr; PreferIP4:Boolean): Integer;
PreferIP4 parameter must be added because it's used while calling this functions from rtcSynApi.pas
2. rtcTypes.pas
Please change
{$IFDEF UNICODE}
// @exclude
RtcBinWideChar = Word;
// Unicode String
RtcWideString = String;
// Unicode character
RtcWideChar = Char;
{$ELSE}
// @exclude
RtcBinWideChar = Word;
// Unicode String
RtcWideString = WideString;
// Unicode character
RtcWideChar = WideChar;
{$ENDIF}
to
{$IFDEF UNICODE}
// @exclude
RtcBinWideChar = Word;
// Unicode String
RtcWideString = String;
// Unicode character
RtcWideChar = Char;
{$ELSE}
{$IF DEFINED(FPC) AND DEFINED(VER3)} // FPC 3.0 have unicode support
// @exclude
RtcBinWideChar = Word;
// Unicode String
RtcWideString = String;
// Unicode character
RtcWideChar = Char;
{$ELSE}
// @exclude
RtcBinWideChar = Word;
// Unicode String
RtcWideString = WideString;
// Unicode character
RtcWideChar = WideChar;
{$ENDIF}
{$ENDIF}
This changes needed to eleminate hundreds warnings like Implicit string type conversion with potential data loss from "WideString" to "AnsiString", AnsiString to WideString, UnicodeString to AnsiString and so on.
3. rtcInfo.pas->function GetTickTime:Cardinal;
Change
Result := fpTimes(b)*10;
to
Result := Cardinal(fpTimes(b)*10);
This change eleminate Range error exception on start of app.
After this changes RTC compiles in Lazarus 1.6.4 and FPC 3.0.2 and Quick Start\Lazarus_Server demo works on both Windows64 and Linux64.
And one final note:
In Quick Start\Lazarus_Server demo please add RtcHttpServer.StopListenNow(); in form's OnClose. Without this line access violation occurs on closing demo app.