Apple has finally updated their version of Libc, and it now includes getline(). 
\o/

The following patch fixes OpenWRT getline.h to not redefine it for 10.7. The 
one caveat is, the includes (at least stdio.h) are needed before the #ifdef so 
that __DARWIN_C_LEVEL could be properly defined (it is not a compiler built-in 
define like __linux__ or __APPLE__).

This one fixes the host/include/getline.h. The next patch will mend the mkimage 
package.

Signed-off-by: Joe Roback <openwrt-de...@roback.cc>

Attachment: mac_lion_10.7-getline.patch
Description: Binary data


---

Index: tools/include/getline.h
===================================================================
--- tools/include/getline.h     (revision 27842)
+++ tools/include/getline.h     (working copy)
@@ -27,12 +27,12 @@
  * 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.

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to