]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Remove undefined directive-in-macro in test_util_writepid
authorteor <teor2345@gmail.com>
Tue, 2 Jun 2015 17:52:31 +0000 (03:52 +1000)
committerteor <teor2345@gmail.com>
Tue, 2 Jun 2015 18:19:05 +0000 (04:19 +1000)
clang 3.7 complains that using a preprocessor directive inside
a macro invocation in test_util_writepid in test_util.c is undefined.

Fix on 79e85313aa61 on 0.2.7.1-alpha.

changes/bug16115-undef-directive-in-macro [new file with mode: 0644]
src/test/test_util.c

diff --git a/changes/bug16115-undef-directive-in-macro b/changes/bug16115-undef-directive-in-macro
new file mode 100644 (file)
index 0000000..8031267
--- /dev/null
@@ -0,0 +1,6 @@
+  o Minor fixes (threads, comments):
+    - Remove undefined directive-in-macro in test_util_writepid
+      clang 3.7 complains that using a preprocessor directive inside
+      a macro invocation in test_util_writepid in test_util.c is undefined.
+      Patch by "teor".
+      Fix on 79e85313aa61 on 0.2.7.1-alpha.
index 30dc59844a2798647d93a5bee4395d9d9d20c7ff..b0366db37f75e5031f8544a6ef3265f9b2b81e8a 100644 (file)
@@ -4319,13 +4319,12 @@ test_util_writepid(void *arg)
 
   int n = sscanf(contents, "%lu\n%c", &pid, &c);
   tt_int_op(n, OP_EQ, 1);
-  tt_uint_op(pid, OP_EQ,
+
 #ifdef _WIN32
-             _getpid()
+  tt_uint_op(pid, OP_EQ, _getpid());
 #else
-             getpid()
+  tt_uint_op(pid, OP_EQ, getpid());
 #endif
-             );
 
  done:
   tor_free(contents);