Use C99 varadic macros instead of GCC ones

This commit is contained in:
Mike Hommey
2014-05-21 18:00:15 +09:00
committed by Jason Evans
parent 1ad4a6e9f9
commit 7330c3770a
2 changed files with 196 additions and 196 deletions

View File

@@ -141,8 +141,8 @@ TEST_BEGIN(test_malloc_snprintf_truncated)
char buf[BUFLEN];
int result;
size_t len;
#define TEST(expected_str_untruncated, fmt...) do { \
result = malloc_snprintf(buf, len, fmt); \
#define TEST(expected_str_untruncated, ...) do { \
result = malloc_snprintf(buf, len, __VA_ARGS__); \
assert_d_eq(strncmp(buf, expected_str_untruncated, len-1), 0, \
"Unexpected string inequality (\"%s\" vs \"%s\")", \
buf, expected_str_untruncated); \
@@ -173,8 +173,8 @@ TEST_BEGIN(test_malloc_snprintf)
#define BUFLEN 128
char buf[BUFLEN];
int result;
#define TEST(expected_str, fmt...) do { \
result = malloc_snprintf(buf, sizeof(buf), fmt); \
#define TEST(expected_str, ...) do { \
result = malloc_snprintf(buf, sizeof(buf), __VA_ARGS__); \
assert_str_eq(buf, expected_str, "Unexpected output"); \
assert_d_eq(result, strlen(expected_str), "Unexpected result"); \
} while (0)