socket: avoid bsd typedefs, instead define
authorMarko Kreen <markokr@gmail.com>
Sat, 26 Feb 2011 11:03:22 +0000 (13:03 +0200)
committerMarko Kreen <markokr@gmail.com>
Sat, 26 Feb 2011 11:03:22 +0000 (13:03 +0200)
usual/socket_ntop.c
usual/socket_pton.c

index 0db6e4a3994ea19e8a000883efda567c39a03d43..6cac6d079209308b7b1a07413e5bef739841580f 100644 (file)
@@ -31,8 +31,8 @@
 #define INT16SZ 2
 #endif
 
-typedef unsigned char u_char;
-typedef unsigned int u_int;
+#define u_char uint8_t
+#define u_int unsigned int
 
 /*
  * WARNING: Don't even consider trying to compile this on a system where
index 98ee57aa3ba7ac969409340883295b7cd1fdc953..50cf4b272e1079ac39c476ab847d32dea258699a 100644 (file)
@@ -17,6 +17,7 @@
  */
 
 #include <usual/socket.h>
+#include <usual/string.h>
 
 #ifndef HAVE_INET_PTON
 
@@ -30,8 +31,8 @@
 #define INT16SZ 2
 #endif
 
-typedef unsigned char u_char;
-typedef unsigned int u_int;
+#define u_char uint8_t
+#define u_int unsigned int
 
 /*
  * WARNING: Don't even consider trying to compile this on a system where