diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-01-09 22:04:50 +0000 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-01-10 00:51:35 +0000 |
commit | b9923df170104320e55bff05ecc2a0105067f9cb (patch) | |
tree | 15e28db88edcd033fe70daf7b0d6ae41647cad60 /utils/imxtools | |
parent | 758a3ae4bb2f9bd02b99f11a9828f172ee2a0328 (diff) | |
download | rockbox-b9923df170104320e55bff05ecc2a0105067f9cb.tar.gz rockbox-b9923df170104320e55bff05ecc2a0105067f9cb.zip |
imxtools/nwztools: fix compilation for windows
There is a windows port of the sg_utils library for scsi pass-
through. This little changes make it compile under mingw. A better
fix would be to implement direct ioctl on both windows and linux
but that's already better than nothing
Change-Id: I0d77cd1bad69806a66f0590362f165f24fa240e9
Diffstat (limited to 'utils/imxtools')
-rw-r--r-- | utils/imxtools/scsitools/README.win32 | 6 | ||||
-rw-r--r-- | utils/imxtools/scsitools/scsitool.c | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/utils/imxtools/scsitools/README.win32 b/utils/imxtools/scsitools/README.win32 new file mode 100644 index 0000000000..1288850b11 --- /dev/null +++ b/utils/imxtools/scsitools/README.win32 | |||
@@ -0,0 +1,6 @@ | |||
1 | This tool can be compiled under Windows with MinGW and the Windows port of sg3_util. | ||
2 | Everything runs unmodified with MSYS except perhaps for | ||
3 | - the library in which case you might have to change the LDFLAGS in Makefile to: | ||
4 | LDFLAGS=/usr/local/lib/libsgutils2.a | ||
5 | - the include directory in which case you might have to change the DEFINES in Makefile to: | ||
6 | DEFINES=-I/usr/local/include | ||
diff --git a/utils/imxtools/scsitools/scsitool.c b/utils/imxtools/scsitools/scsitool.c index 5fe3f6fa8a..c534667f05 100644 --- a/utils/imxtools/scsitools/scsitool.c +++ b/utils/imxtools/scsitools/scsitool.c | |||
@@ -31,12 +31,19 @@ | |||
31 | #include <sys/stat.h> | 31 | #include <sys/stat.h> |
32 | #include <fcntl.h> | 32 | #include <fcntl.h> |
33 | #include <unistd.h> | 33 | #include <unistd.h> |
34 | #ifndef _WIN32 | ||
34 | #include <scsi/scsi.h> | 35 | #include <scsi/scsi.h> |
36 | #endif | ||
35 | #include <scsi/sg_lib.h> | 37 | #include <scsi/sg_lib.h> |
36 | #include <scsi/sg_pt.h> | 38 | #include <scsi/sg_pt.h> |
37 | #include "misc.h" | 39 | #include "misc.h" |
38 | #include "stmp_scsi.h" | 40 | #include "stmp_scsi.h" |
39 | 41 | ||
42 | /* the windows port doesn't have scsi.h and GOOD */ | ||
43 | #ifndef GOOD | ||
44 | #define GOOD 0x00 | ||
45 | #endif | ||
46 | |||
40 | bool g_debug = false; | 47 | bool g_debug = false; |
41 | bool g_force = false; | 48 | bool g_force = false; |
42 | int g_dev_fd = 0; | 49 | int g_dev_fd = 0; |