From b9923df170104320e55bff05ecc2a0105067f9cb Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Wed, 9 Jan 2013 22:04:50 +0000 Subject: [PATCH] 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 --- utils/imxtools/scsitools/README.win32 | 6 ++++++ utils/imxtools/scsitools/scsitool.c | 7 +++++++ utils/nwztools/scsitools/scsitool.c | 7 +++++++ 3 files changed, 20 insertions(+) create mode 100644 utils/imxtools/scsitools/README.win32 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 @@ +This tool can be compiled under Windows with MinGW and the Windows port of sg3_util. +Everything runs unmodified with MSYS except perhaps for +- the library in which case you might have to change the LDFLAGS in Makefile to: +LDFLAGS=/usr/local/lib/libsgutils2.a +- the include directory in which case you might have to change the DEFINES in Makefile to: +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 @@ #include #include #include +#ifndef _WIN32 #include +#endif #include #include #include "misc.h" #include "stmp_scsi.h" +/* the windows port doesn't have scsi.h and GOOD */ +#ifndef GOOD +#define GOOD 0x00 +#endif + bool g_debug = false; bool g_force = false; int g_dev_fd = 0; diff --git a/utils/nwztools/scsitools/scsitool.c b/utils/nwztools/scsitools/scsitool.c index ba4a1475bc..7e2dcd9967 100644 --- a/utils/nwztools/scsitools/scsitool.c +++ b/utils/nwztools/scsitools/scsitool.c @@ -31,12 +31,19 @@ #include #include #include +#ifndef _WIN32 #include +#endif #include #include #include "misc.h" #include "para_noise.h" +/* the windows port doesn't have scsi.h and GOOD */ +#ifndef GOOD +#define GOOD 0x00 +#endif + bool g_debug = false; bool g_force = false; char *g_out_prefix = NULL; -- 2.11.4.GIT