aboutsummaryrefslogtreecommitdiff
path: root/include/platform.h
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-05-26 17:32:35 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-05-26 17:32:35 +0000
commitfc9e1080320e52fb97ae694627d8101af64f3dad (patch)
tree2b57edddb15071f8fa13a47e45a735d0e8c52edc /include/platform.h
parent6bb55cfb99090565d565588c281c08ca21993e78 (diff)
downloadbusybox-w32-fc9e1080320e52fb97ae694627d8101af64f3dad.tar.gz
busybox-w32-fc9e1080320e52fb97ae694627d8101af64f3dad.tar.bz2
busybox-w32-fc9e1080320e52fb97ae694627d8101af64f3dad.zip
udhcpc: shrink
udhcpc: guard against zero lease time function old new delta timeout 4 - -4 server_addr 4 - -4 requested_ip 4 - -4 perform_release 134 112 -22 udhcpc_main 2511 2485 -26 ------------------------------------------------------------------------------ (add/remove: 0/3 grow/shrink: 0/2 up/down: 0/-60) Total: -60 bytes
Diffstat (limited to 'include/platform.h')
-rw-r--r--include/platform.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/platform.h b/include/platform.h
index 0e0ccaf90..21224fabf 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -135,7 +135,18 @@
135#define SWAP_LE64(x) (x) 135#define SWAP_LE64(x) (x)
136#endif 136#endif
137 137
138/* ---- Unaligned access ------------------------------------ */
139
140/* parameter is supposed to be an uint32_t* ptr */
141#if defined(i386) || defined(__x86_64__) /* + other arches? */
142#define get_unaligned_u32p(u32p) (*(u32p))
143#else
144/* performs reasonably well (gcc usually inlines memcpy here) */
145#define get_unaligned_u32p(u32p) ({ uint32_t __t; memcpy(&__t, (u32p), 4); __t; })
146#endif
147
138/* ---- Networking ------------------------------------------ */ 148/* ---- Networking ------------------------------------------ */
149
139#ifndef __APPLE__ 150#ifndef __APPLE__
140# include <arpa/inet.h> 151# include <arpa/inet.h>
141# ifndef __socklen_t_defined 152# ifndef __socklen_t_defined
@@ -146,6 +157,7 @@ typedef int socklen_t;
146#endif 157#endif
147 158
148/* ---- Compiler dependent settings ------------------------- */ 159/* ---- Compiler dependent settings ------------------------- */
160
149#if (defined __digital__ && defined __unix__) || defined __APPLE__ 161#if (defined __digital__ && defined __unix__) || defined __APPLE__
150# undef HAVE_MNTENT_H 162# undef HAVE_MNTENT_H
151# undef HAVE_SYS_STATFS_H 163# undef HAVE_SYS_STATFS_H
@@ -163,9 +175,10 @@ __extension__ typedef unsigned long long __u64;
163#endif 175#endif
164 176
165/*----- Kernel versioning ------------------------------------*/ 177/*----- Kernel versioning ------------------------------------*/
178
166#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) 179#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
167 180
168/* ---- miscellaneous --------------------------------------- */ 181/* ---- Miscellaneous --------------------------------------- */
169 182
170#if defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ < 5 && \ 183#if defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ < 5 && \
171 !defined(__dietlibc__) && \ 184 !defined(__dietlibc__) && \