<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.6000.16544" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=468414907-30042011><FONT face=Arial color=#0000ff size=2>Forget
my previous reply. I found the original header file on sourceforge.
</FONT></SPAN></DIV>
<DIV><SPAN class=468414907-30042011><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=468414907-30042011><FONT face=Arial color=#0000ff size=2>I have
alse a better understanding now of what the code is supposed to do: in case
DOCUMENTATION_ONLY is not defined, a reference to, for example,
su_sockaddr_u.su_family will be subsstituted by su_sockaddr_u.susa.sa_family.
</FONT></SPAN></DIV>
<DIV><SPAN class=468414907-30042011><FONT face=Arial color=#0000ff size=2>You
could use macros and do a {$define su_family:=susa.sa_family} with the following
limitations:</FONT></SPAN></DIV>
<DIV><SPAN class=468414907-30042011><FONT face=Arial color=#0000ff size=2>- if
you have variables or other record members named su_family, not part of the
su_sockaddr_u record, they will be renamed also. </FONT></SPAN></DIV>
<DIV><SPAN class=468414907-30042011><FONT face=Arial color=#0000ff size=2>- it
works only for the units that include your .inc file.</FONT></SPAN></DIV>
<DIV><SPAN class=468414907-30042011></SPAN> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=fr dir=ltr align=left><FONT face=Tahoma
size=2>-----Message d'origine-----<BR><B>De :</B>
fpc-pascal-bounces@lists.freepascal.org
[mailto:fpc-pascal-bounces@lists.freepascal.org] <B>De la part de</B> Ludo
Brands<BR><B>Envoyé :</B> samedi 30 avril 2011 09:18<BR><B>À :</B>
'FPC-Pascal users discussions'<BR><B>Objet :</B> RE : [fpc-pascal] How to
translate this union ?<BR><BR></FONT></DIV>
<DIV><SPAN class=078041007-30042011><FONT face=Arial color=#0000ff size=2>Can
you post the original c code? You point to a file that seems to be a reworked
output from h2pas. As it is now, it indeed doesn't make any sense. I would
think the su_len,su_family,su_port should make up a record but they
aren't.</FONT></SPAN></DIV>
<DIV><SPAN class=078041007-30042011><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=078041007-30042011><FONT face=Arial color=#0000ff size=2>I
suggest you move the #defines inside the union declaration to somewhere before
the union declaration. It'll double up the ifdef's but make the code so much
more readable.</FONT></SPAN></DIV>
<DIV><SPAN class=078041007-30042011><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=078041007-30042011><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV></DIV>
<DIV><FONT face=Tahoma size=2>-----Message d'origine-----<BR><B>De :</B>
fpc-pascal-bounces@lists.freepascal.org
[mailto:fpc-pascal-bounces@lists.freepascal.org] <B>De la part de</B>
ik<BR><B>Envoyé :</B> vendredi 29 avril 2011 22:15<BR><B>À :</B>
FPC-Pascal users discussions<BR><B>Objet :</B> [fpc-pascal] How to
translate this union ?<BR><BR></DIV></FONT>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV dir=ltr>Hello list,<BR><BR>I'm trying to translate the <A
href="https://github.com/ik5/sofia-sip/blob/master/src/lib/sui.inc#L199">following
union</A> to Pascal, but I do not understand it, and so does h2pas.<BR>How
to translate it ?<BR><BR>Thanks,<BR><BR>Ido<BR><BR><BR clear=all>
<DIV dir=ltr>LINESIP - Opening the source for communication<BR><A
href="http://www.linesip.com" target=_blank>http://www.linesip.com</A><BR><A
href="http://www.linesip.co.il"
target=_blank>http://www.linesip.co.il</A><BR><BR></DIV><BR></DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>