summaryrefslogtreecommitdiff
path: root/pr/include/prmem.h
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>2000-05-22 18:12:11 +0000
committerwtc%netscape.com <devnull@localhost>2000-05-22 18:12:11 +0000
commitaf719eb059e69987ff2fba455fc8831c3806f838 (patch)
treefbc003dccbc0d66e1cae56f3b60f9a72f63fb477 /pr/include/prmem.h
parentcb36e43ed23106c1c5615f020fb4fd7cd68c0c76 (diff)
downloadnspr-hg-af719eb059e69987ff2fba455fc8831c3806f838.tar.gz
Bugzilla bug #39110: put PR_BEGIN_MACRO and PR_END_MACRO around
PR_DELETE and PR_FREEIF. Thanks to Erik van der Poel <erik@netscape.com> for the bug report and suggested fix.
Diffstat (limited to 'pr/include/prmem.h')
-rw-r--r--pr/include/prmem.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/pr/include/prmem.h b/pr/include/prmem.h
index b65128c8..4420adb1 100644
--- a/pr/include/prmem.h
+++ b/pr/include/prmem.h
@@ -121,7 +121,10 @@ NSPR_API(void) PR_Free(void *ptr);
** OUTPUTS: the referenced object is returned to the heap
** RETURN: void
***********************************************************************/
-#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
+#define PR_DELETE(_ptr) \
+ PR_BEGIN_MACRO \
+ PR_Free(_ptr); (_ptr) = NULL; \
+ PR_END_MACRO
/***********************************************************************
** FUNCTION: PR_FREEIF()
@@ -133,7 +136,10 @@ NSPR_API(void) PR_Free(void *ptr);
** OUTPUTS: the referenced object is conditionally returned to the heap
** RETURN: void
***********************************************************************/
-#define PR_FREEIF(_ptr) if (_ptr) PR_DELETE(_ptr)
+#define PR_FREEIF(_ptr) \
+ PR_BEGIN_MACRO \
+ if (_ptr) PR_DELETE(_ptr); \
+ PR_END_MACRO
PR_END_EXTERN_C