mirror of
https://github.com/sheumann/hush.git
synced 2024-12-24 12:29:47 +00:00
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>
This commit is contained in:
parent
0a5b310067
commit
0e79e7bb42
@ -376,6 +376,7 @@ typedef unsigned smalluint;
|
|||||||
|
|
||||||
#if defined(__WATCOMC__)
|
#if defined(__WATCOMC__)
|
||||||
# undef HAVE_DPRINTF
|
# undef HAVE_DPRINTF
|
||||||
|
# undef HAVE_GETLINE
|
||||||
# undef HAVE_MEMRCHR
|
# undef HAVE_MEMRCHR
|
||||||
# undef HAVE_MKDTEMP
|
# undef HAVE_MKDTEMP
|
||||||
# undef HAVE_SETBIT
|
# undef HAVE_SETBIT
|
||||||
@ -389,15 +390,13 @@ typedef unsigned smalluint;
|
|||||||
# undef HAVE_NET_ETHERNET_H
|
# undef HAVE_NET_ETHERNET_H
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__FreeBSD__)
|
/* These BSD-derived OSes share many similarities */
|
||||||
# undef HAVE_STRCHRNUL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (defined __digital__ && defined __unix__) \
|
#if (defined __digital__ && defined __unix__) \
|
||||||
|| defined __APPLE__ \
|
|| defined __APPLE__ \
|
||||||
|| defined __FreeBSD__ || defined __OpenBSD__ || defined __NetBSD__
|
|| defined __FreeBSD__ || defined __OpenBSD__ || defined __NetBSD__
|
||||||
# undef HAVE_CLEARENV
|
# undef HAVE_CLEARENV
|
||||||
# undef HAVE_FDATASYNC
|
# undef HAVE_FDATASYNC
|
||||||
|
# undef HAVE_GETLINE
|
||||||
# undef HAVE_MNTENT_H
|
# undef HAVE_MNTENT_H
|
||||||
# undef HAVE_PTSNAME_R
|
# undef HAVE_PTSNAME_R
|
||||||
# undef HAVE_SYS_STATFS_H
|
# undef HAVE_SYS_STATFS_H
|
||||||
@ -407,13 +406,21 @@ typedef unsigned smalluint;
|
|||||||
# undef HAVE_DPRINTF
|
# undef HAVE_DPRINTF
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__FreeBSD__)
|
||||||
|
# undef HAVE_STRCHRNUL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__NetBSD__)
|
||||||
|
# define HAVE_GETLINE 1 /* Recent NetBSD versions have getline() */
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__digital__) && defined(__unix__)
|
#if defined(__digital__) && defined(__unix__)
|
||||||
# undef HAVE_STPCPY
|
# undef HAVE_STPCPY
|
||||||
# undef HAVE_STRVERSCMP
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ANDROID)
|
#if defined(ANDROID)
|
||||||
# undef HAVE_DPRINTF
|
# undef HAVE_DPRINTF
|
||||||
|
# undef HAVE_GETLINE
|
||||||
# undef HAVE_STPCPY
|
# undef HAVE_STPCPY
|
||||||
# undef HAVE_STRCHRNUL
|
# undef HAVE_STRCHRNUL
|
||||||
# undef HAVE_STRVERSCMP
|
# undef HAVE_STRVERSCMP
|
||||||
@ -472,6 +479,7 @@ extern int vasprintf(char **string_ptr, const char *format, va_list p) FAST_FUNC
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_GETLINE
|
#ifndef HAVE_GETLINE
|
||||||
|
#include <stdio.h> /* for FILE */
|
||||||
extern ssize_t getline(char **lineptr, size_t *n, FILE *stream) FAST_FUNC;
|
extern ssize_t getline(char **lineptr, size_t *n, FILE *stream) FAST_FUNC;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user