summaryrefslogtreecommitdiff
path: root/msvc
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 /msvc
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 'msvc')
-rw-r--r--msvc/config.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/msvc/config.h b/msvc/config.h
index 840c8df..25eb6e2 100644
--- a/msvc/config.h
+++ b/msvc/config.h
@@ -15,11 +15,13 @@
#define _TIMESPEC_DEFINED 1
#endif
+/* Disable: warning C4127: conditional expression is constant */
+#pragma warning(disable:4127)
/* Disable: warning C4200: nonstandard extension used : zero-sized array in struct/union */
#pragma warning(disable:4200)
/* Disable: warning C4324: structure was padded due to __declspec(align()) */
#pragma warning(disable:4324)
-/* Disable: warning C4996: 'GetVersionA': was declared deprecated */
+/* Disable: warning C4996: 'GetVersionExA': was declared deprecated */
#pragma warning(disable:4996)
#if defined(_PREFAST_)