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.

Fix on 79e85313aa on 0.2.7.1-alpha.
This commit is contained in:
teor 2015-06-03 03:52:31 +10:00
parent 2b73dbf2a4
commit e0477de0e2
2 changed files with 9 additions and 4 deletions

View File

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

View File

@ -4319,13 +4319,12 @@ test_util_writepid(void *arg)
int n = sscanf(contents, "%lu\n%c", &pid, &c); int n = sscanf(contents, "%lu\n%c", &pid, &c);
tt_int_op(n, OP_EQ, 1); tt_int_op(n, OP_EQ, 1);
tt_uint_op(pid, OP_EQ,
#ifdef _WIN32 #ifdef _WIN32
_getpid() tt_uint_op(pid, OP_EQ, _getpid());
#else #else
getpid() tt_uint_op(pid, OP_EQ, getpid());
#endif #endif
);
done: done:
tor_free(contents); tor_free(contents);