From a0f9e7187594aca4bd323473479a8da91ccd5d67 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Mon, 23 Apr 2001 18:11:41 +0000 Subject: [PATCH] Extracted MEMCHECK into an extra function to avoid a gcc-2.95.2 compiler bug. --- objects/region.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/objects/region.c b/objects/region.c index 29a1092cbdd..8c0e4107346 100644 --- a/objects/region.c +++ b/objects/region.c @@ -104,16 +104,19 @@ DEFAULT_DEBUG_CHANNEL(region); /* * Check to see if there is enough memory in the present region. */ -#define MEMCHECK(reg, rect, firstrect){\ - if ((reg)->numRects >= ((reg)->size - 1)){\ - (firstrect) = HeapReAlloc( GetProcessHeap(), 0, \ - (firstrect), (2 * (sizeof(RECT)) * ((reg)->size)));\ - if ((firstrect) == 0)\ - return;\ - (reg)->size *= 2;\ - (rect) = &(firstrect)[(reg)->numRects];\ - }\ - } + +static inline int xmemcheck(WINEREGION *reg, LPRECT *rect, LPRECT *firstrect ) { + if (reg->numRects >= (reg->size - 1)) { + *firstrect = HeapReAlloc( GetProcessHeap(), 0, *firstrect, (2 * (sizeof(RECT)) * (reg->size))); + if (*firstrect == 0) + return 0; + reg->size *= 2; + *rect = (*firstrect)+reg->numRects; + } + return 1; +} + +#define MEMCHECK(reg, rect, firstrect) xmemcheck(reg,&(rect),&(firstrect)) #define EMPTY_REGION(pReg) { \ (pReg)->numRects = 0; \