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>
This commit is contained in:
parent
4a983e3118
commit
f6dc7c88ba
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue