Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/tcpdump/dist - don't use their ntoh{l, s}/hton{l...



details:   https://anonhg.NetBSD.org/src/rev/a1f3738ff413
branches:  trunk
changeset: 821133:a1f3738ff413
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Jan 25 14:46:16 2017 +0000

description:
- don't use their ntoh{l,s}/hton{l,s} implementation
- fix their ntohl/htonl implementations to use unsigned int instead of
  unsigned long so they work on _LP64.

diffstat:

 external/bsd/tcpdump/dist/netdissect-stdinc.h |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r ddebdbe35e7a -r a1f3738ff413 external/bsd/tcpdump/dist/netdissect-stdinc.h
--- a/external/bsd/tcpdump/dist/netdissect-stdinc.h     Wed Jan 25 13:43:58 2017 +0000
+++ b/external/bsd/tcpdump/dist/netdissect-stdinc.h     Wed Jan 25 14:46:16 2017 +0000
@@ -279,13 +279,13 @@
  * avoid the bswap instruction, as OS X only supports machines that
  * have it.)
  */
-#if defined(__GNUC__) && defined(__i386__) && !defined(__APPLE__) && !defined(__ntohl)
+#if defined(__GNUC__) && defined(__i386__) && !defined(__APPLE__) && !defined(__ntohl) && !defined(ntohl)
   #undef ntohl
   #undef ntohs
   #undef htonl
   #undef htons
 
-  static __inline__ unsigned long __ntohl (unsigned long x);
+  static __inline__ unsigned int __ntohl (unsigned int x);
   static __inline__ unsigned short __ntohs (unsigned short x);
 
   #define ntohl(x)  __ntohl(x)
@@ -293,7 +293,7 @@
   #define htonl(x)  __ntohl(x)
   #define htons(x)  __ntohs(x)
 
-  static __inline__ unsigned long __ntohl (unsigned long x)
+  static __inline__ unsigned int __ntohl (unsigned int x)
   {
     __asm__ ("xchgb %b0, %h0\n\t"   /* swap lower bytes  */
              "rorl  $16, %0\n\t"    /* swap words        */



Home | Main Index | Thread Index | Old Index