]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Move bool_eq and bool_neq to lib/intmath
authorNick Mathewson <nickm@torproject.org>
Fri, 29 Jun 2018 14:21:50 +0000 (10:21 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 29 Jun 2018 16:21:52 +0000 (12:21 -0400)
src/common/util.h
src/lib/intmath/include.am
src/lib/intmath/logic.h [new file with mode: 0644]

index 9f387150ae084030da212aadf528c0af37d196bb..c59c79c30ef4795767f43f9865e70ab9fbb6ab19 100644 (file)
@@ -30,6 +30,7 @@
 #include "lib/string/scanf.h"
 #include "lib/intmath/bits.h"
 #include "lib/intmath/addsub.h"
+#include "lib/intmath/logic.h"
 #include "lib/intmath/muldiv.h"
 #include "lib/intmath/cmp.h"
 #include "lib/log/ratelim.h"
 #define SUBTYPE_P(p, subtype, basemember) \
   ((void*) ( ((char*)(p)) - offsetof(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))
-
 /* Math functions */
 
 /* String manipulation */
index 1ae5d618d4697715337d299e1343a3277710c39a..45ee3bd53bf24e11f2e37e04e712d00a53613a5d 100644 (file)
@@ -20,5 +20,6 @@ noinst_HEADERS +=                                     \
        src/lib/intmath/addsub.h                        \
        src/lib/intmath/cmp.h                           \
        src/lib/intmath/bits.h                          \
+       src/lib/intmath/logic.h                         \
        src/lib/intmath/muldiv.h                        \
        src/lib/intmath/weakrng.h
diff --git a/src/lib/intmath/logic.h b/src/lib/intmath/logic.h
new file mode 100644 (file)
index 0000000..0510a62
--- /dev/null
@@ -0,0 +1,14 @@
+/* Copyright (c) 2003-2004, Roger Dingledine
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+#ifndef HAVE_TOR_LOGIC_H
+#define HAVE_TOR_LOGIC_H
+
+/** 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))
+
+#endif