Author: tkreuzer
Date: Sat Feb 6 02:24:30 2010
New Revision: 45442
URL:
http://svn.reactos.org/svn/reactos?rev=45442&view=rev
Log:
Add _crt_va_start, _crt_va_arg, _crt_va_end and __va_copy definitions for (MSVC &
AMD64)
Modified:
branches/ros-amd64-bringup/reactos/include/crt/vadefs.h
Modified: branches/ros-amd64-bringup/reactos/include/crt/vadefs.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/crt/vadefs.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/crt/vadefs.h [iso-8859-1] Sat Feb 6
02:24:30 2010
@@ -81,14 +81,23 @@
#define __va_copy(d,s) __builtin_va_copy(d,s)
#elif defined(_MSC_VER)
-#if defined(_M_IA64) || defined(_M_AMD64) || defined(_M_CEE)
-//#error Please implement me
-#endif
-
+#if defiend(_M_IX86)
#define _crt_va_start(v,l) ((void)((v) = (va_list)_ADDRESSOF(l) + _INTSIZEOF(l)))
#define _crt_va_arg(v,l) (*(l *)(((v) += _INTSIZEOF(l)) - _INTSIZEOF(l)))
#define _crt_va_end(v) ((void)((v) = (va_list)0))
#define __va_copy(d,s) ((void)((d) = (s)))
+#elif defined(_M_AMD64)
+#define _ISSTRUCT(t) ((sizeof(t) > sizeof(void*)) || (sizeof(t) & (sizeof(t)-1))
!= 0)
+#define _crt_va_start(v,l) ((void)((v) = (va_list)_ADDRESSOF(l) + _PTRSIZEOF(l)))
+#define _crt_va_arg(v,t) _ISSTRUCT(t) ? \
+ (**(t**)(((v) += sizeof(void*)) - sizeof(void*))) : \
+ (*(t*)(((v) += sizeof(void*)) - sizeof(void*)))
+#define _crt_va_end(v) ((void)((v) = (va_list)0))
+#define __va_copy(d,s) ((void)((d) = (s)))
+#else //if defined(_M_IA64) || defined(_M_CEE)
+#error Please implement me
+#endif
+
#endif
#if !defined(va_copy) && (!defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >=
199900L)