ugly macro hack to use alloca() while keeping Wine's developers happy

svn path=/trunk/; revision=15300
This commit is contained in:
Martin Fuchs 2005-05-15 09:55:56 +00:00
parent 5cec531950
commit ac178266c3

View file

@ -188,13 +188,11 @@ int swprintf(wchar_t* buffer, const wchar_t* fmt, ...)
}
#define TMP_ALLOC(s) HeapAlloc(GetProcessHeap(), 0, s)
#define TMP_FREE(p) HeapFree(GetProcessHeap(), 0, p)
#else
#define TMP_ALLOC(s) alloca(s)
#define TMP_FREE(p)
// ugly hack to use alloca() while keeping Wine's developers happy
#define HeapAlloc(h,f,s) alloca(s)
#define HeapFree(h,f,p)
#endif
@ -1220,7 +1218,7 @@ static void SortDirectory(Entry* dir, SORT_ORDER sortOrder)
len++;
if (len) {
array = (Entry**) TMP_ALLOC(len*sizeof(Entry*));
array = (Entry**) HeapAlloc(GetProcessHeap(), 0, len*sizeof(Entry*));
p = array;
for(entry=dir->down; entry; entry=entry->next)
@ -1236,7 +1234,7 @@ static void SortDirectory(Entry* dir, SORT_ORDER sortOrder)
(*p)->next = 0;
TMP_FREE(array);
HeapFree(GetProcessHeap(), 0, array);
}
}