Commit f8e80630796cd65ada70f9bf49a8737cfcd444ca

Guillem Jover 2012-01-03T08:40:18

Base fgetln() implementation on getline presence instead of glibc

diff --git a/configure.ac b/configure.ac
index ce697a3..fd8b5d7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,7 +54,7 @@ AC_LINK_IFELSE(
 	 AC_MSG_RESULT([yes])],
 	[AC_MSG_RESULT([no])])
 
-AC_CHECK_FUNCS([dirfd getexecname sysconf])
+AC_CHECK_FUNCS([dirfd getexecname getline sysconf])
 
 AC_CONFIG_FILES([
 	Makefile
diff --git a/src/fgetln.c b/src/fgetln.c
index b79584c..87bd2e9 100644
--- a/src/fgetln.c
+++ b/src/fgetln.c
@@ -30,7 +30,7 @@
 #include <sys/types.h>
 #include <string.h>
 
-#ifdef __GLIBC__
+#ifdef HAVE_GETLINE
 char *
 fgetln(FILE *stream, size_t *len)
 {