Pārlūkot izejas kodu

better define a __starpu_func__ instead of a globally-visible __func__, and factorize in starpu_config.h

Samuel Thibault 14 gadi atpakaļ
vecāks
revīzija
0ed129e2a3
3 mainītis faili ar 5 papildinājumiem un 11 dzēšanām
  1. 2 1
      include/starpu_config.h.in
  2. 1 5
      include/starpu_cuda.h
  3. 2 5
      include/starpu_opencl.h

+ 2 - 1
include/starpu_config.h.in

@@ -59,10 +59,11 @@
 
 #ifdef _MSC_VER
 typedef long starpu_ssize_t;
+#define __starpu_func__ __FUNCTION__
 #else
 #  include <sys/types.h>
 typedef ssize_t starpu_ssize_t;
+#define __starpu_func__ __func__
 #endif
 
-
 #endif

+ 1 - 5
include/starpu_cuda.h

@@ -29,10 +29,6 @@
 extern "C" {
 #endif
 
-#ifdef _MSC_VER
-#define __func__ __FUNCTION__
-#endif
-
 #if defined(__CUDACC__) && defined(STARPU_HAVE_WINDOWS)
 #define STARPU_CUBLAS_OOPS() do { \
 		printf("oops  %s \n", errormsg); \
@@ -40,7 +36,7 @@ extern "C" {
 	} while (0);
 #else
 #define STARPU_CUBLAS_OOPS() do { \
-		printf("oops  in %s ... %s \n", __func__, errormsg); \
+		printf("oops  in %s ... %s \n", __starpu_func__, errormsg); \
 		assert(0);						\
 	} while (0);
 #endif

+ 2 - 5
include/starpu_opencl.h

@@ -24,15 +24,12 @@
 #else
 #include <CL/cl.h>
 #endif
+#include <starpu_config.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifdef _MSC_VER
-#define __func__ __FUNCTION__
-#endif
-
 #define STARPU_OPENCL_DISPLAY_ERROR(status)                                     \
 	do {                                                            \
                 const char *errormsg;                                   \
@@ -179,7 +176,7 @@ extern "C" {
 			errormsg = "unknown error";			\
 			break;			                        \
 		}                                                       \
-		printf("oops in %s ... <%s> (%d) \n", __func__, errormsg, status); \
+		printf("oops in %s ... <%s> (%d) \n", __starpu_func__, errormsg, status); \
 	} while (0)
 
 #define STARPU_OPENCL_REPORT_ERROR(status)                                     \