[ros-diffs] [hyperion] 41429: modified include/crt/stdarg.h modified include/crt/vadefs.h Our headers suck so hard. More Visual C++ compatibility

hyperion at svn.reactos.org hyperion at svn.reactos.org
Wed Jun 17 04:18:15 CEST 2009


Author: hyperion
Date: Wed Jun 17 06:18:13 2009
New Revision: 41429

URL: http://svn.reactos.org/svn/reactos?rev=41429&view=rev
Log:
modified   include/crt/stdarg.h
modified   include/crt/vadefs.h
   Our headers suck so hard. More Visual C++ compatibility

Modified:
    trunk/reactos/include/crt/stdarg.h
    trunk/reactos/include/crt/vadefs.h

Modified: trunk/reactos/include/crt/stdarg.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/stdarg.h?rev=41429&r1=41428&r2=41429&view=diff
==============================================================================
--- trunk/reactos/include/crt/stdarg.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/stdarg.h [iso-8859-1] Wed Jun 17 06:18:13 2009
@@ -44,15 +44,18 @@
 
 /* Define __gnuc_va_list.  */
 
+#ifdef __GNUC__
 #ifndef __GNUC_VA_LIST
 #define __GNUC_VA_LIST
 typedef __builtin_va_list __gnuc_va_list;
+#endif
 #endif
 
 /* Define the standard macros for the user,
    if this invocation was from the user program.  */
 #ifdef _STDARG_H
 
+#ifdef __GNUC__
 #define va_start(v,l)	__builtin_va_start(v,l)
 #define va_end(v)	__builtin_va_end(v)
 #define va_arg(v,l)	__builtin_va_arg(v,l)
@@ -60,11 +63,12 @@
 #define va_copy(d,s)	__builtin_va_copy(d,s)
 #endif
 #define __va_copy(d,s)	__builtin_va_copy(d,s)
+#endif
 
 /* Define va_list, if desired, from __gnuc_va_list. */
 /* We deliberately do not define va_list when called from
    stdio.h, because ANSI C says that stdio.h is not supposed to define
-   va_list.  stdio.h needs to have access to that data type, 
+   va_list.  stdio.h needs to have access to that data type,
    but must not use that name.  It should use the name __gnuc_va_list,
    which is safe because it is reserved for the implementation.  */
 
@@ -88,7 +92,9 @@
 #define _VA_LIST va_list
 #endif
 #endif /* __i860__ */
+#ifdef __GNUC__
 typedef __gnuc_va_list va_list;
+#endif
 #ifdef _SCO_DS
 #define __VA_LIST
 #endif
@@ -108,7 +114,9 @@
 #ifndef _VA_LIST_T_H
 /* The macro __va_list__ is used by BeOS.  */
 #ifndef __va_list__
+#ifdef __GNUC__
 typedef __gnuc_va_list va_list;
+#endif
 #endif /* not __va_list__ */
 #endif /* not _VA_LIST_T_H */
 #endif /* not _VA_LIST */

Modified: trunk/reactos/include/crt/vadefs.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/vadefs.h?rev=41429&r1=41428&r2=41429&view=diff
==============================================================================
--- trunk/reactos/include/crt/vadefs.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/vadefs.h [iso-8859-1] Wed Jun 17 06:18:13 2009
@@ -37,14 +37,20 @@
 #endif
 #endif
 
+#ifdef __GNUC__
 #ifndef __GNUC_VA_LIST
 #define __GNUC_VA_LIST
   typedef __builtin_va_list __gnuc_va_list;
 #endif
+#endif
 
 #ifndef _VA_LIST_DEFINED
 #define _VA_LIST_DEFINED
+#if defined(__GNUC__)
   typedef __gnuc_va_list va_list;
+#elif defined(_MSC_VER)
+  typedef char *  va_list;
+#endif
 #endif
 
 #ifdef __cplusplus
@@ -66,16 +72,28 @@
 #define _APALIGN(t,ap) (__alignof(t))
 #endif
 
-#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L
-#define va_copy(d,s)	__builtin_va_copy(d,s)
-#endif
-#define __va_copy(d,s)	__builtin_va_copy(d,s)
-
 #define _INTSIZEOF(n) ((sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1))
 
+#if defined(__GNUC__)
 #define _crt_va_start(v,l)	__builtin_va_start(v,l)
 #define _crt_va_arg(v,l)	__builtin_va_arg(v,l)
 #define _crt_va_end(v)	__builtin_va_end(v)
+#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
+
+#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)))
+#endif
+
+#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L
+#define va_copy(d,s)	__va_copy((d),(s))
+#endif
 
 #ifdef __cplusplus
 }



More information about the Ros-diffs mailing list