Module: wine Branch: master Commit: f6dc7c88bac10b4f44cc195bc60407b03c861a02 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f6dc7c88bac10b4f44cc195bc6...
Author: Francois Gouget fgouget@codeweavers.com Date: Wed Jan 13 12:42:54 2016 +0100
kernel32/tests: Help the tests portably declare printf()-syle functions.
To do so they can now use the WINETEST_PRINTF_ATTR() macro.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/kernel32/tests/debugger.c | 8 +------- include/wine/test.h | 21 ++++++++------------- 2 files changed, 9 insertions(+), 20 deletions(-)
diff --git a/dlls/kernel32/tests/debugger.c b/dlls/kernel32/tests/debugger.c index 326a903..73320c6 100644 --- a/dlls/kernel32/tests/debugger.c +++ b/dlls/kernel32/tests/debugger.c @@ -30,12 +30,6 @@ #define STATUS_DEBUGGER_INACTIVE ((NTSTATUS) 0xC0000354) #endif
-#ifdef __GNUC__ -#define PRINTF_ATTR(fmt,args) __attribute__((format (printf,fmt,args))) -#else -#define PRINTF_ATTR(fmt,args) -#endif - #define child_ok (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : test_child_ok
static int myARGC; @@ -49,7 +43,7 @@ static struct _TEB * (WINAPI *pNtCurrentTeb)(void);
static LONG child_failures;
-static void PRINTF_ATTR(2, 3) test_child_ok(int condition, const char *msg, ...) +static void WINETEST_PRINTF_ATTR(2, 3) test_child_ok(int condition, const char *msg, ...) { va_list valist;
diff --git a/include/wine/test.h b/include/wine/test.h index a5b67a0..bed44f9 100644 --- a/include/wine/test.h +++ b/include/wine/test.h @@ -98,20 +98,15 @@ 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__ +# define WINETEST_PRINTF_ATTR(fmt,args) __attribute__((format (printf,fmt,args))) +#else +# define WINETEST_PRINTF_ATTR(fmt,args) +#endif
-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_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__ */ +extern void __winetest_cdecl winetest_ok( int condition, const char *msg, ... ) WINETEST_PRINTF_ATTR(2,3); +extern void __winetest_cdecl winetest_skip( const char *msg, ... ) WINETEST_PRINTF_ATTR(1,2); +extern void __winetest_cdecl winetest_win_skip( const char *msg, ... ) WINETEST_PRINTF_ATTR(1,2); +extern void __winetest_cdecl winetest_trace( const char *msg, ... ) WINETEST_PRINTF_ATTR(1,2);
#define ok_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : winetest_ok #define skip_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : winetest_skip