[git commit nptl] add hidden aliases for ntoh/hton functions

Mike Frysinger vapier at gentoo.org
Wed Aug 19 11:29:41 UTC 2009


commit: http://git.uclibc.org/uClibc/commit/?id=0e3d6a139cd9ab6b2485edaf425b10750c28acfd
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/nptl

Sometimes references for these functions show up (like when debugging is
enabled), so add hidden aliases for them if needed.

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
Signed-off-by: Austin Foxley <austinf at cetoncorp.com>
---
 include/netinet/in.h |    4 ++++
 libc/inet/ntohl.c    |   14 ++++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/include/netinet/in.h b/include/netinet/in.h
index 942373f..851aace 100644
--- a/include/netinet/in.h
+++ b/include/netinet/in.h
@@ -356,12 +356,16 @@ struct group_filter
    may have different representations but the values are always the same.  */
 
 extern uint32_t ntohl (uint32_t __netlong) __THROW __attribute__ ((__const__));
+libc_hidden_proto(ntohl)
 extern uint16_t ntohs (uint16_t __netshort)
      __THROW __attribute__ ((__const__));
+libc_hidden_proto(ntohs)
 extern uint32_t htonl (uint32_t __hostlong)
      __THROW __attribute__ ((__const__));
+libc_hidden_proto(htonl)
 extern uint16_t htons (uint16_t __hostshort)
      __THROW __attribute__ ((__const__));
+libc_hidden_proto(htons)
 
 #include <endian.h>
 
diff --git a/libc/inet/ntohl.c b/libc/inet/ntohl.c
index dfadf80..1a58632 100644
--- a/libc/inet/ntohl.c
+++ b/libc/inet/ntohl.c
@@ -9,11 +9,12 @@
 #include <stdint.h>
 #include <endian.h>
 #include <byteswap.h>
+#include <netinet/in.h>
 
-uint32_t ntohl (uint32_t x);
-uint16_t ntohs (uint16_t x);
-uint32_t htonl (uint32_t x);
-uint16_t htons (uint16_t x);
+#undef ntohl
+#undef ntohs
+#undef htonl
+#undef htons
 
 #if __BYTE_ORDER == __BIG_ENDIAN
 uint32_t ntohl (uint32_t x)
@@ -58,3 +59,8 @@ uint16_t htons (uint16_t x)
 #else
 #error "You seem to have an unsupported byteorder"
 #endif
+
+libc_hidden_def(ntohl)
+libc_hidden_def(ntohs)
+libc_hidden_def(htonl)
+libc_hidden_def(htons)
-- 
1.6.3.3



More information about the uClibc-cvs mailing list