examples: check value returned by ftell()

Problem detected by the Coverity tool
CID 1042546 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)3.
negative_returns: "initial_pos" is passed to a parameter that cannot be
negative.

fseek(3) can't be called with a negative offset with SEEK_SET
Windows: Add support for VIA VL805 USB 3.0 Host Controllers

* These controllers identify themselves as VUSB3HUB
* Closes #152
io: Ensure all pending events are consumed in one libusb_handle_events call

Before this patch if ie multiple hot-plug events were pending, multiple
handle_events calls would be necessary to handle them all, this patch
changes handle_events so that the poll is re-done to check for more events
if there was activity on any of the special fds.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
hotplug: Fix usb_device memleak with hotunplug events pending on libusb_exit

Closes #150

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
core: Make LIBUSB_DEBUG environment variable also work from libusb_exit

libusb_exit sets usbi_default_context to NULL, modify usbi_log_v so that
it still honors the  LIBUSB_DEBUG environment variable in this case.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Windows: Fix a crash when HID transfers return no data

* Issue reported by Surmakyynis
* Closes #160
core: fix Doxygen warning

libusbx/libusb/libusb.h:153: warning: no matching file member found for
libusb_cpu_to_le16()Possible candidates:
  static uint16_t libusb_cpu_to_le16(const uint16_t x)

Thanks to Serhat Sevki Dincer for the bug report
http://sourceforge.net/mailarchive/message.php?msg_id=31719691
Windows: Add Visual Studio 2013 solution files

* Also update gitignore
* Closes #162
Android: Build for all Android architectures

* Don't limit support to ARM only (adds MIPS support)
* Also add a workaround for a MIPS NDK linker bug
* Also add a gitignore entry required to run bootstrap.sh on OS X
* Closes #134
Android: Add support for Linux/Android platforms

* Closes #154
Linux: Remove trailing whitespace

* Closes #157
Windows: Add SetupAPI error handling

* http://msdn.microsoft.com/en-us/library/windows/hardware/ff545011.aspx
  states that SetupAPI errors must be be converted before passing it to FormatMessage().
* Use our own implementation of HRESULT_FROM_SETUPAPI to avoid defining a new function call.
* Issue and original fix suggested by Matthias Bolte
* Closes #166
Darwin: Return error code in darwin_error_str() on unknown error

* Closes #117
Darwin: Fix a SIGFPE

* GetPipeProperties() may fail when the device is unplugged if DeviceVersion is not greater than 320.
* In this case maxPacketSize will be zero and the integer division will throw a EXC_ARITHMETIC signal.
* Closes #136
Darwin: Fix format of 64-bit sessionIDs in log messages

* The sessionID value is 64-bit, so print it as such.
* Closes #153
Windows: Fix a MinGW compilation issue

* Some MinGW platforms may not have FACILITY_SETUPAPI defined
* Issue introduced with 8b46e1c088167eb86b1712765896e2f17d70d148
libusbx 1.0.18-rc1
Merge remote-tracking branch 'upstream/master'