diff options
author | Chris Dickens <christopher.a.dickens@gmail.com> | 2020-01-22 15:53:17 -0800 |
---|---|---|
committer | Chris Dickens <christopher.a.dickens@gmail.com> | 2020-01-24 11:21:27 -0800 |
commit | aaff15d48d1b8555aabf012b06bf39bf8aa4768a (patch) | |
tree | 1eebfa64f672df87806852b00afb2b924b4b5eae /libusb/os/threads_posix.c | |
parent | 325e5ac8ddf2cb100a47e39185bc9f134d3b2f98 (diff) | |
download | libusb-aaff15d48d1b8555aabf012b06bf39bf8aa4768a.tar.gz |
Misc: Trim and consolidate header file usage
Refactor libusbi.h to include the set of common header files needed by
every main source file in the library and change these source files to
include libusbi.h first, followed by any non-common headers. Including
libusbi.h first ensures that the config definitions are pulled in and
will eliminate redundant includes in the individual sources files.
Also clean up some whitespace errors and remove unnecessary definitions
in the manually generated config.h files.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Diffstat (limited to 'libusb/os/threads_posix.c')
-rw-r--r-- | libusb/os/threads_posix.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/libusb/os/threads_posix.c b/libusb/os/threads_posix.c index 16a7578..92bb11d 100644 --- a/libusb/os/threads_posix.c +++ b/libusb/os/threads_posix.c @@ -19,24 +19,17 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <config.h> +#include "libusbi.h" -#include <time.h> -#if defined(__linux__) || defined(__OpenBSD__) +#if defined(__ANDROID__) +# include <unistd.h> +#elif defined(__linux__) || defined(__OpenBSD__) # if defined(__OpenBSD__) # define _BSD_SOURCE # endif -# include <unistd.h> # include <sys/syscall.h> -#elif defined(__APPLE__) -# include <pthread.h> -#elif defined(__CYGWIN__) -# include <windows.h> #endif -#include "threads_posix.h" -#include "libusbi.h" - int usbi_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timeval *tv) { |