From 763f49b4fa0e37a41735c773e04d77ee827156bd Mon Sep 17 00:00:00 2001
From: joerg_wunsch <joerg_wunsch@81a1dc3b-b13d-400b-aceb-764788c761c2>
Date: Fri, 26 Aug 2011 05:46:50 +0000
Subject: [PATCH] Reported by Jason Hecker: * usbasp.c (libusb_to_errno):
 Conditionalize some error codes that apparently are lacking on MinGW.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@982 81a1dc3b-b13d-400b-aceb-764788c761c2
---
 ChangeLog | 6 ++++++
 usbasp.c  | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index ac826857..b555d636 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-08-26  Joerg Wunsch <j.gnu@uriah.heep.sax.de>
+
+	Reported by Jason Hecker:
+	* usbasp.c (libusb_to_errno): Conditionalize some error codes
+	that apparently are lacking on MinGW.
+
 2011-08-25  Joerg Wunsch <j.gnu@uriah.heep.sax.de>
 
 	Fix warnings.
diff --git a/usbasp.c b/usbasp.c
index a3f0ea37..e85d0a9f 100644
--- a/usbasp.c
+++ b/usbasp.c
@@ -77,10 +77,14 @@ static int libusb_to_errno(int result)
 		return ENOENT;
 	case LIBUSB_ERROR_BUSY:
 		return EBUSY;
+#ifdef ETIMEDOUT
 	case LIBUSB_ERROR_TIMEOUT:
 		return ETIMEDOUT;
+#endif
+#ifdef EOVERFLOW
 	case LIBUSB_ERROR_OVERFLOW:
 		return EOVERFLOW;
+#endif
 	case LIBUSB_ERROR_PIPE:
 		return EPIPE;
 	case LIBUSB_ERROR_INTERRUPTED: