MEM_guardedalloc: allow freeing const arrays with MEM_SAFE_FREE
'const' arrays couldn't use this macro with GNUC.
This commit is contained in:
@@ -187,7 +187,8 @@ extern size_t (*MEM_get_peak_memory)(void) ATTR_WARN_UNUSED_RESULT;
|
||||
do { \
|
||||
typeof(&(v)) _v = &(v); \
|
||||
if (*_v) { \
|
||||
MEM_freeN(*_v); \
|
||||
/* Cast so we can free constant arrays. */ \
|
||||
MEM_freeN((void *)*_v); \
|
||||
*_v = NULL; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
Reference in New Issue
Block a user