commit e0477de0e262e9009021cbd0556b7a9541d2192c Author: teor teor2345@gmail.com Date: Wed Jun 3 03:52:31 2015 +1000
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 79e85313aa61 on 0.2.7.1-alpha. --- changes/bug16115-undef-directive-in-macro | 6 ++++++ src/test/test_util.c | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/changes/bug16115-undef-directive-in-macro b/changes/bug16115-undef-directive-in-macro new file mode 100644 index 0000000..8031267 --- /dev/null +++ b/changes/bug16115-undef-directive-in-macro @@ -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. diff --git a/src/test/test_util.c b/src/test/test_util.c index 30dc598..b0366db 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -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);