From c538757a38df05a60f306fe8b193c4bc38f78a7b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Apr 2015 05:06:22 +0200 Subject: + Added STORM_REALLOC --- src/StormCommon.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/StormCommon.h') diff --git a/src/StormCommon.h b/src/StormCommon.h index c806ce0..25f148e 100644 --- a/src/StormCommon.h +++ b/src/StormCommon.h @@ -107,13 +107,15 @@ typedef struct _MPQ_SIGNATURE_INFO #if defined(_MSC_VER) && defined(_DEBUG) -#define STORM_ALLOC(type, nitems) (type *)HeapAlloc(GetProcessHeap(), 0, ((nitems) * sizeof(type))) -#define STORM_FREE(ptr) HeapFree(GetProcessHeap(), 0, ptr) +#define STORM_ALLOC(type, nitems) (type *)HeapAlloc(GetProcessHeap(), 0, ((nitems) * sizeof(type))) +#define STORM_REALLOC(type, ptr, nitems) (type *)HeapReAlloc(GetProcessHeap(), 0, ptr, ((nitems) * sizeof(type))) +#define STORM_FREE(ptr) HeapFree(GetProcessHeap(), 0, ptr) #else -#define STORM_ALLOC(type, nitems) (type *)malloc((nitems) * sizeof(type)) -#define STORM_FREE(ptr) free(ptr) +#define STORM_ALLOC(type, nitems) (type *)malloc((nitems) * sizeof(type)) +#define STORM_REALLOC(type, ptr, nitems) (type *)realloc(ptr, ((nitems) * sizeof(type))) +#define STORM_FREE(ptr) free(ptr) #endif -- cgit v1.2.3