Fixed the cast in both safefree() macros to compile cleaning using a
C++ compiler.
This commit is contained in:
parent
8a6a94db0a
commit
5a2af49e58
@ -1,4 +1,4 @@
|
|||||||
/* $Id: heap.h,v 1.3 2003-05-31 23:04:15 rjkaes Exp $
|
/* $Id: heap.h,v 1.4 2003-07-31 23:41:26 rjkaes Exp $
|
||||||
*
|
*
|
||||||
* See 'heap.c' for a detailed description.
|
* See 'heap.c' for a detailed description.
|
||||||
*
|
*
|
||||||
@ -38,7 +38,7 @@ extern char *debugging_strdup(const char* s, const char* file,
|
|||||||
# define saferealloc(x, y) debugging_realloc(x, y, __FILE__, __LINE__)
|
# define saferealloc(x, y) debugging_realloc(x, y, __FILE__, __LINE__)
|
||||||
# define safestrdup(x) debugging_strdup(x, __FILE__, __LINE__)
|
# define safestrdup(x) debugging_strdup(x, __FILE__, __LINE__)
|
||||||
# define safefree(x) do { \
|
# define safefree(x) do { \
|
||||||
void **__safefree_tmp = (void *)&(x); \
|
void **__safefree_tmp = (void**)(&(x)); \
|
||||||
debugging_free(*__safefree_tmp, __FILE__, __LINE__); \
|
debugging_free(*__safefree_tmp, __FILE__, __LINE__); \
|
||||||
*__safefree_tmp = NULL; \
|
*__safefree_tmp = NULL; \
|
||||||
} while (0)
|
} while (0)
|
||||||
@ -47,7 +47,7 @@ debugging_free(*__safefree_tmp, __FILE__, __LINE__); \
|
|||||||
# define safemalloc(x) malloc(x)
|
# define safemalloc(x) malloc(x)
|
||||||
# define saferealloc(x, y) realloc(x, y)
|
# define saferealloc(x, y) realloc(x, y)
|
||||||
# define safefree(x) do { \
|
# define safefree(x) do { \
|
||||||
void **__safefree_tmp = (void *)&(x); \
|
void **__safefree_tmp = (void**)(&(x)); \
|
||||||
free(*__safefree_tmp); \
|
free(*__safefree_tmp); \
|
||||||
*__safefree_tmp = NULL; \
|
*__safefree_tmp = NULL; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
Loading…
Reference in New Issue
Block a user