diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-06-17 18:22:39 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-06-17 18:22:39 +0000 |
commit | 5adfa09fce2c61239f9a7fa5fb154282f802af0a (patch) | |
tree | ffd522053a544617737cc38128c2e315dce464b1 /src/or/or.h | |
parent | 93f32db438cff63662761374f4a69b710f3d71d9 (diff) | |
download | tor-5adfa09fce2c61239f9a7fa5fb154282f802af0a.tar.gz tor-5adfa09fce2c61239f9a7fa5fb154282f802af0a.zip |
r13477@catbus: nickm | 2007-06-17 14:22:03 -0400
Sun CC likes to give warnings for the do { } while(0) construction for making statement-like macros. Define STMT_BEGIN/STMT_END macros that do the right thing, and use them everywhere.
svn:r10645
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/or.h b/src/or/or.h index d92493a8ee..5d5352d76a 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -2576,14 +2576,14 @@ void control_adjust_event_log_severity(void); * Stmt must not contain any return or goto statements. */ #define CONN_LOG_PROTECT(conn, stmt) \ - do { \ + STMT_BEGIN \ int _log_conn_is_control = (conn && conn->type == CONN_TYPE_CONTROL); \ if (_log_conn_is_control) \ disable_control_logging(); \ - do {stmt;} while (0); \ + STMT_BEGIN stmt; STMT_END; \ if (_log_conn_is_control) \ enable_control_logging(); \ - } while (0) + STMT_END /** Log information about the connection <b>conn</b>, protecting it as with * CONN_LOG_PROTECT. Example: |