From: Florian Fainelli Date: Tue, 14 Apr 2009 14:54:34 +0000 (+0000) Subject: more cygwin related build fixes X-Git-Tag: reboot~23977 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b8e09787fac3a13854e53e3a7a6707d39563ae68;p=openwrt%2Fstaging%2Flynxis.git more cygwin related build fixes SVN-Revision: 15227 --- diff --git a/tools/include/byteswap.h b/tools/include/byteswap.h index 61047167c3..fe279ceb2c 100644 --- a/tools/include/byteswap.h +++ b/tools/include/byteswap.h @@ -1,3 +1,3 @@ -#ifdef __linux__ +#if defined(__linux__) || defined(__CYGWIN__) #include_next #endif diff --git a/tools/include/endian.h b/tools/include/endian.h index 25d100de32..0f17b41da7 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 #include_next #elif defined(__APPLE__) diff --git a/tools/include/getline.h b/tools/include/getline.h index 219be75204..b9a3f7150f 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);