summaryrefslogtreecommitdiff
path: root/libusb/os/threads_windows.h
diff options
context:
space:
mode:
authorChris Dickens <christopher.a.dickens@gmail.com>2020-01-25 12:10:04 -0800
committerChris Dickens <christopher.a.dickens@gmail.com>2020-01-25 12:10:04 -0800
commit7bc0ff3ce94572f3e52718938e4beb4c7a86bfff (patch)
treed94640a7edf402b2373b5cc4cfb84881e9c4bfb6 /libusb/os/threads_windows.h
parent221e8196221a6ede462914daf6c2652d57843df6 (diff)
downloadlibusb-7bc0ff3ce94572f3e52718938e4beb4c7a86bfff.tar.gz
core: Convert internal macros to static inline functions
Older versions of the Visual Studio compiler are picky about macros constructed with the 'do { ... } while (0)' construct. Convert these internal ones to static inline functions. The result is functionally equivalent but gets us type checking and a bit more readability. Also address some compiler warnings due to some header files that are being included in a different order than before. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Diffstat (limited to 'libusb/os/threads_windows.h')
-rw-r--r--libusb/os/threads_windows.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libusb/os/threads_windows.h b/libusb/os/threads_windows.h
index 9bf8ff4..618c2f3 100644
--- a/libusb/os/threads_windows.h
+++ b/libusb/os/threads_windows.h
@@ -21,6 +21,8 @@
#ifndef LIBUSB_THREADS_WINDOWS_H
#define LIBUSB_THREADS_WINDOWS_H
+#include <errno.h>
+
#define USBI_MUTEX_INITIALIZER 0L
typedef LONG usbi_mutex_static_t;
static inline void usbi_mutex_static_lock(usbi_mutex_static_t *mutex)