gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] branch master updated: Use compiler built-ins for bits r


From: gnunet
Subject: [libmicrohttpd] branch master updated: Use compiler built-ins for bits rotations if available
Date: Mon, 21 Jun 2021 14:24:20 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

The following commit(s) were added to refs/heads/master by this push:
     new 64e91ef6 Use compiler built-ins for bits rotations if available
64e91ef6 is described below

commit 64e91ef600f5c607b10a07539f33ecb31bd86818
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Mon Jun 21 15:21:03 2021 +0300

    Use compiler built-ins for bits rotations if available
---
 src/microhttpd/mhd_bithelpers.h | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/microhttpd/mhd_bithelpers.h b/src/microhttpd/mhd_bithelpers.h
index 9bd2df79..eace0eb9 100644
--- a/src/microhttpd/mhd_bithelpers.h
+++ b/src/microhttpd/mhd_bithelpers.h
@@ -286,7 +286,10 @@ _MHD_PUT_64BIT_BE_SAFE (void *dst, uint64_t value)
 #endif /* ! __clang__ */
 #define _MHD_ROTR32(value32, bits) \
   ((uint32_t) _rotr ((uint32_t) (value32),(bits)))
-#else  /* ! _MSC_FULL_VER */
+#elif __has_builtin (__builtin_rotateright32)
+#define _MHD_ROTR32(value32, bits) \
+  ((uint32_t) __builtin_rotateright32 ((value32), (bits)))
+#else  /* ! __builtin_rotateright32 */
 _MHD_static_inline uint32_t
 _MHD_ROTR32 (uint32_t value32, int bits)
 {
@@ -296,7 +299,7 @@ _MHD_ROTR32 (uint32_t value32, int bits)
 }
 
 
-#endif /* ! _MSC_FULL_VER */
+#endif /* ! __builtin_rotateright32 */
 
 
 /**
@@ -311,7 +314,10 @@ _MHD_ROTR32 (uint32_t value32, int bits)
 #endif /* ! __clang__ */
 #define _MHD_ROTL32(value32, bits) \
   ((uint32_t) _rotl ((uint32_t) (value32),(bits)))
-#else  /* ! _MSC_FULL_VER */
+#elif __has_builtin (__builtin_rotateleft32)
+#define _MHD_ROTL32(value32, bits) \
+  ((uint32_t) __builtin_rotateleft32 ((value32), (bits)))
+#else  /* ! __builtin_rotateleft32 */
 _MHD_static_inline uint32_t
 _MHD_ROTL32 (uint32_t value32, int bits)
 {
@@ -321,7 +327,7 @@ _MHD_ROTL32 (uint32_t value32, int bits)
 }
 
 
-#endif /* ! _MSC_FULL_VER */
+#endif /* ! __builtin_rotateleft32 */
 
 
 #endif /* ! MHD_BITHELPERS_H */

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]