aboutsummaryrefslogtreecommitdiff
path: root/include/stdarg.h
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2013-11-25 11:24:02 +0800
committerThomas Preud'homme <robotux@celest.fr>2013-11-25 11:24:02 +0800
commit4260ce1889f6f0f2fe25f4c783dae2b23a4a0021 (patch)
treee8b7f607da64515d1f74dd5c2f44553f50918125 /include/stdarg.h
parent82b257c29cc24e561fd29a0374fcda73feb5d760 (diff)
downloadtinycc-4260ce1889f6f0f2fe25f4c783dae2b23a4a0021.tar.gz
tinycc-4260ce1889f6f0f2fe25f4c783dae2b23a4a0021.tar.bz2
Add va_* macro implementation for ARM
Diffstat (limited to 'include/stdarg.h')
-rw-r--r--include/stdarg.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/stdarg.h b/include/stdarg.h
index efca0e5..3c1318e 100644
--- a/include/stdarg.h
+++ b/include/stdarg.h
@@ -25,6 +25,17 @@ typedef char *va_list;
#define va_end(ap)
#endif
+#elif __arm__
+typedef char *va_list;
+#define _tcc_alignof(type) ((int)&((struct {char c;type x;} *)0)->x)
+#define _tcc_align(addr,type) (((unsigned)addr + _tcc_alignof(type) - 1) \
+ & ~(_tcc_alignof(type) - 1))
+#define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3)
+#define va_arg(ap,type) (ap = (void *) ((_tcc_align(ap,type)+sizeof(type)+3) \
+ &~3), *(type *)(ap - ((sizeof(type)+3)&~3)))
+#define va_copy(dest, src) (dest) = (src)
+#define va_end(ap)
+
#else /* __i386__ */
typedef char *va_list;
/* only correct for i386 */