summaryrefslogtreecommitdiffhomepage
path: root/arch/nt32/bits/stdarg.h
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-04-05 16:48:11 -0400
committermidipix <writeonce@midipix.org>2015-04-05 16:48:11 -0400
commit20a5ca45ef2f5716e8f2dea42c7e8a6b3367619f (patch)
treec8461f68b5f3bf375e31660eb14fbb7777e2f822 /arch/nt32/bits/stdarg.h
parent2a9a46e0b0a1f7e0e21b1152aa2529d94c57db35 (diff)
downloadmmglue-20a5ca45ef2f5716e8f2dea42c7e8a6b3367619f.tar.bz2
mmglue-20a5ca45ef2f5716e8f2dea42c7e8a6b3367619f.tar.xz
nt32/bits: initial commit.
these header files should be kept in sync with their linux x86_64 counterparts, with three minor exceptions: 1) page size (65536) 2) jmp_buf (8 pointers) 3) TIOCGPTN and TIOCSPTLCK (normal sequence) signed-off by Z. Gilboa; see copying.midipix (9cd0746c) for additional information.
Diffstat (limited to 'arch/nt32/bits/stdarg.h')
-rw-r--r--arch/nt32/bits/stdarg.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/nt32/bits/stdarg.h b/arch/nt32/bits/stdarg.h
new file mode 100644
index 0000000..6b1830d
--- /dev/null
+++ b/arch/nt32/bits/stdarg.h
@@ -0,0 +1,9 @@
+#define __VA_ALIGNED_SIZE(x) ((sizeof(x) + sizeof(int) - 1) & ~(sizeof(int) - 1))
+
+#define va_start(ap, last) ((ap) = (void *)(((char *)&(last)) + __VA_ALIGNED_SIZE(last)))
+#define va_end(ap) ((void)0)
+#define va_copy(dest, src) ((dest) = (src))
+
+#define va_arg(ap, type) \
+ ( ((ap) = (va_list)((char *)(ap) + __VA_ALIGNED_SIZE(type))), \
+ *(type *)(void *)((char *)(ap) - __VA_ALIGNED_SIZE(type)) )