Forráskód Böngészése

mpi/src: add extern C for C++ and macro to avoid double inclusion

Nathalie Furmento 12 éve
szülő
commit
b3d466e59a
3 módosított fájl, 28 hozzáadás és 1 törlés
  1. 8 1
      mpi/src/starpu_mpi_fxt.h
  2. 8 0
      mpi/src/starpu_mpi_private.h
  3. 12 0
      mpi/src/starpu_mpi_stats.h

+ 8 - 1
mpi/src/starpu_mpi_fxt.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -22,6 +22,10 @@
 #include <common/config.h>
 #include <common/fxt.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define FUT_MPI_BARRIER		0x5201
 #define FUT_MPI_ISEND		0x5202
 #define FUT_MPI_IRECV_END	0x5203
@@ -40,6 +44,9 @@
 #define TRACE_MPI_IRECV_END(a, b)	do {} while(0);
 #endif
 
+#ifdef __cplusplus
+}
+#endif
 
 
 #endif // __STARPU_MPI_FXT_H__

+ 8 - 0
mpi/src/starpu_mpi_private.h

@@ -26,6 +26,10 @@
 #include <common/utils.h>
 #include <pthread.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 //#define STARPU_MPI_VERBOSE	1
 
 #ifdef STARPU_MPI_VERBOSE
@@ -96,4 +100,8 @@ LIST_TYPE(_starpu_mpi_req,
 	void (*callback)(void *);
 );
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif // __STARPU_MPI_PRIVATE_H__

+ 12 - 0
mpi/src/starpu_mpi_stats.h

@@ -14,11 +14,23 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#ifndef __STARPU_MPI_STATS_H__
+#define __STARPU_MPI_STATS_H__
+
 #include <stdlib.h>
 #include <mpi.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void _starpu_mpi_comm_amounts_init(MPI_Comm comm);
 void _starpu_mpi_comm_amounts_free();
 void _starpu_mpi_comm_amounts_inc(MPI_Comm comm, unsigned dst, MPI_Datatype datatype, int count);
 void _starpu_mpi_comm_amounts_display(int node);
 
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __STARPU_MPI_STATS_H__