Mega Search
23.2 Million


Sign Up

Make a donation  
Indy Lazarus  
News Group: embarcadero.public.delphi.internet.winsock

1. I know this is a delphi forum, however I just downloaded the latest Indy snapshot(revision: 5218). It's working fine on windows and linux. On OSX I get an error(IdGlobal.pas),
Macapi.Mach not found:
{code}
....
Classes,
  syncobjs,
  {$IFDEF UNIX}
    {$IFDEF KYLIXCOMPAT}
    Libc,
    {$ELSE}
      {$IFDEF FPC}
      DynLibs, 
      {$ENDIF}
      {$IFDEF USE_VCL_POSIX}
      Posix.SysTypes, Posix.Pthread, Posix.Unistd,
      {$ENDIF}
      {$IFDEF USE_BASEUNIX}
      BaseUnix, Unix, Sockets, UnixType, 
      {$ENDIF}
      {$IFDEF USE_ICONV_ENC}iconvenc, {$ENDIF}
    {$ENDIF}
    {$IFDEF DARWIN}
     Macapi.Mach,  //ERROR HERE, FILE NOT FOUND
    {$ENDIF}
  {$ENDIF}
  IdException;
{code}
I did a quick google search. Macapi.Mac it's a Delphi interfaces to Mac framework and it's not available on lazarus.Is there a workaround?
I had no problem with Indy 10.6.0.0. Worked just fine on Windows, Linux and OSX.

Thanks.

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 8-Dec-2014, at 2:14 PM EST
From: Marton Kovacs
 
Re: Indy Lazarus [Edit]  
News Group: embarcadero.public.delphi.internet.winsock
> It already has been, 3 months ago.

Yes, it's up to date! My mistake, somehow I mixed up the different versions.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 10-Dec-2014, at 1:24 PM EST
From: Marton Kovacs
 
Re: Indy Lazarus [Edit]  
News Group: embarcadero.public.delphi.internet.winsock
Marton wrote:

> I do have a small request though, please change the Release number
> to 1(indylaz.lpk), to reflect the current version of indy.

It already has been, 3 months ago.

> I also see that you changed the old indy logo with a new, nicer one.

That was a group effort:

Nicer about dialog
http://forums2.atozed.com/viewtopic.php?f=7&t=26710

--
Remy Lebeau (TeamB)

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 9-Dec-2014, at 10:14 PM EST
From: Remy Lebeau (TeamB)
 
Re: Indy Lazarus [Edit]  
News Group: embarcadero.public.delphi.internet.winsock
Just perfect Remy, works like a charm! 
 
I do have a small request though, please change the Release number to 1(indylaz.lpk), to reflect the current version of indy.
You don't need the Lazarus IDE, just a text editor(line 39):



I also see that you changed the old indy logo with a new, nicer one. 

Thank your for all the good work!

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 9-Dec-2014, at 9:44 PM EST
From: Marton Kovacs
 
Re: Indy Lazarus [Edit]  
News Group: embarcadero.public.delphi.internet.winsock
Marton wrote:

> however there is no UInt64 in FPC, only QWord:
> 
> http://www.freepascal.org/docs-html/ref/refsu5.html

That is an older document.  UInt64 was added in FPC 2.1.5 as an alias for 
QWord:

http://www.freepascal.org/docs-html/rtl/system/uint64.html

> I hope it's the right type!

Yes, it is.  I just wanted to make sure that QWord was a predefined type 
and not one that needs to be imported from another unit.  According to the 
doc you linked to, it is a predefined type, so that is good.

--
Remy Lebeau (TeamB)

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 9-Dec-2014, at 3:23 PM EST
From: Remy Lebeau (TeamB)
 
Re: Indy Lazarus [Edit]  
News Group: embarcadero.public.delphi.internet.winsock
> Thanks.  I have added it to IdGlobal.pas.  
Thank you Remy! I will run a few test tomorrow on my MAC.

>Though I suspect the QWORD might 
> be a problem, I don't know if it is predefined or not.
According to the Mac developer library the return value of mach_absolute_time() is uint64_t(delphi UInt64  = 0..18446744073709551615),
however there is no UInt64 in FPC, only QWord:
http://www.freepascal.org/docs-html/ref/refsu5.html

I hope it's the right type! What would be the sympthoms if  mach_absolute_time() returns the wrong value?
How would effect a client/server application for example?

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 9-Dec-2014, at 1:20 PM EST
From: Marton Kovacs
 
Re: Indy Lazarus [Edit]  
News Group: embarcadero.public.delphi.internet.winsock
Marton wrote:

> {code}
> type
> TTimebaseInfoData = record
> numer: LongWord;
> denom: LongWord;
> end;
>
> function mach_timebase_info(var TimebaseInfoData:
> TTimebaseInfoData): Integer; cdecl; external 'libc';
> function mach_absolute_time: QWORD; cdecl; external 'libc';
> {code}

Thanks.  I have added it to IdGlobal.pas.  Though I suspect the QWORD might 
be a problem, I don't know if it is predefined or not.

> You only need this two function from Macapi.Mach?

AFAIK, yes.

--
Remy Lebeau (TeamB)

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 9-Dec-2014, at 10:57 AM EST
From: Remy Lebeau (TeamB)
 
Re: Indy Lazarus [Edit]  
News Group: embarcadero.public.delphi.internet.winsock
Hi Remy,

> If you can find out which FreeFascal unit(s) declare those functions, I can 
> update Indy to use them.


I'm afraid it's not implemented yet, but it shouldn't be to difficult:
https://developer.apple.com/library/ios/qa/qa1643/_index.html
https://developer.apple.com/library/ios/qa/qa1643/_index.html

{code}
type
  TTimebaseInfoData = record
    numer: LongWord;
    denom: LongWord;
  end;

  function mach_timebase_info(var TimebaseInfoData: TTimebaseInfoData): Integer; cdecl; external 'libc';
  function mach_absolute_time: QWORD; cdecl; external 'libc';     
{code} 

You only need this two function from Macapi.Mach?

Thank you!

Edited by: Marton Kovacs on Dec 8, 2014 9:44 PM

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 8-Dec-2014, at 9:45 PM EST
From: Marton Kovacs
 
Re: Indy Lazarus  
News Group: embarcadero.public.delphi.internet.winsock
Marton wrote:

> I know this is a delphi forum, however I just downloaded the latest
> Indy snapshot(revision: 5218). It's working fine on windows and linux.
> On OSX I get an error(IdGlobal.pas),
> Macapi.Mach not found:

That is a Delphi unit, not a FreePascal unit.  I don't know if/what the FreePascal 
equivilent would be.  You will probably also have trouble with the Macapi.CoreServices 
reference in the "uses" clause of the implementation section.

> I had no problem with Indy 10.6.0.0. Worked just fine on Windows,
> Linux and OSX.

Indy 10.6.1.0 added new 64-bit tick counters:

Indy 10.6.1, 64-bit Tick Counters
http://www.indyproject.org/sockets/blogs/ChangeLog/20140905.aspx

To facilitate that on OSX, Indy had to switch from using AbsoluteToNanoseconds() 
to using mach_timebase_info() and mach_absolute_time() instead, thus the 
newer use of Macapi units.  That code has not been tested on FreePascal yet. 
 I guess it does not work yet.

If you can find out which FreeFascal unit(s) declare those functions, I can 
update Indy to use them.

--
Remy Lebeau (TeamB)

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 8-Dec-2014, at 6:23 PM EST
From: Remy Lebeau (TeamB)