summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2010-01-30 01:40:41 +0000
committerPete Batard <pbatard@gmail.com>2010-01-30 01:40:41 +0000
commitbf4f54160c313c6052c470d1516acce84e55f98a (patch)
tree19f82c669717a6af0c00ddbf1a678f748f633399
parentafe70cedf774436981defb900c5eb78d13ec13d0 (diff)
downloadlibusb-bf4f54160c313c6052c470d1516acce84e55f98a.tar.gz
r124: removes #error on previous commit and fixes thing ourselves
-rw-r--r--examples/xusb.c4
-rw-r--r--libusb/libusb.h22
2 files changed, 13 insertions, 13 deletions
diff --git a/examples/xusb.c b/examples/xusb.c
index 78dcbd1..2734032 100644
--- a/examples/xusb.c
+++ b/examples/xusb.c
@@ -32,6 +32,8 @@
#include <string.h>
#include <stdarg.h>
+#include <libusb/libusb.h>
+
#ifdef OS_WINDOWS
#include <windows.h>
#define msleep(msecs) Sleep(msecs)
@@ -40,8 +42,6 @@
#define msleep(msecs) usleep(1000*msecs)
#endif
-#include <libusb/libusb.h>
-
#if !defined(_MSC_VER)
#define sscanf_s sscanf
#endif
diff --git a/libusb/libusb.h b/libusb/libusb.h
index 277f040..5326fa4 100644
--- a/libusb/libusb.h
+++ b/libusb/libusb.h
@@ -32,20 +32,20 @@
#include <time.h>
#include <limits.h>
-// 'interface' might be defined as a macro on Windows, so we need to undefine
-// it so as not to break the current libusb API, because libusb_config_descriptor
-// has an 'interface' member
-// As this could still be problematic if you include windows.h after libusb.h in
-// your sources, we attempt to detect that as well.
-#if defined(OS_WINDOWS)
-#if !defined(interface) && !defined(_WINDOWS_)
-#error "Please make sure you include both windows.h and libusb.h in your source, in that order."
-#elif defined(interface)
-#undef interface
+/* 'interface' might be defined as a macro on Windows, so we need to
+ * undefine it so as not to break the current libusb API, because
+ * libusb_config_descriptor has an 'interface' member
+ * As this can be problematic if you include windows.h after libusb.h
+ * in your sources, we force windows.h to be included first. */
+#if !defined(_WINDOWS_)
+#include <windows.h>
#endif
+
+#if defined(interface)
+#undef interface
#endif
-// MSVC doesn't know ssize_t
+/* MSVC doesn't know ssize_t */
#if !defined(ssize_t)
#if defined (_WIN64)
#define ssize_t __int64