[PATCH] daemon/Win32: provide htonl, htons, ntohl, ntohs functions.
This is another candidate for gnulib ... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
Richard W.M. Jones wrote:
This is another candidate for gnulib ...
Yes, indeed. ...
+static inline uint16_t +htons (x) + uint16_t x; +{
Using old-style function definitions like this is odd, but then I realized this was probably copied from glibc. Did you have to make any changes? ACK.
On Thu, Nov 26, 2009 at 12:41:42PM +0100, Jim Meyering wrote:
Richard W.M. Jones wrote:
This is another candidate for gnulib ...
Yes, indeed.
...
+static inline uint16_t +htons (x) + uint16_t x; +{
Using old-style function definitions like this is odd, but then I realized this was probably copied from glibc.
Yes, these are copied from glibc, but ...
Did you have to make any changes?
This patch was a bit of a dog's dinner. The functions also shouldn't be static(!) Try this version instead. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
Richard W.M. Jones wrote:
On Thu, Nov 26, 2009 at 12:41:42PM +0100, Jim Meyering wrote:
Richard W.M. Jones wrote:
This is another candidate for gnulib ...
Yes, indeed.
...
+static inline uint16_t +htons (x) + uint16_t x; +{
Using old-style function definitions like this is odd, but then I realized this was probably copied from glibc.
Yes, these are copied from glibc, but ...
Did you have to make any changes?
This patch was a bit of a dog's dinner. The functions also shouldn't be static(!)
Of course ;-) ...
+uint32_t +htonl (x) + uint32_t x; ... +uint32_t ntohl (uint32_t x) { return htonl (x); }
Looks ok. ACK Unless you're trying to minimize diffs with glibc, you may want to make all four definitions be ANSI. ...
+uint16_t +htons (x) + uint16_t x; ... +uint16_t ntohs (uint16_t x) { return htons (x); }
participants (2)
-
Jim Meyering -
Richard W.M. Jones