Browse Source

avoid #including headers inside extern "C" {}, since those headers might have c++ snippets

Samuel Thibault 9 years ago
parent
commit
759b65a2ce
3 changed files with 13 additions and 13 deletions
  1. 4 4
      include/pthread_win32/pthread.h
  2. 4 4
      include/starpu_sched_component.h
  3. 5 5
      include/starpu_thread.h

+ 4 - 4
include/pthread_win32/pthread.h

@@ -27,10 +27,6 @@
  * pthread_spinlock_*
  */
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
 #include <windows.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -62,6 +58,10 @@ extern "C" {
 #define winPthreadAssert(expr) do { if (!(expr)) return EIO; } while (0)
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
 /***********
  * threads *
  ***********/

+ 4 - 4
include/starpu_sched_component.h

@@ -20,15 +20,15 @@
 
 #include <starpu.h>
 
+#ifdef STARPU_HAVE_HWLOC
+#include <hwloc.h>
+#endif
+
 #ifdef __cplusplus
 extern "C"
 {
 #endif
 
-#ifdef STARPU_HAVE_HWLOC
-#include <hwloc.h>
-#endif
-
 enum starpu_sched_component_properties
 {
 	STARPU_SCHED_COMPONENT_HOMOGENEOUS = (1<<0),

+ 5 - 5
include/starpu_thread.h

@@ -18,11 +18,6 @@
 #ifndef __STARPU_THREAD_H__
 #define __STARPU_THREAD_H__
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
 #include <starpu_config.h>
 #include <starpu_util.h>
 #ifdef STARPU_SIMGRID
@@ -37,6 +32,11 @@ extern "C"
 #endif
 #include <stdint.h>
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 /*
  * Encapsulation of the pthread_create function.
  */