Add printf format attribute to cairo_test_log.

This commit is contained in:
Carl Worth 2006-01-09 17:18:12 +00:00
parent ff5207ed11
commit d6cb82c372
2 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,7 @@
2006-01-09 Carl Worth <cworth@cworth.org>
* test/cairo-test.h: Add printf format attribute to cairo_test_log.
2006-01-06 Carl Worth <cworth@cworth.org>
Reviewed by keithp

View file

@ -58,6 +58,13 @@ typedef unsigned __int64 uint64_t;
#error Cannot find definitions for fixed-width integral types (uint8_t, uint32_t, \etc.)
#endif
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
#define CAIRO_PRINTF_FORMAT(fmt_index, va_index) \
__attribute__((__format__(__printf__, fmt_index, va_index)))
#else
#define CAIRO_PRINTF_FORMAT(fmt_index, va_index)
#endif
typedef enum cairo_test_status {
CAIRO_TEST_SUCCESS = 0,
CAIRO_TEST_FAILURE,
@ -119,7 +126,7 @@ cairo_test_init (const char *test_name);
/* Print a message to the log file, ala printf. */
void
cairo_test_log (const char *fmt, ...);
cairo_test_log (const char *fmt, ...) CAIRO_PRINTF_FORMAT(1, 2);
/* Helper functions that take care of finding source images even when
* building in a non-srcdir manner, (ie. the tests will be run in a