Fix the libusb and hidapi includes

The libusb and hidapi pkg-config files already add the subdirectory to
the header search path with:

   -I/usr/include/libusb-1.0
   -I/usr/include/hidapi

Therefore, using the subdirectory in the include statement is wrong. In
practice, this usualy works fine by accident, because the base directory
(/usr/include) is typically listed in the default search path of the
compiler. But that's not always true. For example when cross-compiling
or when using the PKG_CONFIG_LIBDIR environment variable.
This commit is contained in:
Jef Driesen 2018-08-28 21:57:52 +02:00
parent 631cfd8c45
commit b1d434f0ea
2 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@
#ifdef _WIN32
#define NOGDI
#endif
#include <libusb-1.0/libusb.h>
#include <libusb.h>
#endif
#include "atomics_cobalt.h"

View File

@ -45,9 +45,9 @@
#ifdef _WIN32
#define NOGDI
#endif
#include <libusb-1.0/libusb.h>
#include <libusb.h>
#elif defined(USE_HIDAPI)
#include <hidapi/hidapi.h>
#include <hidapi.h>
#endif
#include <libdivecomputer/usbhid.h>