[ros-diffs] [tkreuzer] 50467: [CMAKE] Copy vadefs.h from amd64 branch

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Sat Jan 22 17:52:34 UTC 2011


Author: tkreuzer
Date: Sat Jan 22 17:52:33 2011
New Revision: 50467

URL: http://svn.reactos.org/svn/reactos?rev=50467&view=rev
Log:
[CMAKE]
Copy vadefs.h from amd64 branch

Modified:
    branches/cmake-bringup/include/crt/vadefs.h

Modified: branches/cmake-bringup/include/crt/vadefs.h
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/crt/vadefs.h?rev=50467&r1=50466&r2=50467&view=diff
==============================================================================
--- branches/cmake-bringup/include/crt/vadefs.h [iso-8859-1] (original)
+++ branches/cmake-bringup/include/crt/vadefs.h [iso-8859-1] Sat Jan 22 17:52:33 2011
@@ -81,14 +81,24 @@
 #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 defined(_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 _PTRSIZEOF(n) ((sizeof(n) + sizeof(void*) - 1) & ~(sizeof(void*) - 1))
+#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)




More information about the Ros-diffs mailing list