[backfire] tools: merge r27916 (OS X 10.7 getline fix)
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 1 Feb 2012 21:10:53 +0000 (21:10 +0000)
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 1 Feb 2012 21:10:53 +0000 (21:10 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/branches/backfire@29983 3c298f89-4303-0410-b956-a3cf2f4a3e73

tools/include/getline.h

index b9a3f71..02df6c2 100644 (file)
  * SUCH DAMAGE.
  */
 
-#ifndef __linux__
 #include <sys/types.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
+#if !defined(__linux__) && !(defined(__APPLE__) && __DARWIN_C_LEVEL >= 200809L)
 /*
  * Emulate glibc getline() via BSD fgetln().
  * Note that outsize is not changed unless memory is allocated.