Fix the free macro for gdb/mingw

This commit is contained in:
jsalmon3 2002-05-21 00:15:18 +00:00
parent 486142cd87
commit 25c2673323
2 changed files with 4 additions and 4 deletions
src
include
stratagus

View file

@ -100,9 +100,10 @@
#endif
#ifdef WIN32
#if defined(WIN32) && defined(DEBUG)
// GDB + MINGW doesn't like free(0)
#include <stdlib.h>
#define free(x) do { if( (x) ) free(x); } while(0)
#define free(x) do { void* __x; __x=(x); if( __x ) free( __x ); } while(0)
#endif
#endif // } __GNUC__

View file

@ -127,8 +127,7 @@ global void CleanPlayers(void)
//
if( (ptr=RaceWcNames) ) { // Free all old names
while( *ptr ) {
free(*ptr);
ptr++;
free(*ptr++);
}
free(RaceWcNames);
RaceWcNames=NULL;