diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-03-29 02:37:06 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-03-29 02:37:06 +0000 |
commit | d1ad950ca89a648ef4a0d7ab4d8a38978a7a92dc (patch) | |
tree | 1ff1878f6b972d3befe21b49e47d0f612a2c0b74 /src/common/util.h | |
parent | 98ae4bbd0fba7dc6ef3e56ccbbafaf76175be227 (diff) | |
download | tor-d1ad950ca89a648ef4a0d7ab4d8a38978a7a92dc.tar.gz tor-d1ad950ca89a648ef4a0d7ab4d8a38978a7a92dc.zip |
Turn bool_neq and bool_eq into macros.
svn:r9914
Diffstat (limited to 'src/common/util.h')
-rw-r--r-- | src/common/util.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/util.h b/src/common/util.h index 1d524cf66f..7a0335935b 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -136,6 +136,12 @@ extern int dmalloc_free(const char *file, const int line, void *pnt, #define SUBTYPE_P(p, subtype, basemember) \ ((void*) ( ((char*)(p)) - STRUCT_OFFSET(subtype, basemember) )) +/* Logic */ +/** Macro: true if two values have the same boolean value. */ +#define bool_eq(a,b) (!(a)==!(b)) +/** Macro: true if two values have different boolean values. */ +#define bool_neq(a,b) (!(a)!=!(b)) + /* String manipulation */ /** Allowable characters in a hexadecimal string. */ |