Browse Source

Merge branch 'ticket13172'

Nick Mathewson 9 years ago
parent
commit
2170171d84
2 changed files with 13 additions and 0 deletions
  1. 4 0
      changes/ticket13172
  2. 9 0
      src/common/compat.h

+ 4 - 0
changes/ticket13172

@@ -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.

+ 9 - 0
src/common/compat.h

@@ -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. */