Complete.Org: Mailing Lists: Archives: freeciv-dev: March 1999:
Re: [Freeciv-Dev] 1.8.0 and network byte order
Home

Re: [Freeciv-Dev] 1.8.0 and network byte order

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Trent Piepho <xyzzy@xxxxxxxxxxxxxxxx>
Cc: Freeciv Developer Mailing List <freeciv-dev@xxxxxxxxxxx>
Subject: Re: [Freeciv-Dev] 1.8.0 and network byte order
From: Mitch Davis <mjd@xxxxxxxxxx>
Date: Wed, 03 Mar 1999 14:47:42 +1100

Trent Piepho wrote:
> 
> On Wed, 3 Mar 1999, Mitch Davis wrote:
> > The *right* way is to use the htonl/htons/ntohl/ntohs macros
> > which appear in /usr/include/netinet/in.h on most machines.
> >
> > Well, 1.8 is here!  Can we make those changes now?
> 
> And to this end, here is patch which does this.

Nice one... :-)

We should work out what happens when two sides try and talk to
each other when only one side has had the patch.  If either side
dumps core, we should note this in the README.

One thing I noticed:  Under HP-UX and many other Unixes, 
#include <arpa/inet.h> must be used to bring in the prototypes
for the conversion macros.  Without it, my test program gives
me this:

  warning: implicit declaration of function `htonl'

I would suggest adding "#include <arpa/inet.h>" to the top of
packets.c.

Regards,

Mitch.
--
| mailto:mjd@xxxxxxxxxx       | Not the official view of: |
| mailto:mjd@xxxxxxxxxxxxxxxx | Australian Calculator Opn |
| Certified Linux Evangelist! | Hewlett Packard Australia |

[Prev in Thread] Current Thread [Next in Thread]