Recent

Author Topic: CNetDB unit on macOS  (Read 3053 times)

mayevski

  • New member
  • *
  • Posts: 8
CNetDB unit on macOS
« on: December 13, 2016, 08:20:18 pm »
Hello,

is it just me, or FPC 3.0.1 is missing cnetdb unit in macOS installation? I clearly can find cnetdb on Linux, but not on macOS. Is there a reason for it, or it just has been overlooked?

Sincerely yours
Eugene Mayevski

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: CNetDB unit on macOS
« Reply #1 on: December 14, 2016, 12:52:40 am »
I clearly can find cnetdb on Linux, but not on macOS.

Correct, there are no compiled units for cnetdb.pp on OS X. Probably because the external library it references doesn't exist on OS X.

mayevski

  • New member
  • *
  • Posts: 8
Re: CNetDB unit on macOS
« Reply #2 on: December 14, 2016, 04:14:01 am »
Thank you. The unit contains declarations and the references to getnameinfo() and similar functions, which do exist on macOS X (as these are posix-defined functions). Their declarations can be found in /usr/include/netdb.h

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11455
  • FPC developer.
Re: CNetDB unit on macOS
« Reply #3 on: December 14, 2016, 11:30:40 am »
Yes. That unit does POSIX interfacing of the name resolving (e.g. DNS) system (aka libresolv in old BSDs, but now commonly in libc).

I added in 2.2/2.4 times for use in case the native FPC implementation of libresolv (netdb unit) had problems.

So probably OS X socket suites either use netdb, or (more) native APIs.

mayevski

  • New member
  • *
  • Posts: 8
Re: CNetDB unit on macOS
« Reply #4 on: December 14, 2016, 02:07:54 pm »
marcov, thank you for the valuable comments. Yet netdb.pas/ppu doesn't have the decalarations, included in cnetdb, and on macos and ios the valid code cannot be compiled at all without rewriting or copying much of the cnetdb.

 

TinyPortal © 2005-2018