summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Burghardt <mburghardt@mozilla.com>2019-10-28 10:25:16 +0100
committerMarcus Burghardt <mburghardt@mozilla.com>2019-10-28 10:25:16 +0100
commit90570c32f936defcc9e748c07ddfe6043e43f864 (patch)
tree6db19cf0979674e836c6145faf1ce552cb1aeb41
parent8b469388131c39e26501533312aacf2bd115489f (diff)
downloadnspr-hg-90570c32f936defcc9e748c07ddfe6043e43f864.tar.gz
Bug 1588015 - Provide PR_ASSERT_ARG which avoids unused variable warning. r=mt r=kaie
-rw-r--r--pr/include/prlog.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/pr/include/prlog.h b/pr/include/prlog.h
index a1f57e4d..1922c255 100644
--- a/pr/include/prlog.h
+++ b/pr/include/prlog.h
@@ -207,12 +207,16 @@ PR_PRETEND_NORETURN;
#define PR_ASSERT(_expr) \
((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
+#define PR_ASSERT_ARG(_expr) PR_ASSERT(_expr)
+
#define PR_NOT_REACHED(_reasonStr) \
PR_Assert(_reasonStr,__FILE__,__LINE__)
#else
#define PR_ASSERT(expr) ((void) 0)
+/* PR_ASSERT_ARG avoids compiler warning: unused variable */
+#define PR_ASSERT_ARG(expr) ((void)(0 && (expr)))
#define PR_NOT_REACHED(reasonStr)
#endif /* defined(DEBUG) || defined(FORCE_PR_ASSERT) */