From 865f8cf36107c899782f7b325e106a5c20a6ee5c Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 23 Dec 2008 17:02:54 -0800 Subject: [PATCH] New macro IS_POW2(). --- lib/util.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/util.h b/lib/util.h index 8172b69e..2086a2ba 100644 --- a/lib/util.h +++ b/lib/util.h @@ -69,6 +69,7 @@ extern const char *program_name; #define ARRAY_SIZE(ARRAY) (sizeof ARRAY / sizeof *ARRAY) #define ROUND_UP(X, Y) (((X) + ((Y) - 1)) / (Y) * (Y)) #define ROUND_DOWN(X, Y) ((X) / (Y) * (Y)) +#define IS_POW2(X) ((X) && !((X) & ((X) - 1))) #ifndef MIN #define MIN(X, Y) ((X) < (Y) ? (X) : (Y)) -- 2.30.2