diff options
Diffstat (limited to 'src/microhttpd/mhd_bithelpers.h')
-rw-r--r-- | src/microhttpd/mhd_bithelpers.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/microhttpd/mhd_bithelpers.h b/src/microhttpd/mhd_bithelpers.h index ea7682aa..c8c814ac 100644 --- a/src/microhttpd/mhd_bithelpers.h +++ b/src/microhttpd/mhd_bithelpers.h | |||
@@ -238,6 +238,33 @@ _MHD_ROTR32 (uint32_t value32, int bits) | |||
238 | /* Defined in form which modern compiler could optimize. */ | 238 | /* Defined in form which modern compiler could optimize. */ |
239 | return (value32 >> bits) | (value32 << (32 - bits)); | 239 | return (value32 >> bits) | (value32 << (32 - bits)); |
240 | } | 240 | } |
241 | |||
242 | |||
243 | #endif /* ! _MSC_FULL_VER */ | ||
244 | |||
245 | |||
246 | /** | ||
247 | * Rotate left 32-bit value by number of bits. | ||
248 | * bits parameter must be more than zero and must be less than 32. | ||
249 | */ | ||
250 | #if defined(_MSC_FULL_VER) && (! defined(__clang__) || (defined(__c2__) && \ | ||
251 | defined(__OPTIMIZE__))) | ||
252 | /* Clang/C2 do not inline this function if optimizations are turned off. */ | ||
253 | #ifndef __clang__ | ||
254 | #pragma intrinsic(_rotl) | ||
255 | #endif /* ! __clang__ */ | ||
256 | #define _MHD_ROTL32(value32, bits) \ | ||
257 | ((uint32_t) _rotl ((uint32_t) (value32),(bits))) | ||
258 | #else /* ! _MSC_FULL_VER */ | ||
259 | _MHD_static_inline uint32_t | ||
260 | _MHD_ROTL32 (uint32_t value32, int bits) | ||
261 | { | ||
262 | mhd_assert (bits < 32); | ||
263 | /* Defined in form which modern compiler could optimize. */ | ||
264 | return (value32 << bits) | (value32 >> (32 - bits)); | ||
265 | } | ||
266 | |||
267 | |||
241 | #endif /* ! _MSC_FULL_VER */ | 268 | #endif /* ! _MSC_FULL_VER */ |
242 | 269 | ||
243 | 270 | ||