summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dickens <christopher.a.dickens@gmail.com>2014-09-03 10:10:23 -0700
committerChris Dickens <christopher.a.dickens@gmail.com>2014-09-03 10:10:23 -0700
commit8035a7748980704c439b5d729bed8a0d75d47046 (patch)
tree9f6878c07645159596148a2d2a5c3cb1e3744798
parent4e95d0e7f90ea8bb900df61ef6e6dd4bbece114c (diff)
downloadlibusb-8035a7748980704c439b5d729bed8a0d75d47046.tar.gz
core: Fix compiler warnings on MinGW and Visual Studio
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
-rw-r--r--libusb/libusbi.h19
-rw-r--r--libusb/version_nano.h2
2 files changed, 12 insertions, 9 deletions
diff --git a/libusb/libusbi.h b/libusb/libusbi.h
index 620ce7e..bead373 100644
--- a/libusb/libusbi.h
+++ b/libusb/libusbi.h
@@ -220,14 +220,6 @@ static inline void usbi_dbg(const char *format, ...)
#define IS_XFERIN(xfer) (0 != ((xfer)->endpoint & LIBUSB_ENDPOINT_IN))
#define IS_XFEROUT(xfer) (!IS_XFERIN(xfer))
-/* Internal abstraction for poll (needs struct usbi_transfer on Windows) */
-#if defined(OS_LINUX) || defined(OS_DARWIN) || defined(OS_OPENBSD) || defined(OS_NETBSD)
-#include <unistd.h>
-#include "os/poll_posix.h"
-#elif defined(OS_WINDOWS) || defined(OS_WINCE)
-#include "os/poll_windows.h"
-#endif
-
/* Internal abstraction for thread synchronization */
#if defined(THREADS_POSIX)
#include "os/threads_posix.h"
@@ -237,6 +229,9 @@ static inline void usbi_dbg(const char *format, ...)
extern struct libusb_context *usbi_default_context;
+/* Forward declaration for use in context (fully defined inside poll abstraction) */
+struct pollfd;
+
struct libusb_context {
int debug;
int debug_fixed;
@@ -458,6 +453,14 @@ int usbi_get_config_index_by_value(struct libusb_device *dev,
void usbi_connect_device (struct libusb_device *dev);
void usbi_disconnect_device (struct libusb_device *dev);
+/* Internal abstraction for poll (needs struct usbi_transfer on Windows) */
+#if defined(OS_LINUX) || defined(OS_DARWIN) || defined(OS_OPENBSD) || defined(OS_NETBSD)
+#include <unistd.h>
+#include "os/poll_posix.h"
+#elif defined(OS_WINDOWS) || defined(OS_WINCE)
+#include "os/poll_windows.h"
+#endif
+
#if (defined(OS_WINDOWS) || defined(OS_WINCE)) && !defined(__GNUC__)
#define snprintf _snprintf
#define vsnprintf _vsnprintf
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 79784e2..6a74281 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 10913
+#define LIBUSB_NANO 10914