mirror of
https://github.com/reactos/reactos.git
synced 2024-12-30 19:14:31 +00:00
ugly macro hack to use alloca() while keeping Wine's developers happy
svn path=/trunk/; revision=15300
This commit is contained in:
parent
5cec531950
commit
ac178266c3
1 changed files with 5 additions and 7 deletions
|
@ -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
|
#else
|
||||||
|
|
||||||
#define TMP_ALLOC(s) alloca(s)
|
// ugly hack to use alloca() while keeping Wine's developers happy
|
||||||
#define TMP_FREE(p)
|
#define HeapAlloc(h,f,s) alloca(s)
|
||||||
|
#define HeapFree(h,f,p)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1220,7 +1218,7 @@ static void SortDirectory(Entry* dir, SORT_ORDER sortOrder)
|
||||||
len++;
|
len++;
|
||||||
|
|
||||||
if (len) {
|
if (len) {
|
||||||
array = (Entry**) TMP_ALLOC(len*sizeof(Entry*));
|
array = (Entry**) HeapAlloc(GetProcessHeap(), 0, len*sizeof(Entry*));
|
||||||
|
|
||||||
p = array;
|
p = array;
|
||||||
for(entry=dir->down; entry; entry=entry->next)
|
for(entry=dir->down; entry; entry=entry->next)
|
||||||
|
@ -1236,7 +1234,7 @@ static void SortDirectory(Entry* dir, SORT_ORDER sortOrder)
|
||||||
|
|
||||||
(*p)->next = 0;
|
(*p)->next = 0;
|
||||||
|
|
||||||
TMP_FREE(array);
|
HeapFree(GetProcessHeap(), 0, array);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue