[PATCH] udhcp and newlib

Shaun Jackman sjackman at gmail.com
Thu Apr 20 21:25:42 UTC 2006


udhcp uses some fun-fun __GLIBC__ tests. A _NEWLIB_VERSION test is
required as well. Alternatively, the sense of the test could be
reversed to say if GLIBC version < 2.1 include the funny headers, in
which case newlib would get the right headers implicitly.

Cheers,
Shaun

2006-04-20  Shaun Jackman  <sjackman at gmail.com>

	* networking/udhcp/clientpacket.c: Test _NEWLIB_VERSION.
	* networking/udhcp/clientsocket.c: Ditto.
	* networking/udhcp/packet.c: Ditto.
	* networking/udhcp/socket.c: Ditto.

============================================================
--- networking/udhcp/clientpacket.c	326ce55ca743630dcfb132677bd76d0c1c1cfebc
+++ networking/udhcp/clientpacket.c	cbbf22237d207469101578dfa2aa885814c27834
@@ -22,7 +22,7 @@
 #include <string.h>
 #include <sys/socket.h>
 #include <features.h>
-#if __GLIBC__ >=2 && __GLIBC_MINOR >= 1
+#if (__GLIBC__ >= 2 && __GLIBC_MINOR >= 1) || defined _NEWLIB_VERSION
 #include <netpacket/packet.h>
 #include <net/ethernet.h>
 #else
============================================================
--- networking/udhcp/clientsocket.c	cc581aa47ca19da4b286e048f721c807dc2dbab7
+++ networking/udhcp/clientsocket.c	cfc133b166f0a01b9c8585618493dea8e4517749
@@ -25,7 +25,7 @@
 #include <unistd.h>
 #include <netinet/in.h>
 #include <features.h>
-#if __GLIBC__ >=2 && __GLIBC_MINOR >= 1
+#if (__GLIBC__ >= 2 && __GLIBC_MINOR >= 1) || defined _NEWLIB_VERSION
 #include <netpacket/packet.h>
 #include <net/ethernet.h>
 #else
============================================================
--- networking/udhcp/packet.c	5fcda80249f3be8d16cd09b529d25fdf1dacec3f
+++ networking/udhcp/packet.c	8e7ec3b5aeace005d75a3b2596df03d96192164d
@@ -1,10 +1,10 @@
 #include <unistd.h>
 #include <string.h>
 #include <netinet/in.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <features.h>
-#if __GLIBC__ >=2 && __GLIBC_MINOR >= 1
+#if (__GLIBC__ >= 2 && __GLIBC_MINOR >= 1) || defined _NEWLIB_VERSION
 #include <netpacket/packet.h>
 #include <net/ethernet.h>
 #else
============================================================
--- networking/udhcp/socket.c	2350b470182176fa08efd13f69e4755fc283a700
+++ networking/udhcp/socket.c	fa23758854e00b582717a12ef71a030935163213
@@ -32,7 +32,7 @@
 #include <net/if.h>
 #include <errno.h>
 #include <features.h>
-#if __GLIBC__ >=2 && __GLIBC_MINOR >= 1
+#if (__GLIBC__ >= 2 && __GLIBC_MINOR >= 1) || defined _NEWLIB_VERSION
 #include <netpacket/packet.h>
 #include <net/ethernet.h>
 #else


More information about the busybox mailing list