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.
This commit is contained in:
wtc%netscape.com 2000-05-22 18:12:11 +00:00
parent ef47d89d23
commit f29b26f75d

View File

@ -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