aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2009-11-01 04:01:30 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2009-11-01 04:01:30 +0100
commitfe4e23f9ded69194d525775b1ef7648461a7f76d (patch)
tree524f5724e56b8fea8e0237cd300a7db4e75f302f /include
parent95a036e125c28dc93d91ae77923c02a1684fc5ef (diff)
downloadbusybox-w32-fe4e23f9ded69194d525775b1ef7648461a7f76d.tar.gz
busybox-w32-fe4e23f9ded69194d525775b1ef7648461a7f76d.tar.bz2
busybox-w32-fe4e23f9ded69194d525775b1ef7648461a7f76d.zip
Add more compat code for non GNU environments
Signed-off-by: Dan Fandrich <dan@coneharvesters.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r--include/platform.h50
1 files changed, 41 insertions, 9 deletions
diff --git a/include/platform.h b/include/platform.h
index 1fa2ece2b..67b04f8cb 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -11,7 +11,12 @@
11 * true will #undef them below. 11 * true will #undef them below.
12 */ 12 */
13#define HAVE_FDPRINTF 1 13#define HAVE_FDPRINTF 1
14#define HAVE_MEMRCHR 1
15#define HAVE_MKDTEMP 1
16#define HAVE_SETBIT 1
17#define HAVE_STRCASESTR 1
14#define HAVE_STRCHRNUL 1 18#define HAVE_STRCHRNUL 1
19#define HAVE_STRSIGNAL 1
15#define HAVE_VASPRINTF 1 20#define HAVE_VASPRINTF 1
16 21
17/* Convenience macros to test the version of gcc. */ 22/* Convenience macros to test the version of gcc. */
@@ -335,17 +340,22 @@ typedef unsigned smalluint;
335#endif 340#endif
336 341
337#if defined(__dietlibc__) 342#if defined(__dietlibc__)
338#undef HAVE_STRCHRNUL 343# undef HAVE_STRCHRNUL
339#endif 344#endif
340 345
341#if defined(__WATCOMC__) 346#if defined(__WATCOMC__)
342#undef HAVE_FDPRINTF 347# undef HAVE_FDPRINTF
343#undef HAVE_STRCHRNUL 348# undef HAVE_MEMRCHR
344#undef HAVE_VASPRINTF 349# undef HAVE_MKDTEMP
350# undef HAVE_SETBIT
351# undef HAVE_STRCASESTR
352# undef HAVE_STRCHRNUL
353# undef HAVE_STRSIGNAL
354# undef HAVE_VASPRINTF
345#endif 355#endif
346 356
347#if defined(__FreeBSD__) 357#if defined(__FreeBSD__)
348#undef HAVE_STRCHRNUL 358# undef HAVE_STRCHRNUL
349#endif 359#endif
350 360
351/* 361/*
@@ -353,16 +363,38 @@ typedef unsigned smalluint;
353 * These must come after all the HAVE_* macros are defined (or not) 363 * These must come after all the HAVE_* macros are defined (or not)
354 */ 364 */
355 365
366#ifndef HAVE_FDPRINTF
367extern int fdprintf(int fd, const char *format, ...);
368#endif
369
370#ifndef HAVE_MEMRCHR
371extern void *memrchr(const void *s, int c, size_t n) FAST_FUNC;
372#endif
373
374#ifndef HAVE_MKDTEMP
375extern char *mkdtemp(char *template) FAST_FUNC;
376#endif
377
378#ifndef HAVE_SETBIT
379# define setbit(a, b) ((a)[(b) >> 3] |= 1 << ((b) & 7))
380# define clrbit(a, b) ((a)[(b) >> 3] &= ~(1 << ((b) & 7)))
381#endif
382
383#ifndef HAVE_STRCASESTR
384extern char *strcasestr(const char *s, const char *pattern) FAST_FUNC;
385#endif
386
356#ifndef HAVE_STRCHRNUL 387#ifndef HAVE_STRCHRNUL
357extern char *strchrnul(const char *s, int c) FAST_FUNC; 388extern char *strchrnul(const char *s, int c) FAST_FUNC;
358#endif 389#endif
359 390
360#ifndef HAVE_VASPRINTF 391#ifndef HAVE_STRSIGNAL
361extern int vasprintf(char **string_ptr, const char *format, va_list p) FAST_FUNC; 392/* Not exactly the same: instead of "Stopped" it shows "STOP" etc */
393# define strsignal(sig) get_signame(sig)
362#endif 394#endif
363 395
364#ifndef HAVE_FDPRINTF 396#ifndef HAVE_VASPRINTF
365extern int fdprintf(int fd, const char *format, ...); 397extern int vasprintf(char **string_ptr, const char *format, va_list p) FAST_FUNC;
366#endif 398#endif
367 399
368#endif 400#endif