aboutsummaryrefslogtreecommitdiff
path: root/include/platform.h
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2011-06-28 23:03:27 -0700
committerDenys Vlasenko <vda.linux@googlemail.com>2011-06-30 02:11:49 +0200
commit0e79e7bb420c58fa8e5d2d88c5d3a26f94c761af (patch)
tree9545d2daaf7167c92442985f4178d17ef5d9de69 /include/platform.h
parent0a5b310067abfde9bf74a42352fc421e1c27e2b9 (diff)
downloadbusybox-w32-0e79e7bb420c58fa8e5d2d88c5d3a26f94c761af.tar.gz
busybox-w32-0e79e7bb420c58fa8e5d2d88c5d3a26f94c761af.tar.bz2
busybox-w32-0e79e7bb420c58fa8e5d2d88c5d3a26f94c761af.zip
Use the built-in getline on more systems that don't have it
Signed-off-by: Dan Fandrich <dan@coneharvesters.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include/platform.h')
-rw-r--r--include/platform.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/include/platform.h b/include/platform.h
index eafc3fcfe..d186e4911 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -376,6 +376,7 @@ typedef unsigned smalluint;
376 376
377#if defined(__WATCOMC__) 377#if defined(__WATCOMC__)
378# undef HAVE_DPRINTF 378# undef HAVE_DPRINTF
379# undef HAVE_GETLINE
379# undef HAVE_MEMRCHR 380# undef HAVE_MEMRCHR
380# undef HAVE_MKDTEMP 381# undef HAVE_MKDTEMP
381# undef HAVE_SETBIT 382# undef HAVE_SETBIT
@@ -389,15 +390,13 @@ typedef unsigned smalluint;
389# undef HAVE_NET_ETHERNET_H 390# undef HAVE_NET_ETHERNET_H
390#endif 391#endif
391 392
392#if defined(__FreeBSD__) 393/* These BSD-derived OSes share many similarities */
393# undef HAVE_STRCHRNUL
394#endif
395
396#if (defined __digital__ && defined __unix__) \ 394#if (defined __digital__ && defined __unix__) \
397 || defined __APPLE__ \ 395 || defined __APPLE__ \
398 || defined __FreeBSD__ || defined __OpenBSD__ || defined __NetBSD__ 396 || defined __FreeBSD__ || defined __OpenBSD__ || defined __NetBSD__
399# undef HAVE_CLEARENV 397# undef HAVE_CLEARENV
400# undef HAVE_FDATASYNC 398# undef HAVE_FDATASYNC
399# undef HAVE_GETLINE
401# undef HAVE_MNTENT_H 400# undef HAVE_MNTENT_H
402# undef HAVE_PTSNAME_R 401# undef HAVE_PTSNAME_R
403# undef HAVE_SYS_STATFS_H 402# undef HAVE_SYS_STATFS_H
@@ -407,13 +406,21 @@ typedef unsigned smalluint;
407# undef HAVE_DPRINTF 406# undef HAVE_DPRINTF
408#endif 407#endif
409 408
409#if defined(__FreeBSD__)
410# undef HAVE_STRCHRNUL
411#endif
412
413#if defined(__NetBSD__)
414# define HAVE_GETLINE 1 /* Recent NetBSD versions have getline() */
415#endif
416
410#if defined(__digital__) && defined(__unix__) 417#if defined(__digital__) && defined(__unix__)
411# undef HAVE_STPCPY 418# undef HAVE_STPCPY
412# undef HAVE_STRVERSCMP
413#endif 419#endif
414 420
415#if defined(ANDROID) 421#if defined(ANDROID)
416# undef HAVE_DPRINTF 422# undef HAVE_DPRINTF
423# undef HAVE_GETLINE
417# undef HAVE_STPCPY 424# undef HAVE_STPCPY
418# undef HAVE_STRCHRNUL 425# undef HAVE_STRCHRNUL
419# undef HAVE_STRVERSCMP 426# undef HAVE_STRVERSCMP
@@ -472,6 +479,7 @@ extern int vasprintf(char **string_ptr, const char *format, va_list p) FAST_FUNC
472#endif 479#endif
473 480
474#ifndef HAVE_GETLINE 481#ifndef HAVE_GETLINE
482#include <stdio.h> /* for FILE */
475extern ssize_t getline(char **lineptr, size_t *n, FILE *stream) FAST_FUNC; 483extern ssize_t getline(char **lineptr, size_t *n, FILE *stream) FAST_FUNC;
476#endif 484#endif
477 485