diff options
Diffstat (limited to 'src/microhttpd/mhd_bithelpers.h')
-rw-r--r-- | src/microhttpd/mhd_bithelpers.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/microhttpd/mhd_bithelpers.h b/src/microhttpd/mhd_bithelpers.h index e023bf12..5d1aadef 100644 --- a/src/microhttpd/mhd_bithelpers.h +++ b/src/microhttpd/mhd_bithelpers.h | |||
@@ -26,13 +26,14 @@ | |||
26 | #ifndef MHD_BITHELPERS_H | 26 | #ifndef MHD_BITHELPERS_H |
27 | #define MHD_BITHELPERS_H 1 | 27 | #define MHD_BITHELPERS_H 1 |
28 | 28 | ||
29 | #include "mhd_byteorder.h" | ||
30 | #include <stdint.h> | 29 | #include <stdint.h> |
31 | #if defined(_MSC_FULL_VER) && (! defined(__clang__) || (defined(__c2__) && \ | 30 | #if defined(_MSC_FULL_VER) && (! defined(__clang__) || (defined(__c2__) && \ |
32 | defined(__OPTIMIZE__))) | 31 | defined(__OPTIMIZE__))) |
33 | /* Declarations for VC & Clang/C2 built-ins */ | 32 | /* Declarations for VC & Clang/C2 built-ins */ |
34 | #include <intrin.h> | 33 | #include <intrin.h> |
35 | #endif /* _MSC_FULL_VER */ | 34 | #endif /* _MSC_FULL_VER */ |
35 | #include "mhd_assert.h" | ||
36 | #include "mhd_byteorder.h" | ||
36 | 37 | ||
37 | #ifndef __has_builtin | 38 | #ifndef __has_builtin |
38 | /* Avoid precompiler errors with non-clang */ | 39 | /* Avoid precompiler errors with non-clang */ |
@@ -230,9 +231,13 @@ | |||
230 | #define _MHD_ROTR32(value32, bits) \ | 231 | #define _MHD_ROTR32(value32, bits) \ |
231 | ((uint32_t) _rotr ((uint32_t) (value32),(bits))) | 232 | ((uint32_t) _rotr ((uint32_t) (value32),(bits))) |
232 | #else /* ! _MSC_FULL_VER */ | 233 | #else /* ! _MSC_FULL_VER */ |
233 | /* Defined in form which modern compiler could optimize. */ | 234 | _MHD_static_inline uint32_t |
234 | #define _MHD_ROTR32(value32, bits) \ | 235 | _MHD_ROTR32 (uint32_t value32, int bits) |
235 | (((uint32_t) (value32)) >> (bits) | ((uint32_t) (value32)) << (32 - bits)) | 236 | { |
237 | mhd_assert (bits < 32); | ||
238 | /* Defined in form which modern compiler could optimize. */ | ||
239 | return (value32 >> bits) | (value32 << (32 - bits)); | ||
240 | } | ||
236 | #endif /* ! _MSC_FULL_VER */ | 241 | #endif /* ! _MSC_FULL_VER */ |
237 | 242 | ||
238 | 243 | ||