summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper2025-09-02 18:30:22 +0200
committerJasper2025-09-02 18:30:22 +0200
commita533f9080d1a4cd645d0129db4d71487c5375086 (patch)
tree9382b7a274ee55bbae95545c7c8c3447754d5b78
parentabf764dd2d8970150f169b88bd65dadd7baf661f (diff)
'__VA_ARGS__' in benchmark macro -> '##__VA_ARGS__'
Seems to solve the empty argument problem for macros with variadic argument lists. GCC only
-rw-r--r--debug.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/debug.c b/debug.c
index 844e8e8..e37f740 100644
--- a/debug.c
+++ b/debug.c
@@ -45,7 +45,7 @@
#define BENCHMARK_RAND1(m, n, bound_l, bound_u, func,...) \
do { \
Matrix *A = matrix_rand((m), (n), (bound_l), (bound_u), MATRIX_NONE); \
- func(A, __VA_ARGS__); \
+ func(A, ##__VA_ARGS__); \
free(A); \
} while(0)
@@ -55,7 +55,6 @@ int main()
/* run_tests() */
/* TODO: Add timing. For now the macro executes the given function once */
- /* TODO: Fix for functions that take just the matrix and no additional arguments */
BENCHMARK_RAND1(
100, 100, /* Dimensions: m x n */
0, 100, /* Value bounds */