Use do { ... } while (0) to wrap the body of mtx_assert().

Reported by:	rwatson
This commit is contained in:
John Baldwin 2000-10-31 17:20:55 +00:00
parent 7ccbb17bb3
commit bfbc104f8a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=68081

View file

@ -210,7 +210,7 @@ do { \
#ifdef INVARIANTS
#define MA_OWNED 1
#define MA_NOTOWNED 2
#define mtx_assert(m, what) { \
#define mtx_assert(m, what) do { \
switch ((what)) { \
case MA_OWNED: \
if (!mtx_owned((m))) \
@ -225,7 +225,7 @@ do { \
default: \
panic("unknown mtx_assert at %s:%d", __FILE__, __LINE__); \
} \
}
} while(0)
#else /* INVARIANTS */
#define mtx_assert(m, what)
#endif /* INVARIANTS */