mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
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:
parent
ef47d89d23
commit
f29b26f75d
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user