core: Make use of headers consistent across all files
* Include config.h before anything else in all files
* Remove unnecessary inclusion of libusb.h
* Use angle brackets for system headers and quotes for local headers
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
diff --git a/libusb/descriptor.c b/libusb/descriptor.c
index 93d34ce..53405e4 100644
--- a/libusb/descriptor.c
+++ b/libusb/descriptor.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <config.h>
+
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
diff --git a/libusb/io.c b/libusb/io.c
index b4c630f..723ed0c 100644
--- a/libusb/io.c
+++ b/libusb/io.c
@@ -19,7 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "config.h"
+#include <config.h>
+
#include <assert.h>
#include <errno.h>
#include <stdint.h>
diff --git a/libusb/libusbi.h b/libusb/libusbi.h
index bead373..8d1fb9d 100644
--- a/libusb/libusbi.h
+++ b/libusb/libusbi.h
@@ -21,7 +21,7 @@
#ifndef LIBUSBI_H
#define LIBUSBI_H
-#include "config.h"
+#include <config.h>
#include <stdlib.h>
@@ -32,10 +32,10 @@
#ifdef HAVE_POLL_H
#include <poll.h>
#endif
-
#ifdef HAVE_MISSING_H
-#include "missing.h"
+#include <missing.h>
#endif
+
#include "libusb.h"
#include "version.h"
diff --git a/libusb/os/linux_netlink.c b/libusb/os/linux_netlink.c
index 306f0b4..7a30561 100644
--- a/libusb/os/linux_netlink.c
+++ b/libusb/os/linux_netlink.c
@@ -20,10 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "config.h"
-#include "libusb.h"
-#include "libusbi.h"
-#include "linux_usbfs.h"
+#include <config.h>
#include <ctype.h>
#include <dirent.h>
@@ -53,6 +50,9 @@
#include <linux/filter.h>
#endif
+#include "libusbi.h"
+#include "linux_usbfs.h"
+
#define KERNEL 1
static int linux_netlink_socket = -1;
diff --git a/libusb/os/linux_udev.c b/libusb/os/linux_udev.c
index 0394048..6577240 100644
--- a/libusb/os/linux_udev.c
+++ b/libusb/os/linux_udev.c
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "config.h"
+#include <config.h>
#include <assert.h>
#include <ctype.h>
@@ -39,7 +39,6 @@
#include <unistd.h>
#include <libudev.h>
-#include "libusb.h"
#include "libusbi.h"
#include "linux_usbfs.h"
diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c
index 77df258..d92e3dd 100644
--- a/libusb/os/linux_usbfs.c
+++ b/libusb/os/linux_usbfs.c
@@ -38,7 +38,6 @@
#include <sys/utsname.h>
#include <unistd.h>
-#include "libusb.h"
#include "libusbi.h"
#include "linux_usbfs.h"
diff --git a/libusb/os/netbsd_usb.c b/libusb/os/netbsd_usb.c
index ecc0e55..7b0abf9 100644
--- a/libusb/os/netbsd_usb.c
+++ b/libusb/os/netbsd_usb.c
@@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <config.h>
+
#include <sys/time.h>
#include <sys/types.h>
@@ -28,7 +30,6 @@
#include <dev/usb/usb.h>
-#include "libusb.h"
#include "libusbi.h"
struct device_priv {
diff --git a/libusb/os/openbsd_usb.c b/libusb/os/openbsd_usb.c
index d1db8ca..c1e786c 100644
--- a/libusb/os/openbsd_usb.c
+++ b/libusb/os/openbsd_usb.c
@@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <config.h>
+
#include <sys/time.h>
#include <sys/types.h>
@@ -28,7 +30,6 @@
#include <dev/usb/usb.h>
-#include "libusb.h"
#include "libusbi.h"
struct device_priv {
diff --git a/libusb/os/poll_posix.c b/libusb/os/poll_posix.c
index eeaf5dc..e2f55a5 100644
--- a/libusb/os/poll_posix.c
+++ b/libusb/os/poll_posix.c
@@ -18,6 +18,8 @@
*
*/
+#include <config.h>
+
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
diff --git a/libusb/os/poll_windows.c b/libusb/os/poll_windows.c
index 2a75c5e..593db5b 100644
--- a/libusb/os/poll_windows.c
+++ b/libusb/os/poll_windows.c
@@ -40,6 +40,8 @@
* with a fake pipe. The read/write functions are only meant to be used in that
* context.
*/
+#include <config.h>
+
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libusb/os/threads_posix.c b/libusb/os/threads_posix.c
index 95c1027..ec2d19a 100644
--- a/libusb/os/threads_posix.c
+++ b/libusb/os/threads_posix.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <config.h>
+
#if defined(__linux__) || defined(__OpenBSD__)
# if defined(__linux__)
# define _GNU_SOURCE
diff --git a/libusb/os/threads_windows.c b/libusb/os/threads_windows.c
index ac12738..8d34ed5 100644
--- a/libusb/os/threads_windows.c
+++ b/libusb/os/threads_windows.c
@@ -19,6 +19,7 @@
*/
#include <config.h>
+
#include <objbase.h>
#include <errno.h>
#include <stdarg.h>
diff --git a/libusb/os/wince_usb.c b/libusb/os/wince_usb.c
index 4d9b3cc..bd699b7 100644
--- a/libusb/os/wince_usb.c
+++ b/libusb/os/wince_usb.c
@@ -22,12 +22,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <libusbi.h>
+#include <config.h>
#include <stdint.h>
#include <errno.h>
#include <inttypes.h>
+#include "libusbi.h"
#include "wince_usb.h"
// Forward declares
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c
index 6c42971..59f7480 100644
--- a/libusb/os/windows_usb.c
+++ b/libusb/os/windows_usb.c
@@ -23,6 +23,7 @@
*/
#include <config.h>
+
#include <windows.h>
#include <setupapi.h>
#include <ctype.h>
diff --git a/libusb/strerror.c b/libusb/strerror.c
index 7fba0e4..5b71585 100644
--- a/libusb/strerror.c
+++ b/libusb/strerror.c
@@ -16,13 +16,13 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "config.h"
+
+#include <config.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>
-#include "libusb.h"
#include "libusbi.h"
#if defined(_MSC_VER)
diff --git a/libusb/sync.c b/libusb/sync.c
index d87032d..61a8b9c 100644
--- a/libusb/sync.c
+++ b/libusb/sync.c
@@ -17,7 +17,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "config.h"
+#include <config.h>
+
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 6a74281..d6d2c7d 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 10914
+#define LIBUSB_NANO 10916