aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-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__) && \