mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 12:34:32 +02:00
8011009: Use do-while(0) instead of while(0) in EC_TRACE and RC_TRACE* macros
Improve EC_TRACE and RC_TRACE* to use the do-while(0) trick for statement-like macro Reviewed-by: sspitsyn, dcubed
This commit is contained in:
parent
70314e1b01
commit
214b7d9dcf
2 changed files with 46 additions and 38 deletions
|
@ -39,7 +39,12 @@
|
|||
#include "runtime/vm_operations.hpp"
|
||||
|
||||
#ifdef JVMTI_TRACE
|
||||
#define EC_TRACE(out) if (JvmtiTrace::trace_event_controller()) { SafeResourceMark rm; tty->print_cr out; } while (0)
|
||||
#define EC_TRACE(out) do { \
|
||||
if (JvmtiTrace::trace_event_controller()) { \
|
||||
SafeResourceMark rm; \
|
||||
tty->print_cr out; \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
#define EC_TRACE(out)
|
||||
#endif /*JVMTI_TRACE */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue