diff -rupN squashfs4.0_org/squashfs-tools/global.h squashfs4.0/squashfs-tools/global.h
--- squashfs4.0_org/squashfs-tools/global.h 2009-03-16 00:03:54.000000000 -0400
+++ squashfs4.0/squashfs-tools/global.h 2010-09-02 14:46:26.732375000 -0400
@@ -44,4 +44,9 @@ typedef long long squashfs_fragment_inde
typedef squashfs_inode_t squashfs_inode;
typedef squashfs_block_t squashfs_block;
+#ifdef __CYGWIN__
+#include <sys/termios.h>
+#define FNM_EXTMATCH (1 << 5)
+#endif
+
#endif
diff -rupN squashfs4.0_org/squashfs-tools/mksquashfs.c squashfs4.0/squashfs-tools/mksquashfs.c
--- squashfs4.0_org/squashfs-tools/mksquashfs.c 2009-04-05 17:22:48.000000000 -0400
+++ squashfs4.0/squashfs-tools/mksquashfs.c 2010-09-02 14:57:08.435500000 -0400
@@ -49,10 +49,14 @@
#include <fnmatch.h>
#ifndef linux
+#ifndef __CYGWIN__
#define __BYTE_ORDER BYTE_ORDER
#define __BIG_ENDIAN BIG_ENDIAN
#define __LITTLE_ENDIAN LITTLE_ENDIAN
+#endif
+#ifndef __CYGWIN__
#include <sys/sysctl.h>
+#endif
#else
#include <endian.h>
#include <sys/sysinfo.h>
@@ -3687,6 +3691,9 @@ void initialise_threads()
signal(SIGUSR1, sigusr1_handler);
+#ifdef __CYGWIN__
+ processors = atoi(getenv("NUMBER_OF_PROCESSORS"));
+#else
if(processors == -1) {
#ifndef linux
int mib[2];
@@ -3708,6 +3715,7 @@ void initialise_threads()
processors = get_nprocs();
#endif
}
+#endif
if((thread = malloc((2 + processors * 2) * sizeof(pthread_t))) == NULL)
BAD_ERROR("Out of memory allocating thread descriptors\n");
@@ -3962,7 +3970,6 @@ int excluded(struct pathnames *paths, ch
return FALSE;
}
-
*new = init_subdir();
if(stickypath)
*new = add_subdir(*new, stickypath);
diff -rupN squashfs4.0_org/squashfs-tools/read_fs.c squashfs4.0/squashfs-tools/read_fs.c
--- squashfs4.0_org/squashfs-tools/read_fs.c 2009-03-31 00:23:14.000000000 -0400
+++ squashfs4.0/squashfs-tools/read_fs.c 2010-09-02 14:45:20.998000000 -0400
@@ -40,9 +40,11 @@ extern unsigned int get_guid(unsigned in
#include <sys/mman.h>
#ifndef linux
+#ifndef __CYGWIN__
#define __BYTE_ORDER BYTE_ORDER
#define __BIG_ENDIAN BIG_ENDIAN
#define __LITTLE_ENDIAN LITTLE_ENDIAN
+#endif
#else
#include <endian.h>
#endif
diff -rupN squashfs4.0_org/squashfs-tools/unsquashfs.c squashfs4.0/squashfs-tools/unsquashfs.c
--- squashfs4.0_org/squashfs-tools/unsquashfs.c 2009-04-05 17:23:06.000000000 -0400
+++ squashfs4.0/squashfs-tools/unsquashfs.c 2010-09-02 14:44:58.013625000 -0400
@@ -110,6 +110,7 @@ void update_progress_bar();
void sigwinch_handler()
{
+#ifndef __CYGWIN__
struct winsize winsize;
if(ioctl(1, TIOCGWINSZ, &winsize) == -1) {
@@ -119,6 +120,9 @@ void sigwinch_handler()
columns = 80;
} else
columns = winsize.ws_col;
+#else
+ columns = 80;
+#endif
}
@@ -1793,6 +1797,9 @@ void initialise_threads(int fragment_buf
EXIT_UNSQUASH("Failed to set signal mask in intialise_threads"
"\n");
+#ifdef __CYGWIN__
+ processors = atoi(getenv("NUMBER_OF_PROCESSORS"));
+#else
if(processors == -1) {
#ifndef linux
int mib[2];
@@ -1814,6 +1821,7 @@ void initialise_threads(int fragment_buf
processors = get_nprocs();
#endif
}
+#endif
if((thread = malloc((3 + processors) * sizeof(pthread_t))) == NULL)
EXIT_UNSQUASH("Out of memory allocating thread descriptors\n");
diff -rupN squashfs4.0_org/squashfs-tools/unsquashfs.h squashfs4.0/squashfs-tools/unsquashfs.h
--- squashfs4.0_org/squashfs-tools/unsquashfs.h 2009-03-28 22:29:02.000000000 -0400
+++ squashfs4.0/squashfs-tools/unsquashfs.h 2010-09-02 14:42:21.154250000 -0400
@@ -46,9 +46,11 @@
#include <sys/time.h>
#ifndef linux
+#ifndef __CYGWIN__
#define __BYTE_ORDER BYTE_ORDER
#define __BIG_ENDIAN BIG_ENDIAN
#define __LITTLE_ENDIAN LITTLE_ENDIAN
+#endif
#else
#include <endian.h>
#endif