aboutsummaryrefslogtreecommitdiff
path: root/stdarg.h
diff options
context:
space:
mode:
authorbellard <bellard>2002-08-31 12:43:53 +0000
committerbellard <bellard>2002-08-31 12:43:53 +0000
commit5c81896e06ae72da7a976c2ebf808fffb01bd430 (patch)
tree6df0fcaee58bcbfda819a7b4381e3badcbcb5b4b /stdarg.h
parent44b19defc26a93ec32e6f295ac756a297642961e (diff)
downloadtinycc-5c81896e06ae72da7a976c2ebf808fffb01bd430.tar.gz
tinycc-5c81896e06ae72da7a976c2ebf808fffb01bd430.tar.bz2
double fix
Diffstat (limited to 'stdarg.h')
-rw-r--r--stdarg.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/stdarg.h b/stdarg.h
index 5e5d028..37cec19 100644
--- a/stdarg.h
+++ b/stdarg.h
@@ -4,9 +4,8 @@
typedef char *va_list;
/* only correct for i386 */
-/* XXX: incorrect for type size different than 4 bytes*/
-#define va_start(ap,last) ap = ((char *)&(last)) + sizeof(int);
-#define va_arg(ap,type) (ap += sizeof(int), *(type *)(ap - sizeof(int)))
+#define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3)
+#define va_arg(ap,type) (ap += (sizeof(type)+3)&~3, *(type *)(ap - ((sizeof(type)+3)&~3)))
#define va_end(ap)
/* fix a buggy dependency on GCC in libio.h */