X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=include%2Fplatform.h;h=91d5f476d8693ece34652f71f40da1e395a971c6;hb=f8138d1f91c913166bffb0077a0fe06831a77ecf;hp=91f43f30b468db46f58ea8e6f7e34932e33a0e82;hpb=9213a9e0f2d8fd638ecd02e2628d96dd5c7d233e;p=oweals%2Fbusybox.git diff --git a/include/platform.h b/include/platform.h index 91f43f30b..91d5f476d 100644 --- a/include/platform.h +++ b/include/platform.h @@ -34,7 +34,7 @@ #endif #undef inline -#if __STDC_VERSION__ > 199901L +#if defined(__STDC_VERSION__) && __STDC_VERSION__ > 199901L /* it's a keyword */ #else # if __GNUC_PREREQ (2,7) @@ -133,13 +133,6 @@ typedef int socklen_t; #endif /* ---- Compiler dependent settings ------------------------- */ -#ifndef __GNUC__ -#if defined __INTEL_COMPILER -__extension__ typedef __signed__ long long __s64; -__extension__ typedef unsigned long long __u64; -#endif /* __INTEL_COMPILER */ -#endif /* ifndef __GNUC__ */ - #if (defined __digital__ && defined __unix__) # undef HAVE_MNTENT_H #else @@ -193,9 +186,21 @@ typedef unsigned long long int uintmax_t; /* Platforms that haven't got dprintf need to implement fdprintf() in * libbb. This would require a platform.c. It's not going to be cleaned * out of the tree, so stop saying it should be. */ +#if !defined(__dietlibc__) +/* Needed for: glibc */ +/* Not needed for: dietlibc */ +/* Others: ?? (add as needed) */ #define fdprintf dprintf +#endif + +#if defined(__dietlibc__) +static ATTRIBUTE_ALWAYS_INLINE char* strchrnul(const char *s, char c) { + while (*s && *s != c) ++s; + return (char*)s; +} +#endif -/* Don't use lchown with glibc older then 2.1.x ... uC-libc lacks it */ +/* Don't use lchown with glibc older than 2.1.x ... uC-libc lacks it */ #if (defined __GLIBC__ && __GLIBC__ <= 2 && __GLIBC_MINOR__ < 1) || \ defined __UC_LIBC__ # define lchown chown @@ -215,7 +220,7 @@ typedef unsigned long long int uintmax_t; #define PRIu32 "u" /* use legacy setpgrp(pidt_,pid_t) for now. move to platform.c */ -#define bb_setpgrp do{pid_t __me = getpid();setpgrp(__me,__me);}while(0) +#define bb_setpgrp do { pid_t __me = getpid(); setpgrp(__me,__me); } while (0) #if !defined ADJ_OFFSET_SINGLESHOT && defined MOD_CLKA && defined MOD_OFFSET #define ADJ_OFFSET_SINGLESHOT (MOD_CLKA | MOD_OFFSET)