more cygwin related build fixes
authorFlorian Fainelli <florian@openwrt.org>
Tue, 14 Apr 2009 14:54:34 +0000 (14:54 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Tue, 14 Apr 2009 14:54:34 +0000 (14:54 +0000)
SVN-Revision: 15227

tools/include/byteswap.h
tools/include/endian.h
tools/include/getline.h

index 61047167c3df957690496d22360d3d8de142c33d..fe279ceb2c040de1e07e40e979282f50a9ddaf39 100644 (file)
@@ -1,3 +1,3 @@
-#ifdef __linux__
+#if defined(__linux__) || defined(__CYGWIN__) 
 #include_next <byteswap.h>
 #endif
index 25d100de324e547780ad8674fd54ce5837fe03ae..0f17b41da73f50aa21c2a51ac5695862c982db2f 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __endian_compat_h
 #define __endian_compat_h
 
-#if defined(__linux__)
+#if defined(__linux__) || defined(__CYGWIN__)
 #include <byteswap.h>
 #include_next <endian.h>
 #elif defined(__APPLE__)
index 219be752049fa9f8e15287782f4b38cbd7c01e63..b9a3f7150fd792e9007a8303d35ab009f12df05e 100644 (file)
 static inline ssize_t
 getline(char **outbuf, size_t *outsize, FILE *fp)
 {
-       char *buf;
        size_t len;
 
+#ifndef __CYGWIN__
+       char *buf;
        buf = fgetln(fp, &len);
+#else
+       char buf[512];
+       fgets(buf, sizeof(buf), fp);    
+       len = strlen(buf);
+#endif
        if (buf == NULL)
                return (-1);