On Saturday 03 September 2016 18:24:42 Fred van Stappen wrote:
> Probably not:
> "
> {$ifdef linux}
> function __libc_sa_len(__af: sa_family_t): Integer; cdecl;external clib
> name '__libc_sa_len';
> {$else}
>   //use len field of FreeBSD struct
> {$endif}
> "
> 32 bit FreeBSD is not supported by me. You need to define all necessary 32
> bit libc structs for FreeBSD in lib/common/kernel/mselibc. Check the
> {$else}-part of {$ifdef linux} for missing or wrong defines for 32 bit.
>
> Martin
>
> ______________
>
> Hellon Martin.
>
> OK, many thanks.
>
> Hum, I assume you want to write:
>
> {$ifdef unix}
> {$ifdef linux}
> function __libc_sa_len(__af: sa_family_t): Integer; cdecl;external clib
> name '__libc_sa_len';
> {$else}
>   //use len field of FreeBSD struct
> {$endif}
> {$endif}
>
No, FreeBSD has some differences in libc structures compared to Linux. I 
adapted the definitions for 64 bit FreeBSD. For 32 bit FreeBSD it must be 
done too.
For example Linux has __libc_sa_len() in order to return the size of 
a "sockaddr" struct, FreeBSD uses the "sa_len" field:
"
  {$ifdef linux}
  sockaddr = {packed} record
    case Integer of
      0: (sa_family: sa_family_t;
          sa_data: packed array[0..13] of Byte);
      1: (sin_family: sa_family_t;
          sin_port: u_short;
          sin_addr: TInAddr;
          sin_zero: packed array[0..7] of Byte);
  end;
  {$else}
  sockaddr = record
   sa_len: byte;                          //* total length */
   case integer of
    0: (sa_family: sa_family_t;                //* address family */
        sa_data: packed array[0..13] of Byte); //* actually longer; address 
value */
    1: (sin_family: sa_family_t;
        sin_port: u_short;
        sin_addr: TInAddr;
        sin_zero: packed array[0..7] of Byte);
  end;
  {$endif}
"

I don't know why in your compilation "some constants are not defined". Which 
constants?

Martin

------------------------------------------------------------------------------
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to