aboutsummaryrefslogtreecommitdiff
path: root/win32/include
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2016-06-19 09:48:14 +0300
committerAvi Halachmi (:avih) <avihpit@yahoo.com>2016-06-19 14:44:18 +0300
commitab8422c8e72f347230e61826198d08f8e1cdcdad (patch)
tree6cf523323dae2d6e8f938532e37eac02fb3ec774 /win32/include
parentb67951bed403cb23482432930dbca1256a40cc2c (diff)
downloadtinycc-ab8422c8e72f347230e61826198d08f8e1cdcdad.tar.gz
tinycc-ab8422c8e72f347230e61826198d08f8e1cdcdad.tar.bz2
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.
Diffstat (limited to 'win32/include')
-rw-r--r--win32/include/malloc.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/win32/include/malloc.h b/win32/include/malloc.h
index 87f1868..fc783a8 100644
--- a/win32/include/malloc.h
+++ b/win32/include/malloc.h
@@ -82,7 +82,13 @@ extern "C" {
#undef _alloca
#define _alloca(x) __builtin_alloca((x))
#else
- void *__cdecl _alloca(size_t _Size);
+ /* tcc implements alloca internally and exposes it (since commit d778bde7).
+ /* alloca is declared at include/stddef.h (which is distributed with tcc).
+ */
+#ifdef _alloca
+#undef _alloca
+#endif
+#define _alloca(x) alloca((x))
#endif
_CRTIMP size_t __cdecl _get_sbh_threshold(void);
_CRTIMP int __cdecl _set_sbh_threshold(size_t _NewValue);