[tools] more cygwin related build fixes
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 14 Apr 2009 14:54:34 +0000 (14:54 +0000)
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 14 Apr 2009 14:54:34 +0000 (14:54 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15227 3c298f89-4303-0410-b956-a3cf2f4a3e73

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

index 6104716..fe279ce 100644 (file)
@@ -1,3 +1,3 @@
-#ifdef __linux__
+#if defined(__linux__) || defined(__CYGWIN__) 
 #include_next <byteswap.h>
 #endif
index 25d100d..0f17b41 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 219be75..b9a3f71 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);
 
This page took 0.024944 seconds and 4 git commands to generate.