summaryrefslogtreecommitdiff
path: root/include/platform.h
diff options
context:
space:
mode:
authorDenis Vlasenko2006-12-18 22:32:45 +0000
committerDenis Vlasenko2006-12-18 22:32:45 +0000
commit7cfecc4b36c5bd6e1e85fe8851ebd90fe1edb8f4 (patch)
tree2d03681bc35891414026aa56eeed0fbc29530124 /include/platform.h
parentc8e6e35ba4095846121d5b5a3eee57caa5e8e0fb (diff)
downloadbusybox-7cfecc4b36c5bd6e1e85fe8851ebd90fe1edb8f4.zip
busybox-7cfecc4b36c5bd6e1e85fe8851ebd90fe1edb8f4.tar.gz
xfuncs.c: dietlibc actually HAS fdprintf!
platform.h: define strchrnul for dietlibc ash: stop using few non-standard functions
Diffstat (limited to 'include/platform.h')
-rw-r--r--include/platform.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/platform.h b/include/platform.h
index 860143f..1cc9782 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -193,9 +193,18 @@ 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
-#ifdef __dietlibc__
-int dprintf(int fd, const char *format, ...);
+#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 than 2.1.x ... uC-libc lacks it */