Bläddra i källkod

more cygwin related build fixes

SVN-Revision: 15227
Florian Fainelli 16 år sedan
förälder
incheckning
b8e09787fa
3 ändrade filer med 9 tillägg och 3 borttagningar
  1. 1 1
      tools/include/byteswap.h
  2. 1 1
      tools/include/endian.h
  3. 7 1
      tools/include/getline.h

+ 1 - 1
tools/include/byteswap.h

@@ -1,3 +1,3 @@
-#ifdef __linux__
+#if defined(__linux__) || defined(__CYGWIN__) 
 #include_next <byteswap.h>
 #endif

+ 1 - 1
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__)

+ 7 - 1
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);