]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Define macros meaning <,>,==,!=,<=,>=
authorNick Mathewson <nickm@torproject.org>
Thu, 6 Nov 2014 16:19:31 +0000 (11:19 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 6 Nov 2014 16:21:13 +0000 (11:21 -0500)
This lets us avoid putting operators directly in macro arguments,
and thus will help us unconfuse coccinelle.

For ticket 13172.

changes/ticket13172 [new file with mode: 0644]
src/common/compat.h

diff --git a/changes/ticket13172 b/changes/ticket13172
new file mode 100644 (file)
index 0000000..a1d47fd
--- /dev/null
@@ -0,0 +1,4 @@
+  o Code simplification and refactoring:
+    - Avoid using operators directly as macro arguments: this lets us
+      apply coccinelle transformations to our codebase more
+      directly. Closes ticket 13172.
\ No newline at end of file
index f2eef5b6e7f9e86d5cb6c9ce9782d1b067a5f783..7001361af31c2e16f8317f5f5ee771ba82b1cfa4 100644 (file)
@@ -203,6 +203,15 @@ extern INLINE double U64_TO_DBL(uint64_t x) {
 #define STMT_END } while (0)
 #endif
 
+/* Some tools (like coccinelle) don't like to see operators as macro
+ * arguments. */
+#define OP_LT <
+#define OP_GT >
+#define OP_GE >=
+#define OP_LE <=
+#define OP_EQ ==
+#define OP_NE !=
+
 /* ===== String compatibility */
 #ifdef _WIN32
 /* Windows names string functions differently from most other platforms. */