History

win32: malloc.h: use alloca instead of (missing) _alloca

_alloca is not part of msvcrt (and therefore not found if used), and tcc has an internal implementation for alloca for x86[_64] since d778bde7 - initally as _alloca and later changed to alloca. Use it instead.

Avi Halachmi (:avih) committed 10 years ago

Commit ab8422c1 parent b67951b1 file · +7 −1Browse files

Unified · Split

win32/include/malloc.h+7−1
@@ -82,7 +82,13 @@ extern "C" { · 81 unmodified lines
8282 #undef _alloca
8383 #define _alloca(x) __builtin_alloca((x))
8484 #else
85− void *__cdecl _alloca(size_t _Size);
85+ /* tcc implements alloca internally and exposes it (since commit d778bde7).
86+ /* alloca is declared at include/stddef.h (which is distributed with tcc).
87+ */
88+#ifdef _alloca
89+#undef _alloca
90+#endif
91+#define _alloca(x) alloca((x))
8692 #endif
8793 _CRTIMP size_t __cdecl _get_sbh_threshold(void);
8894 _CRTIMP int __cdecl _set_sbh_threshold(size_t _NewValue);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t