浏览代码

Use C99 variadic macro support, not GNU

Samuel Thibault 12 年之前
父节点
当前提交
c763a690c2

+ 6 - 6
mpi/src/starpu_mpi_private.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010, 2012  Université de Bordeaux 1
+ * Copyright (C) 2010, 2012-2013  Université de Bordeaux 1
  * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -36,23 +36,23 @@ void _starpu_mpi_set_debug_level(int level);
 #endif
 
 #ifdef STARPU_VERBOSE
-#  define _STARPU_MPI_DEBUG(level, fmt, args ...) \
+#  define _STARPU_MPI_DEBUG(level, fmt, ...) \
 	do \
 	{								\
 		if (!getenv("STARPU_SILENT") && level <= _debug_level)	\
 		{							\
 			if (_debug_rank == -1) MPI_Comm_rank(MPI_COMM_WORLD, &_debug_rank); \
-			fprintf(stderr, "%*s[%d][starpu_mpi][%s] " fmt , (_debug_rank+1)*4, "", _debug_rank, __starpu_func__ ,##args); \
+			fprintf(stderr, "%*s[%d][starpu_mpi][%s] " fmt , (_debug_rank+1)*4, "", _debug_rank, __starpu_func__ ,## __VA_ARGS__); \
 			fflush(stderr); \
 		}			\
 	} while(0);
 #else
-#  define _STARPU_MPI_DEBUG(level, fmt, args ...)
+#  define _STARPU_MPI_DEBUG(level, fmt, ...)
 #endif
 
-#define _STARPU_MPI_DISP(fmt, args ...) do { if (!getenv("STARPU_SILENT")) { \
+#define _STARPU_MPI_DISP(fmt, ...) do { if (!getenv("STARPU_SILENT")) { \
 	       				     if (_debug_rank == -1) MPI_Comm_rank(MPI_COMM_WORLD, &_debug_rank); \
-                                             fprintf(stderr, "%*s[%d][starpu_mpi][%s] " fmt , (_debug_rank+1)*4, "", _debug_rank, __starpu_func__ ,##args); \
+                                             fprintf(stderr, "%*s[%d][starpu_mpi][%s] " fmt , (_debug_rank+1)*4, "", _debug_rank, __starpu_func__ ,## __VA_ARGS__); \
                                              fflush(stderr); }} while(0);
 
 #ifdef STARPU_VERBOSE0

+ 3 - 3
mpi/tests/helper.h

@@ -18,9 +18,9 @@
 
 #define STARPU_TEST_SKIPPED 77
 
-#define FPRINTF(ofile, fmt, args ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ##args); }} while(0)
-#define FPRINTF_MPI(fmt, args ...) do { if (!getenv("STARPU_SILENT")) { \
+#define FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0)
+#define FPRINTF_MPI(fmt, ...) do { if (!getenv("STARPU_SILENT")) { \
     						int _disp_rank; MPI_Comm_rank(MPI_COMM_WORLD, &_disp_rank);       \
-                                                fprintf(stderr, "[%d][starpu_mpi][%s] " fmt , _disp_rank, __starpu_func__ ,##args); \
+                                                fprintf(stderr, "[%d][starpu_mpi][%s] " fmt , _disp_rank, __starpu_func__ ,## __VA_ARGS__); \
                                                 fflush(stderr); }} while(0);
 

+ 2 - 2
mpi/tests/mpi_reduction_kernels.c

@@ -17,9 +17,9 @@
 #include <starpu.h>
 #include <mpi.h>
 
-#define _DISPLAY(fmt, args ...) do { \
+#define _DISPLAY(fmt, ...) do { \
 		int _display_rank; MPI_Comm_rank(MPI_COMM_WORLD, &_display_rank);	\
-		fprintf(stderr, "[%d][%s] " fmt , _display_rank, __starpu_func__ ,##args); 	\
+		fprintf(stderr, "[%d][%s] " fmt , _display_rank, __starpu_func__ ,## __VA_ARGS__); 	\
 		fflush(stderr); } while(0)
 
 /*

+ 1 - 1
sc_hypervisor/examples/app_driven_test/app_driven_test.c

@@ -21,7 +21,7 @@
 
 #define NTASKS 1000
 #define NINCR 10
-#define FPRINTF(ofile, fmt, args ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ##args); }} while(0)
+#define FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0)
 
 struct params
 {

+ 2 - 2
sc_hypervisor/examples/cholesky/cholesky.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010, 2011  Université de Bordeaux 1
+ * Copyright (C) 2009, 2010, 2011, 2013  Université de Bordeaux 1
  * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifiqu
  * Copyright (C) 2011, 2012  INRIA
  *
@@ -33,7 +33,7 @@
 #include <starpu.h>
 #include <starpu_bound.h>
 
-#define FPRINTF(ofile, fmt, args ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ##args); }} while(0)
+#define FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0)
 #define NMAXBLOCKS	32
 
 #define TAG11(k)	((starpu_tag_t)( (1ULL<<60) | (unsigned long long)(k)))

+ 1 - 1
sc_hypervisor/examples/lp_test/lp_test.c

@@ -21,7 +21,7 @@
 
 #define NTASKS 1000
 #define NINCR 10
-#define FPRINTF(ofile, fmt, args ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ##args); }} while(0)
+#define FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0)
 
 
 unsigned val[2];

+ 5 - 5
src/common/utils.h

@@ -81,9 +81,9 @@
 #endif
 
 #ifdef STARPU_VERBOSE
-#  define _STARPU_DEBUG(fmt, args ...) do { if (!getenv("STARPU_SILENT")) {fprintf(stderr, STARPU_DEBUG_PREFIX"[%s] " fmt ,__starpu_func__ ,##args); fflush(stderr); }} while(0)
+#  define _STARPU_DEBUG(fmt, ...) do { if (!getenv("STARPU_SILENT")) {fprintf(stderr, STARPU_DEBUG_PREFIX"[%s] " fmt ,__starpu_func__ ,## __VA_ARGS__); fflush(stderr); }} while(0)
 #else
-#  define _STARPU_DEBUG(fmt, args ...) do { } while (0)
+#  define _STARPU_DEBUG(fmt, ...) do { } while (0)
 #endif
 
 #ifdef STARPU_VERBOSE0
@@ -96,10 +96,10 @@
 #  define _STARPU_LOG_OUT_TAG(outtag)
 #endif
 
-#define _STARPU_DISP(fmt, args ...) do { if (!getenv("STARPU_SILENT")) {fprintf(stderr, STARPU_DEBUG_PREFIX"[%s] " fmt ,__starpu_func__ ,##args); }} while(0)
-#define _STARPU_ERROR(fmt, args ...)                                                  \
+#define _STARPU_DISP(fmt, ...) do { if (!getenv("STARPU_SILENT")) {fprintf(stderr, STARPU_DEBUG_PREFIX"[%s] " fmt ,__starpu_func__ ,## __VA_ARGS__); }} while(0)
+#define _STARPU_ERROR(fmt, ...)                                                  \
 	do {                                                                          \
-                fprintf(stderr, "\n\n[starpu][%s] Error: " fmt ,__starpu_func__ ,##args);    \
+                fprintf(stderr, "\n\n[starpu][%s] Error: " fmt ,__starpu_func__ ,## __VA_ARGS__);    \
 		fprintf(stderr, "\n\n");					      \
 		STARPU_ABORT();                                                       \
 	} while (0)

+ 2 - 2
src/core/dependencies/implicit_data_deps.c

@@ -23,9 +23,9 @@
 #include <core/debug.h>
 
 #if 0
-# define _STARPU_DEP_DEBUG(fmt, args ...) fprintf(stderr, fmt, ##args);
+# define _STARPU_DEP_DEBUG(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__);
 #else
-# define _STARPU_DEP_DEBUG(fmt, args ...)
+# define _STARPU_DEP_DEBUG(fmt, ...)
 #endif
 
 static void _starpu_add_ghost_dependency(starpu_data_handle_t handle STARPU_ATTRIBUTE_UNUSED, unsigned long previous STARPU_ATTRIBUTE_UNUSED, struct starpu_task *next STARPU_ATTRIBUTE_UNUSED)

+ 1 - 1
tests/helper.h

@@ -37,7 +37,7 @@
 //#define STARPU_CHECK_RETURN_VALUE_IS_THREAD(err, value, message) {if (err >= 0 || errno != value) { perror(message); return ALL_IS_NOT_OK; }}
 
 //#define STARPU_TEST_OUTPUT
-#define FPRINTF(ofile, fmt, args ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ##args); }} while(0)
+#define FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0)
 
 #ifdef STARPU_HAVE_VALGRIND_H
 static int _starpu_valgrind_print_once STARPU_ATTRIBUTE_UNUSED = 0;