2009-11-02 14:52:09 +00:00
|
|
|
--- a/squashfs-tools/global.h
|
|
|
|
+++ b/squashfs-tools/global.h
|
|
|
|
@@ -44,6 +44,11 @@ typedef long long squashfs_fragment_inde
|
2009-08-27 19:47:13 +00:00
|
|
|
typedef squashfs_inode_t squashfs_inode;
|
|
|
|
typedef squashfs_block_t squashfs_block;
|
|
|
|
|
|
|
|
+#ifdef __CYGWIN__
|
|
|
|
+#include <sys/termios.h>
|
|
|
|
+#define FNM_EXTMATCH (1 << 5)
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#ifndef FNM_EXTMATCH
|
|
|
|
#define FNM_EXTMATCH 0
|
|
|
|
#endif
|
2009-11-02 14:52:09 +00:00
|
|
|
--- a/squashfs-tools/mksquashfs.c
|
|
|
|
+++ b/squashfs-tools/mksquashfs.c
|
2009-08-27 19:47:13 +00:00
|
|
|
@@ -49,10 +49,12 @@
|
2009-11-02 14:52:09 +00:00
|
|
|
#include <sys/wait.h>
|
2009-08-27 19:47:13 +00:00
|
|
|
|
|
|
|
#ifndef linux
|
|
|
|
+#ifndef __CYGWIN__
|
|
|
|
#define __BYTE_ORDER BYTE_ORDER
|
|
|
|
#define __BIG_ENDIAN BIG_ENDIAN
|
|
|
|
#define __LITTLE_ENDIAN LITTLE_ENDIAN
|
|
|
|
#include <sys/sysctl.h>
|
|
|
|
+#endif /* __CYGWIN__ */
|
|
|
|
#else
|
|
|
|
#include <endian.h>
|
|
|
|
#include <sys/sysinfo.h>
|
2009-11-02 14:52:09 +00:00
|
|
|
@@ -817,6 +819,7 @@ void sigusr1_handler()
|
2009-08-27 19:47:13 +00:00
|
|
|
|
|
|
|
void sigwinch_handler()
|
|
|
|
{
|
|
|
|
+#ifndef __CYGWIN__
|
|
|
|
struct winsize winsize;
|
|
|
|
|
|
|
|
if(ioctl(1, TIOCGWINSZ, &winsize) == -1) {
|
2009-11-02 14:52:09 +00:00
|
|
|
@@ -826,6 +829,9 @@ void sigwinch_handler()
|
2009-08-27 19:47:13 +00:00
|
|
|
columns = 80;
|
|
|
|
} else
|
|
|
|
columns = winsize.ws_col;
|
|
|
|
+#else
|
|
|
|
+ columns = 80;
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-11-02 14:52:09 +00:00
|
|
|
@@ -3853,7 +3859,9 @@ void initialise_threads()
|
2009-08-27 19:47:13 +00:00
|
|
|
BAD_ERROR("Failed to set signal mask in intialise_threads\n");
|
|
|
|
|
|
|
|
signal(SIGUSR1, sigusr1_handler);
|
|
|
|
-
|
|
|
|
+#ifdef __CYGWIN__
|
|
|
|
+ processors = atoi(getenv("NUMBER_OF_PROCESSORS"));
|
|
|
|
+#else
|
|
|
|
if(processors == -1) {
|
|
|
|
#ifndef linux
|
|
|
|
int mib[2];
|
2009-11-02 14:52:09 +00:00
|
|
|
@@ -3875,6 +3883,7 @@ void initialise_threads()
|
2009-08-27 19:47:13 +00:00
|
|
|
processors = get_nprocs();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
+#endif /* __CYGWIN__ */
|
|
|
|
|
|
|
|
if((thread = malloc((2 + processors * 2) * sizeof(pthread_t))) == NULL)
|
|
|
|
BAD_ERROR("Out of memory allocating thread descriptors\n");
|
2009-11-02 14:52:09 +00:00
|
|
|
--- a/squashfs-tools/read_fs.c
|
|
|
|
+++ b/squashfs-tools/read_fs.c
|
|
|
|
@@ -39,9 +39,11 @@ extern unsigned int get_guid(unsigned in
|
2009-08-27 19:47:13 +00:00
|
|
|
#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
|
2009-11-02 14:52:09 +00:00
|
|
|
--- a/squashfs-tools/swap.c
|
|
|
|
+++ b/squashfs-tools/swap.c
|
2009-08-27 19:47:13 +00:00
|
|
|
@@ -20,9 +20,11 @@
|
|
|
|
*/
|
|
|
|
|
|
|
|
#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
|
2009-11-02 14:52:09 +00:00
|
|
|
--- a/squashfs-tools/unsquashfs.c
|
|
|
|
+++ b/squashfs-tools/unsquashfs.c
|
|
|
|
@@ -112,6 +112,7 @@ void update_progress_bar();
|
2009-08-27 19:47:13 +00:00
|
|
|
|
|
|
|
void sigwinch_handler()
|
|
|
|
{
|
|
|
|
+#ifndef __CYGWIN__
|
|
|
|
struct winsize winsize;
|
|
|
|
|
|
|
|
if(ioctl(1, TIOCGWINSZ, &winsize) == -1) {
|
2009-11-02 14:52:09 +00:00
|
|
|
@@ -121,6 +122,9 @@ void sigwinch_handler()
|
2009-08-27 19:47:13 +00:00
|
|
|
columns = 80;
|
|
|
|
} else
|
|
|
|
columns = winsize.ws_col;
|
|
|
|
+#else
|
|
|
|
+ columns = 80;
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-11-02 14:52:09 +00:00
|
|
|
@@ -1787,7 +1791,9 @@ void initialise_threads(int fragment_buf
|
2009-08-27 19:47:13 +00:00
|
|
|
if(sigprocmask(SIG_BLOCK, &sigmask, &old_mask) == -1)
|
|
|
|
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];
|
2009-11-02 14:52:09 +00:00
|
|
|
@@ -1809,6 +1815,7 @@ void initialise_threads(int fragment_buf
|
2009-08-27 19:47:13 +00:00
|
|
|
processors = get_nprocs();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
+#endif /* __CYGWIN__ */
|
|
|
|
|
|
|
|
if((thread = malloc((3 + processors) * sizeof(pthread_t))) == NULL)
|
|
|
|
EXIT_UNSQUASH("Out of memory allocating thread descriptors\n");
|
2009-11-02 14:52:09 +00:00
|
|
|
--- a/squashfs-tools/unsquashfs.h
|
|
|
|
+++ b/squashfs-tools/unsquashfs.h
|
|
|
|
@@ -45,10 +45,12 @@
|
2009-08-27 19:47:13 +00:00
|
|
|
#include <sys/time.h>
|
|
|
|
|
|
|
|
#ifndef linux
|
|
|
|
+#ifndef __CYGWIN__
|
|
|
|
#define __BYTE_ORDER BYTE_ORDER
|
|
|
|
#define __BIG_ENDIAN BIG_ENDIAN
|
|
|
|
#define __LITTLE_ENDIAN LITTLE_ENDIAN
|
|
|
|
#include <sys/sysctl.h>
|
|
|
|
+#endif /* __CYGWIN__ */
|
|
|
|
#else
|
|
|
|
#include <endian.h>
|
|
|
|
#include <sys/sysinfo.h>
|