From efb6ac56ec7017fede18527387546e2e1d776795 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 2 Oct 2005 11:22:35 +0000 Subject: [PATCH] Moved ROL() to lib.h. --- lib/hashfunc.h | 3 --- lib/lib.h | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/hashfunc.h b/lib/hashfunc.h index c10f2249..e60e3f70 100644 --- a/lib/hashfunc.h +++ b/lib/hashfunc.h @@ -13,9 +13,6 @@ #include "lib/lib.h" -/* An equivalent of the Intel's rol instruction. */ -#define ROL(x, bits) (((x) << (bits)) | ((x) >> (sizeof(uns)*8 - (bits)))) - /* The following functions need str to be aligned to uns. */ uns str_len_aligned(const byte *str) CONST; uns hash_string_aligned(const byte *str) CONST; diff --git a/lib/lib.h b/lib/lib.h index a1e2b792..47606169 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -43,6 +43,8 @@ #define COMPARE_LT(x,y) do { if ((x)<(y)) return 1; if ((x)>(y)) return 0; } while(0) #define COMPARE_GT(x,y) COMPARE_LT(y,x) +#define ROL(x, bits) (((x) << (bits)) | ((x) >> (sizeof(uns)*8 - (bits)))) /* Bitwise rotation of an uns to the left */ + /* GCC Extensions */ #ifdef __GNUC__ -- 2.39.5