summaryrefslogtreecommitdiffstats
path: root/tools/include
diff options
context:
space:
mode:
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-04-14 14:54:34 +0000
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-04-14 14:54:34 +0000
commita6e38696e866f017f293899d2622a63147909df3 (patch)
treeee37be750da98c6c1674de6125b90a74ce0b9c89 /tools/include
parentb2b8e3bed89afe2008ad741bc05b313715c56b64 (diff)
[tools] more cygwin related build fixes
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15227 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'tools/include')
-rw-r--r--tools/include/byteswap.h2
-rw-r--r--tools/include/endian.h2
-rw-r--r--tools/include/getline.h8
3 files changed, 9 insertions, 3 deletions
diff --git a/tools/include/byteswap.h b/tools/include/byteswap.h
index 61047167c..fe279ceb2 100644
--- a/tools/include/byteswap.h
+++ b/tools/include/byteswap.h
@@ -1,3 +1,3 @@
-#ifdef __linux__
+#if defined(__linux__) || defined(__CYGWIN__)
#include_next <byteswap.h>
#endif
diff --git a/tools/include/endian.h b/tools/include/endian.h
index 25d100de3..0f17b41da 100644
--- a/tools/include/endian.h
+++ b/tools/include/endian.h
@@ -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__)
diff --git a/tools/include/getline.h b/tools/include/getline.h
index 219be7520..b9a3f7150 100644
--- a/tools/include/getline.h
+++ b/tools/include/getline.h
@@ -40,10 +40,16 @@
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);