aboutsummaryrefslogtreecommitdiff
path: root/include/platform.h
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2012-03-21 20:53:50 +0000
committerRon Yorston <rmy@pobox.com>2012-03-21 20:53:50 +0000
commitf6bad5ef766b0447158e3de2f55c35f1f6cecb58 (patch)
treef5ec7ac45234c25794c97f87e9a6daa8a551e57c /include/platform.h
parent72394258b6509b40e0fa08594ac86215a558dfd8 (diff)
parent8d0e0cdadf726beab28ccdc7d69738c1534e1f74 (diff)
downloadbusybox-w32-f6bad5ef766b0447158e3de2f55c35f1f6cecb58.tar.gz
busybox-w32-f6bad5ef766b0447158e3de2f55c35f1f6cecb58.tar.bz2
busybox-w32-f6bad5ef766b0447158e3de2f55c35f1f6cecb58.zip
Merge commit '8d0e0cdadf726beab28ccdc7d69738c1534e1f74' into merge
Conflicts: include/platform.h libbb/Kbuild.src libbb/messages.c
Diffstat (limited to 'include/platform.h')
-rw-r--r--include/platform.h49
1 files changed, 32 insertions, 17 deletions
diff --git a/include/platform.h b/include/platform.h
index 5f49deb41..c272fbb05 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -20,10 +20,14 @@
20/* Assume all these functions exist by default. Platforms where it is not 20/* Assume all these functions exist by default. Platforms where it is not
21 * true will #undef them below. 21 * true will #undef them below.
22 */ 22 */
23#define HAVE_CLEARENV 1
24#define HAVE_FDATASYNC 1
23#define HAVE_FDPRINTF 1 25#define HAVE_FDPRINTF 1
24#define HAVE_MEMRCHR 1 26#define HAVE_MEMRCHR 1
25#define HAVE_MKDTEMP 1 27#define HAVE_MKDTEMP 1
28#define HAVE_PTSNAME_R 1
26#define HAVE_SETBIT 1 29#define HAVE_SETBIT 1
30#define HAVE_SIGHANDLER_T 1
27#define HAVE_STRCASESTR 1 31#define HAVE_STRCASESTR 1
28#define HAVE_STRCHRNUL 1 32#define HAVE_STRCHRNUL 1
29#define HAVE_STRSEP 1 33#define HAVE_STRSEP 1
@@ -235,14 +239,15 @@
235 239
236/* ---- Unaligned access ------------------------------------ */ 240/* ---- Unaligned access ------------------------------------ */
237 241
242#include <stdint.h>
243typedef int bb__aliased_int FIX_ALIASING;
244typedef uint16_t bb__aliased_uint16_t FIX_ALIASING;
245typedef uint32_t bb__aliased_uint32_t FIX_ALIASING;
246
238/* NB: unaligned parameter should be a pointer, aligned one - 247/* NB: unaligned parameter should be a pointer, aligned one -
239 * a lvalue. This makes it more likely to not swap them by mistake 248 * a lvalue. This makes it more likely to not swap them by mistake
240 */ 249 */
241#if defined(i386) || defined(__x86_64__) || defined(__powerpc__) 250#if defined(i386) || defined(__x86_64__) || defined(__powerpc__)
242# include <stdint.h>
243typedef int bb__aliased_int FIX_ALIASING;
244typedef uint16_t bb__aliased_uint16_t FIX_ALIASING;
245typedef uint32_t bb__aliased_uint32_t FIX_ALIASING;
246# define move_from_unaligned_int(v, intp) ((v) = *(bb__aliased_int*)(intp)) 251# define move_from_unaligned_int(v, intp) ((v) = *(bb__aliased_int*)(intp))
247# define move_from_unaligned16(v, u16p) ((v) = *(bb__aliased_uint16_t*)(u16p)) 252# define move_from_unaligned16(v, u16p) ((v) = *(bb__aliased_uint16_t*)(u16p))
248# define move_from_unaligned32(v, u32p) ((v) = *(bb__aliased_uint32_t*)(u32p)) 253# define move_from_unaligned32(v, u32p) ((v) = *(bb__aliased_uint32_t*)(u32p))
@@ -268,13 +273,19 @@ typedef uint32_t bb__aliased_uint32_t FIX_ALIASING;
268 273
269#if (defined __digital__ && defined __unix__) \ 274#if (defined __digital__ && defined __unix__) \
270 || defined __APPLE__ \ 275 || defined __APPLE__ \
271 || defined __FreeBSD__ || defined __OpenBSD__ || defined __NetBSD__ \ 276 || defined __FreeBSD__ || defined __OpenBSD__ || defined __NetBSD__
272 || ENABLE_PLATFORM_MINGW32 277# undef HAVE_CLEARENV
278# undef HAVE_FDATASYNC
273# undef HAVE_MNTENT_H 279# undef HAVE_MNTENT_H
280# undef HAVE_PTSNAME_R
274# undef HAVE_SYS_STATFS_H 281# undef HAVE_SYS_STATFS_H
282# undef HAVE_SIGHANDLER_T
283# undef HAVE_XTABS
284# undef HAVE_FDPRINTF
275#else 285#else
276# define HAVE_MNTENT_H 1 286# define HAVE_MNTENT_H 1
277# define HAVE_SYS_STATFS_H 1 287# define HAVE_SYS_STATFS_H 1
288# define HAVE_XTABS 1
278#endif 289#endif
279 290
280/*----- Kernel versioning ------------------------------------*/ 291/*----- Kernel versioning ------------------------------------*/
@@ -378,14 +389,16 @@ typedef unsigned smalluint;
378#endif 389#endif
379 390
380#if ENABLE_PLATFORM_MINGW32 391#if ENABLE_PLATFORM_MINGW32
381# undef HAVE_FDPRINTF 392# undef HAVE_FDPRINTF
382# undef HAVE_MEMRCHR 393# undef HAVE_MEMRCHR
383# undef HAVE_MKDTEMP 394# undef HAVE_MKDTEMP
384# undef HAVE_SETBIT 395# undef HAVE_SETBIT
385# undef HAVE_STRCASESTR 396# undef HAVE_STRCASESTR
386# undef HAVE_STRCHRNUL 397# undef HAVE_STRCHRNUL
387# undef HAVE_STRSIGNAL 398# undef HAVE_STRSIGNAL
388# undef HAVE_VASPRINTF 399# undef HAVE_VASPRINTF
400# undef HAVE_MNTENT_H
401# undef HAVE_SYS_STATFS_H
389#endif 402#endif
390 403
391#if defined(__WATCOMC__) 404#if defined(__WATCOMC__)
@@ -427,6 +440,10 @@ extern char *mkdtemp(char *template) FAST_FUNC;
427# define clrbit(a, b) ((a)[(b) >> 3] &= ~(1 << ((b) & 7))) 440# define clrbit(a, b) ((a)[(b) >> 3] &= ~(1 << ((b) & 7)))
428#endif 441#endif
429 442
443#ifndef HAVE_SIGHANDLER_T
444typedef void (*sighandler_t)(int);
445#endif
446
430#ifndef HAVE_STRCASESTR 447#ifndef HAVE_STRCASESTR
431extern char *strcasestr(const char *s, const char *pattern) FAST_FUNC; 448extern char *strcasestr(const char *s, const char *pattern) FAST_FUNC;
432#endif 449#endif
@@ -445,9 +462,7 @@ extern char *strsep(char **stringp, const char *delim) FAST_FUNC;
445#endif 462#endif
446 463
447#ifndef HAVE_VASPRINTF 464#ifndef HAVE_VASPRINTF
448# if ENABLE_PLATFORM_MINGW32 465# include <stdarg.h>
449# include <stdarg.h>
450# endif
451extern int vasprintf(char **string_ptr, const char *format, va_list p) FAST_FUNC; 466extern int vasprintf(char **string_ptr, const char *format, va_list p) FAST_FUNC;
452#endif 467#endif
453 468