[ros-diffs] [dreimer] 47938: Another updated wine header to fix some synched winetest's build process.

dreimer at svn.reactos.org dreimer at svn.reactos.org
Sun Jul 4 19:06:39 UTC 2010


Author: dreimer
Date: Sun Jul  4 19:06:38 2010
New Revision: 47938

URL: http://svn.reactos.org/svn/reactos?rev=47938&view=rev
Log:
Another updated wine header to fix some synched winetest's build process.

Modified:
    trunk/reactos/include/reactos/wine/test.h

Modified: trunk/reactos/include/reactos/wine/test.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/test.h?rev=47938&r1=47937&r2=47938&view=diff
==============================================================================
--- trunk/reactos/include/reactos/wine/test.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/wine/test.h [iso-8859-1] Sun Jul  4 19:06:38 2010
@@ -65,6 +65,14 @@
 extern const char *wine_dbgstr_wn( const WCHAR *str, int n );
 static inline const char *wine_dbgstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); }
 
+/* strcmpW is avaiable for tests compiled under Wine, but not in standalone
+ * builds under Windows, so we reimplement it under a different name. */
+static inline int winetest_strcmpW( const WCHAR *str1, const WCHAR *str2 )
+{
+    while (*str1 && (*str1 == *str2)) { str1++; str2++; }
+    return *str1 - *str2;
+}
+
 #ifdef STANDALONE
 #define START_TEST(name) \
   static void func_##name(void); \
@@ -74,23 +82,31 @@
 #define START_TEST(name) void func_##name(void)
 #endif
 
+#if defined(__x86_64__) && defined(__GNUC__) && defined(__WINE_USE_MSVCRT)
+#define __winetest_cdecl __cdecl
+#define __winetest_va_list __builtin_ms_va_list
+#else
+#define __winetest_cdecl
+#define __winetest_va_list va_list
+#endif
+
 extern int broken( int condition );
-extern int winetest_vok( int condition, const char *msg, va_list ap );
-extern void winetest_vskip( const char *msg, va_list ap );
+extern int winetest_vok( int condition, const char *msg, __winetest_va_list ap );
+extern void winetest_vskip( const char *msg, __winetest_va_list ap );
 
 #ifdef __GNUC__
 
-extern void winetest_ok( int condition, const char *msg, ... ) __attribute__((format (printf,2,3) ));
-extern void winetest_skip( const char *msg, ... ) __attribute__((format (printf,1,2)));
-extern void winetest_win_skip( const char *msg, ... ) __attribute__((format (printf,1,2)));
-extern void winetest_trace( const char *msg, ... ) __attribute__((format (printf,1,2)));
+extern void __winetest_cdecl winetest_ok( int condition, const char *msg, ... ) __attribute__((format (printf,2,3) ));
+extern void __winetest_cdecl winetest_skip( const char *msg, ... ) __attribute__((format (printf,1,2)));
+extern void __winetest_cdecl winetest_win_skip( const char *msg, ... ) __attribute__((format (printf,1,2)));
+extern void __winetest_cdecl winetest_trace( const char *msg, ... ) __attribute__((format (printf,1,2)));
 
 #else /* __GNUC__ */
 
-extern void winetest_ok( int condition, const char *msg, ... );
-extern void winetest_skip( const char *msg, ... );
-extern void winetest_win_skip( const char *msg, ... );
-extern void winetest_trace( const char *msg, ... );
+extern void __winetest_cdecl winetest_ok( int condition, const char *msg, ... );
+extern void __winetest_cdecl winetest_skip( const char *msg, ... );
+extern void __winetest_cdecl winetest_win_skip( const char *msg, ... );
+extern void __winetest_cdecl winetest_trace( const char *msg, ... );
 
 #endif /* __GNUC__ */
 
@@ -160,6 +176,14 @@
 
 #include <stdio.h>
 
+#if defined(__x86_64__) && defined(__GNUC__) && defined(__WINE_USE_MSVCRT)
+# define __winetest_va_start(list,arg) __builtin_ms_va_start(list,arg)
+# define __winetest_va_end(list) __builtin_ms_va_end(list)
+#else
+# define __winetest_va_start(list,arg) va_start(list,arg)
+# define __winetest_va_end(list) va_end(list)
+#endif
+
 struct test
 {
     const char *name;
@@ -275,7 +299,7 @@
  * Return:
  *   0 if condition does not have the expected value, 1 otherwise
  */
-int winetest_vok( int condition, const char *msg, va_list args )
+int winetest_vok( int condition, const char *msg, __winetest_va_list args )
 {
     tls_data* data=get_tls_data();
 
@@ -322,30 +346,30 @@
     }
 }
 
-void winetest_ok( int condition, const char *msg, ... )
-{
-    va_list valist;
- 
-    va_start(valist, msg);
+void __winetest_cdecl winetest_ok( int condition, const char *msg, ... )
+{
+    __winetest_va_list valist;
+
+    __winetest_va_start(valist, msg);
     winetest_vok(condition, msg, valist);
-    va_end(valist);
-}
-
-void winetest_trace( const char *msg, ... )
-{
-    va_list valist;
+    __winetest_va_end(valist);
+}
+
+void __winetest_cdecl winetest_trace( const char *msg, ... )
+{
+    __winetest_va_list valist;
     tls_data* data=get_tls_data();
 
     if (winetest_debug > 0)
     {
         fprintf( stdout, "%s:%d: ", data->current_file, data->current_line );
-        va_start(valist, msg);
+        __winetest_va_start(valist, msg);
         vfprintf(stdout, msg, valist);
-        va_end(valist);
-    }
-}
-
-void winetest_vskip( const char *msg, va_list args )
+        __winetest_va_end(valist);
+    }
+}
+
+void winetest_vskip( const char *msg, __winetest_va_list args )
 {
     tls_data* data=get_tls_data();
 
@@ -354,23 +378,23 @@
     skipped++;
 }
 
-void winetest_skip( const char *msg, ... )
-{
-    va_list valist;
-    va_start(valist, msg);
+void __winetest_cdecl winetest_skip( const char *msg, ... )
+{
+    __winetest_va_list valist;
+    __winetest_va_start(valist, msg);
     winetest_vskip(msg, valist);
-    va_end(valist);
-}
-
-void winetest_win_skip( const char *msg, ... )
-{
-    va_list valist;
-    va_start(valist, msg);
+    __winetest_va_end(valist);
+}
+
+void __winetest_cdecl winetest_win_skip( const char *msg, ... )
+{
+    __winetest_va_list valist;
+    __winetest_va_start(valist, msg);
     if (strcmp(winetest_platform, "windows") == 0)
         winetest_vskip(msg, valist);
     else
         winetest_vok(0, msg, valist);
-    va_end(valist);
+    __winetest_va_end(valist);
 }
 
 void winetest_start_todo( const char* platform )




More information about the Ros-diffs mailing list